handavid opened a new pull request, #1535: URL: https://github.com/apache/knox/pull/1535
[KNOX-3605](https://issues.apache.org/jira/browse/KNOX-3605) - Skip role lookup when memberOf not requested ## What changes were proposed in this pull request? The LDAPRolesLookupInterceptor skips role lookup if the memberOf attribute is not set as an returning attribute. ## How was this patch tested? Added unit tests. Manually tested by submitting search requests with and without the `memberOf` attribute. search for user without memberOf ``` ldapsearch -v -x -H ldap://localhost:3890 -D 'uid=bind2,ou=people,dc=proxy,dc=com' -w bind-password -E pr=250/noprompt -b 'ou=people,DC=proxy,DC=com' -s sub '(&(objectClass=inetOrgPerson)(cn=sam))' cn # sam, people, proxy.com dn: CN=sam,ou=people,dc=proxy,dc=com cn: sam ``` search for user with memberOf ``` ldapsearch -v -x -H ldap://localhost:3890 -D 'uid=bind2,ou=people,dc=proxy,dc=com' -w bind-password -E pr=250/noprompt -b 'ou=people,DC=proxy,DC=com' -s sub '(&(objectClass=inetOrgPerson)(cn=sam))' cn memberOf # sam, people, proxy.com dn: CN=sam,ou=people,dc=proxy,dc=com cn: sam memberOf: cn=datahub-2:env-admin,ou=groups,dc=proxy,dc=com memberOf: cn=security:cluster-admin,ou=groups,dc=proxy,dc=com memberOf: cn=dw-cluster-a:env-admin,ou=groups,dc=proxy,dc=com memberOf: cn=security:awc-admin,ou=groups,dc=proxy,dc=com memberOf: cn=env-staging:auditor,ou=groups,dc=proxy,dc=com memberOf: cn=datahub-1:power-user,ou=groups,dc=proxy,dc=com memberOf: cn=env-dev:env-admin,ou=groups,dc=proxy,dc=com memberOf: cn=datahub-2:editor,ou=groups,dc=proxy,dc=com ``` ## Integration Tests Added integration test that searches against the ldap proxy with the roles server configured. It searches for a user without specifying the `memberOf` attribute and verifies that no `memberOf` attributes are returned. ## UI changes No UI changes -- 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]
