smolnar82 opened a new pull request, #1266: URL: https://github.com/apache/knox/pull/1266
[KNOX-3351](https://issues.apache.org/jira/browse/KNOX-3351) - Resolve LDAP roles for users with no groups ## What changes were proposed in this pull request? Modified `AbstractAuthResource` to ensure that LDAP role lookup is performed even if the user does not belong to any groups. Key changes: - Moved the `lookupRoles` call outside of the `matchingGroupNames.isEmpty()` check to allow role resolution for users with zero groups. - Updated the header addition logic to trigger if either groups or roles are present - Refactored `lookupRoles` to consistently return an empty collection instead of `null`, simplifying the downstream logic and avoiding `NullPointerException` risks. This ensures that users with no groups can still have their roles resolved and included in the `X-Knox-Actor-Groups` headers. ## How was this patch tested? Verified the logic change ensures `lookupRoles` is invoked even when the initial group set is empty (by running existing unit tests). ## Integration Tests N/A ## UI changes N/A -- 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]
