Skip to content

KNOX-3605: Skip role lookup when memberOf not requested - #1535

Open
handavid wants to merge 1 commit into
apache:masterfrom
handavid:KNOX-3605-skip-role-lookup-memberof
Open

handavid wants to merge 1 commit into
apache:masterfrom
handavid:KNOX-3605-skip-role-lookup-memberof

Conversation

@handavid

Copy link
Copy Markdown
Contributor

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

The LDAPRolesLookupInterceptor skips role lookup if the
memberOf attribute is not set as an returning attribute.

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant