smolnar82 commented on code in PR #1318:
URL: https://github.com/apache/knox/pull/1318#discussion_r3631079730
##########
gateway-server/src/main/java/org/apache/knox/gateway/services/ldap/KnoxLDAPServerManager.java:
##########
@@ -470,6 +470,13 @@ public List<String> getUserGroups(String username) throws
Exception {
int commaIdx = groupDn.indexOf(',');
if (commaIdx > 0) {
groups.add(groupDn.substring(3, commaIdx));
+ } else if (hasRolesLookupInterceptor) {
Review Comment:
Thanks, @handavid , for your review. It's actually a really good idea so I
submitted a new commit that uses an already existing group parser util (by
`Dn`) instead of string operations.
I tested the updated code manually as well:
- backend LDAP with 0 groups + roles lookup enabled
- backend LDAP with 1+ groups + roles lookup enabled
- backend LDAP with 0 groups + roles lookup disabled
- backend LDAP with 1+ groups + roles lookup disabled
In all cases I got the desired output.
--
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]