suvodeep-pyne opened a new pull request, #16709: URL: https://github.com/apache/pinot/pull/16709
## Summary - Refactored all audit-related classes to use constructor injection instead of field injection for better testability and cleaner dependency management - Enhanced user identity resolution with configurable header-based and JWT-based extraction - Added comprehensive unit tests for the audit identity resolution system - Created dedicated AuditServiceBinder to encapsulate all audit-related dependency injection configuration ## Key Changes - **Constructor Injection**: Converted `AuditIdentityResolver`, `AuditRequestProcessor`, and `AuditLogFilter` to use constructor injection with final fields - **Enhanced Identity Resolution**: Added support for custom user ID headers and JWT claim extraction with fallback chain - **Improved Configuration**: Added `userid.header` and `userid.jwt.claim` configuration options - **Better Testing**: Eliminated reflection-based dependency injection in tests in favor of direct constructor calls - **Cleaner DI Architecture**: Moved audit service bindings to dedicated `AuditServiceBinder` class ## Test Plan - [x] Unit tests for `AuditIdentityResolver` covering header resolution, JWT claims, priority chains, and edge cases - [x] Updated `AuditRequestProcessorTest` to use constructor injection - [x] Verified all audit classes use proper constructor injection patterns - [x] Confirmed no reflection usage remains in test code - [x] Validated dependency chain works correctly through HK2 binding ## Technical Details - Added nimbus-jose-jwt dependency for JWT parsing - Implemented priority-based user resolution: custom header → JWT claim → JWT subject → null - Maintains backward compatibility while improving architecture - All dependencies are now immutable (final fields) and explicitly declared -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: [email protected] For queries about this service, please contact Infrastructure at: [email protected] --------------------------------------------------------------------- To unsubscribe, e-mail: [email protected] For additional commands, e-mail: [email protected]
