smolnar82 opened a new pull request, #1545:
URL: https://github.com/apache/knox/pull/1545

   [KNOX-3618](https://issues.apache.org/jira/browse/KNOX-3618) - LDAP proxy 
floods gateway.log with ERR_13207_VALUE_ALREADY_EXISTS warnings for memberOf
   
   ## What changes were proposed in this pull request?
   
   With recursive group resolution enabled, 
`LdapProxyBackend#addGroupMemberships` adds every resolved group DN to the 
entry's `memberOf`. The resolved list includes the direct groups, which are 
already on the entry: from the remote `memberOf` when `useMemberOf=true`, or 
because AD returns `memberOf` for `"*"` otherwise. The Directory API drops each 
duplicate but logs `ERR_13207_VALUE_ALREADY_EXISTS` at WARN, one line per 
direct group, per user entry, per lookup.
   
   The fix skips group DNs the entry already contains before calling 
`entry.add()`. `Entry.contains()` and the duplicate check in 
`DefaultAttribute.add()` use the same equality, so the resulting `memberOf` 
values, and the roles derived from them, are unchanged.
   
   ## How was this patch tested?
   
   - Added 
`LdapProxyBackendTest#testGetUserUseMemberOfRecursiveDoesNotReAddExistingMemberOf`,
 which captures WARN events from the `DefaultAttribute` logger and asserts that 
none contains `ERR_13207`. It fails without the fix and passes with it.
   - `mvn verify` on `gateway-server` for `LdapProxyBackend*Test` and 
`LDAPRolesLookupInterceptorTest` (including the static checks): all tests pass.
   
   ## Integration Tests
   
   No integration test added. The change only removes a log warning and doesn't 
change LDAP proxy responses; the unit test above covers the regression.
   


-- 
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]

Reply via email to