MBA-714: Create AuthenticationService Module Structure and Core Framework #21
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
MBA-714: Create AuthenticationService Module Structure and Core Framework
Summary
This PR implements the foundational structure for a NIST 800-53 compliant authentication framework as part of the microservices architecture conversion for the USPTO Patent BulkDownloader project. The implementation creates a new Maven module with core authentication classes and placeholder interfaces for future development.
Key Components:
AuthenticationServicewith proper parent POM integrationArchitectural Decision: Used lightweight approach (jBCrypt 0.4 + Commons Codec 1.15) instead of Spring Security to maintain consistency with the existing Java 8 plain-Java architecture. This avoids introducing Spring Framework dependencies to a project that currently has none.
Build Status: ✅ All tests pass, module compiles successfully, integrates with parent POM
Review & Testing Checklist for Human
Verify architectural decision to avoid Spring Security - The ticket mentioned Spring Security, but I chose a lightweight approach to maintain consistency with the existing plain-Java codebase. Confirm this aligns with the project's long-term architecture goals.
Review thread-local cleanup mechanism -
AuthenticationContextuses ThreadLocal for storing the current principal. Verify the cleanup mechanism is sufficient for bulk processing scenarios (2,000-5,000 patents per file). CheckAuthenticationContext.clear()and the testAuthenticationContextTest.testThreadLocalIsolation().Validate placeholder interface method signatures - All 8 non-core packages contain only interfaces with no implementations. Review the method signatures in
AuthenticatorManager,IdentifierManager,IdentityProofing,SessionManager,ServiceAuthenticator,AuthenticationPolicy,CryptoService, andAuthenticationStorageto ensure they'll support the intended future implementations.Check dependency versions - Verify that jBCrypt 0.4, Commons Codec 1.15, and Mockito 3.12.4 are appropriate choices for this Java 8 project. Note that jBCrypt 0.4 is from 2014 but is stable and widely used.
Test module integration - Run
mvn clean installfrom the project root to verify the new module integrates properly with the existing build system and doesn't break any existing modules.Test Plan
cd ~/repos/USPTO-Patent-Public-Data && mvn clean installmvn test -pl AuthenticationService/tmp/architectural-decisions.md(if needed)Notes
What This PR Does NOT Include:
NIST 800-53 Compliance: The code includes JavaDoc references to NIST controls (IA-1, IA-2, IA-4, IA-5, IA-9, IA-11, IA-12), but actual compliance validation will require future implementation and security review.
Thread Safety: The
AuthenticationContextclass uses ThreadLocal and includes aclear()method that MUST be called in finally blocks to prevent memory leaks in bulk processing scenarios. This is documented but not enforced by the framework.Requested by: Jake Cosme (jake@cognition.ai) / @jakexcosme
Session: https://app.devin.ai/sessions/c03347953fca456a95291f2673322ca7