MBA-714: Create AuthenticationService Module Structure and Core Framework - #22
Merged
Merged
Conversation
…work Implemented ticket MBA-714 to create the AuthenticationService module with NIST 800-53 compliant authentication framework. ## Architectural Decisions: **Lightweight Approach (No Spring Security):** - Chose NOT to use Spring Security to maintain consistency with existing plain Java architecture - The project has NO Spring dependencies and uses Java 8 with minimal frameworks - Using jBCrypt (0.4) for password hashing instead of Spring Security - This avoids dependency bloat and maintains architectural consistency **Dependency Choices:** - JUnit 4.12: Maintained consistency with existing test framework - Mockito 3.12.4: Java 8 compatible testing framework - jBCrypt 0.4: Lightweight password hashing (NIST 800-53 IA-5 compliance) - Commons Codec 1.10: Additional cryptographic utilities - SLF4J 1.7.21: Consistent with existing logging framework - Guava 26.0-jre: Consistent with existing utility library ## Implementation Summary: **Module Structure:** - Created AuthenticationService Maven module following existing project patterns - Package structure: gov.uspto.auth with 9 sub-packages - Updated parent POM to include new module **Core Framework Classes (6 classes in auth/core/):** 1. AuthenticationContext - Thread-local authentication context with cleanup 2. AuthenticationProvider - Interface for multiple authentication mechanisms 3. AuthenticationResult - Result with audit trail for NIST 800-53 compliance 4. Principal - Authenticated user/service with roles and metadata 5. Credential - Abstract base class for different credential types 6. AuthenticationException - Base exception with error codes **Configuration Classes:** 1. AuthenticationConfig - Configuration with properties file and env var support 2. SecurityConstants - NIST 800-53 control mappings and security constants **Placeholder Interfaces (8 packages):** - authenticator/ - Authenticator management (IA-5 compliance) - identifier/ - Identifier management (IA-4 compliance) - identity/ - Identity proofing (IA-12 compliance) - session/ - Session management (IA-11 compliance) - service/ - Service authentication (IA-9 compliance) - policy/ - Authentication policies - crypto/ - Cryptographic operations - storage/ - File-based storage (basic interface, needs clarification) **Testing:** - Created 6 comprehensive unit test classes for core framework - All 28 tests pass successfully - Tests demonstrate thread-safety, validation, and error handling **Build Status:** - Module builds successfully with mvn clean install - All tests pass (28 tests, 0 failures, 0 errors) - Lint checks pass (mvn compile -DskipTests) ## NIST 800-53 Controls Addressed: - IA-1: Identification and Authentication Policy - IA-2: Identification and Authentication (Organizational Users) - IA-4: Identifier Management - IA-5: Authenticator Management - IA-9: Service Identification and Authentication - IA-11: Re-authentication - IA-12: Identity Proofing - AC-2: Account Management - AC-7: Unsuccessful Logon Attempts - AU-2: Audit Events ## Areas Requiring Team Clarification: 1. Storage package purpose - implemented basic interface for file-based storage 2. Integration points with existing BulkDownloader module 3. Specific authentication mechanisms to prioritize (password, token, certificate) Signed-off-by: Devin AI <devin@cognition.ai> Co-Authored-By: Jake Cosme <jake@cognition.ai>
Contributor
Author
🤖 Devin AI EngineerI'll be helping with this pull request! Here's what you should know: ✅ I will automatically:
Note: I can only respond to comments from users who have write access to this repository. ⚙️ Control Options:
|
10 tasks
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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 new AuthenticationService module to support NIST 800-53 compliant authentication in the USPTO Patent BulkDownloader project. This is a skeleton/framework implementation - it establishes the module structure, core interfaces, and placeholder classes but does not include actual authentication logic implementations.
Key Architectural Decision: Chose a lightweight approach WITHOUT Spring Security to maintain consistency with the existing plain Java architecture (Java 8, no Spring dependencies). Uses jBCrypt for password hashing instead.
What's Included:
AuthenticationServicewith proper parent POM integrationgov.uspto.auth.core/(AuthenticationContext, AuthenticationProvider, AuthenticationResult, Principal, Credential, AuthenticationException)What's NOT Included:
Review & Testing Checklist for Human
AuthenticationContext.javaThreadLocal usage carefully. In bulk processing scenarios with thread pools, is the cleanup mechanism (clear()) sufficient to prevent memory leaks?gov.uspto.auth/. Does this organization make sense for future microservices authentication implementation?mvn clean installfrom the project root to ensure the new module integrates properly with the existing build (note: there are 3 pre-existing test failures in PatentDocument module unrelated to this PR)Test Plan
cd AuthenticationService && mvn clean installsrc/test/java/gov/uspto/auth/core/to understand the framework behaviorNotes
Areas Flagged for Team Clarification:
storage/package is unclear - implemented basic file-based storage interface but needs team input on actual requirementsDependency Rationale:
NIST 800-53 Controls Addressed (framework only, implementations pending):
IA-1, IA-2, IA-4, IA-5, IA-9, IA-11, IA-12, AC-2, AC-7, AU-2
Link to Devin run: https://app.devin.ai/sessions/d5678f1ae3c8437da1860dc858cebc2e
Requested by: Jake Cosme (@jakexcosme)