Skip to content

[#1150] Cleanup/Refactor Files and Classes#1151

Merged
ThatSilentCoder merged 2 commits intomainfrom
v3.1_issue_1150-cleanup-unused-files-and-classes
Mar 30, 2026
Merged

[#1150] Cleanup/Refactor Files and Classes#1151
ThatSilentCoder merged 2 commits intomainfrom
v3.1_issue_1150-cleanup-unused-files-and-classes

Conversation

@ThatSilentCoder
Copy link
Copy Markdown
Contributor

@ThatSilentCoder ThatSilentCoder commented Mar 26, 2026

Description

This issue focuses on cleaning up unused files, classes, and methods throughout the codebase, relocating files and classes to the appropriate packages, refactoring class names, and reorganizing services and controllers for clarity and proper structure. All these changes come from #1127 and #1105. This PR was also created with the intention of reducing the number of lines of files changed in those respective PRs.


Test Instructions:

  1. Run the ACA using your preferred method.
  2. Verify that everything compiles, builds and runs fine.

Summary Of Changes:

  • Refactored the REST controller and service classes (specifically the Identity Claim and Certificate Processor classes) to align with proper Spring Boot MVC design patterns.

  • Converted the Identity Claim and Certificate Processor classes into Spring-managed services by annotating them with @Service annotation, as they were effectively acting as services.

  • Simplified the Identity Claim and Certificate Processor classes by moving unrelated logic into appropriate service classes, reducing complexity and better adhering to the Single Responsibility Principle.

  • Converted utility classes used by the Identity Claim and Certificate Processor classes into Spring-managed service classes, as they contained business logic and repository interactions.

  • Deleted unused files and dead code that were encountered as I was looking at [#1101] Fix JavaDoc Generation Errors/Warnings #1105.

  • Renamed service, repository, and controller classes, replacing 'Credential' with 'Certificate' in their names.


Issues This PR Addresses:

Closes #1150

@ThatSilentCoder ThatSilentCoder added the refactor Code improvements, restructuring, or cleanup without changing external behavior. label Mar 26, 2026
@ThatSilentCoder ThatSilentCoder linked an issue Mar 26, 2026 that may be closed by this pull request
@ThatSilentCoder ThatSilentCoder added cleanup Cleaning up/re-organizing code v3.2.0 Issues for Release 3.2.0 of the ACA labels Mar 26, 2026
…ice classes and addressed checkstyle warnings.
*/
@Service
@Log4j2
public class DeviceInfoProcessorService {
Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This service class is essentially code that was extracted from the IdentityClaimProcessor.java. This change was also made in #1127 but was placed here to reduce the num of lines changed in the original PR.

*/
@Service
@Log4j2
public class Tpm2ProvisionerStateService {
Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This change was also made in #1127 but was placed here to reduce the num of lines changed in the original PR.

import java.util.regex.Pattern;

@Log4j2
public class IdentityClaimProcessor extends AbstractProcessor {
Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Renamed to IdentityClaimProcessorService. This change was also made in #1127 but was placed here to reduce the num of lines changed in the original PR.

@Log4j2
@RestController
@RequestMapping("/HIRS_AttestationCA")
public class RestfulAttestationCertificateAuthority extends AttestationCertificateAuthority
Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This class has been renamed to AttestationCertificateAuthorityRestController. This change was also made in #1127 but was placed here to reduce the num of lines changed in the original PR.

@Service
@Log4j2
public class PlatformCredentialPageService {
public class PlatformCertificatePageService {
Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Changed Credential to Certificate in order to keep consistency throughout the code base.

@Log4j2
public class EndorsementCredentialPageService {
private final EndorsementCredentialRepository endorsementCredentialRepository;
public class EndorsementCertificatePageService {
Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Changed Credential to Certificate for consistency reasons.

* Test suite for {@link AttestationCertificateAuthority}.
*/
@TestInstance(TestInstance.Lifecycle.PER_CLASS) // needed to use non-static BeforeAll
public class AttestationCertificateAuthorityTest {
Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Renamed test class to AttestationCertificateAuthorityServiceTest

* Identity Request.
*/
@Log4j2
public abstract class AttestationCertificateAuthority {
Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Renamed to AttestationCertificateAuthorityService

/**
* Utility class which includes credential management functions used by the ACA.
*/
@Log4j2
Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Renamed to CredentialManagementService. This change was also made in #1127 but was placed here to reduce the num of lines changed in the original PR.

@Getter
@Log4j2
@NoArgsConstructor
public class AbstractProcessor {
Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This change was also made in #1127 but was placed here to reduce the num of lines changed in the original PR.

@ThatSilentCoder ThatSilentCoder merged commit 01edde9 into main Mar 30, 2026
7 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

cleanup Cleaning up/re-organizing code refactor Code improvements, restructuring, or cleanup without changing external behavior. v3.2.0 Issues for Release 3.2.0 of the ACA

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Cleanup/Refactor Unused Files and Classes

2 participants