[
https://issues.apache.org/jira/browse/KNOX-3328?focusedWorklogId=1021429&page=com.atlassian.jira.plugin.system.issuetabpanels:worklog-tabpanel#worklog-1021429
]
ASF GitHub Bot logged work on KNOX-3328:
----------------------------------------
Author: ASF GitHub Bot
Created on: 21/May/26 08:52
Start Date: 21/May/26 08:52
Worklog Time Spent: 10m
Work Description: smolnar82 commented on code in PR #1236:
URL: https://github.com/apache/knox/pull/1236#discussion_r3279869950
##########
gateway-server/src/main/java/org/apache/knox/gateway/services/ldap/backend/LdapProxyBackend.java:
##########
@@ -269,6 +274,18 @@ public Entry getUser(String username, SchemaManager
schemaManager) throws Except
return entry;
}
cursor.close();
+
+ // 2. Try search in group base if not found in user base
+ String groupFilter = "(cn=" + username + ")";
+ cursor = connection.search(groupSearchBase, groupFilter,
SearchScope.SUBTREE, "*", "+");
+ if (cursor.next()) {
+ Entry sourceEntry = cursor.get();
+ Entry entry = createProxyEntry(sourceEntry, username,
connection, schemaManager);
+ cursor.close();
+ return entry;
+ }
+ cursor.close();
+
return null;
Review Comment:
The `return null` is actually not new in this PR:
<img width="1115" height="584" alt="image"
src="https://github.com/user-attachments/assets/325ae564-e8ae-4769-ad41-5d0ce6de2590"
/>
According to the JavaDoc of the parent class, this is perfectly ok:
<img width="550" height="365" alt="image"
src="https://github.com/user-attachments/assets/bec69296-ad53-4d06-a79a-06d985b38b4c"
/>
On the other hand, I agree that it's good to have some DEBUG log.
Issue Time Tracking
-------------------
Worklog Id: (was: 1021429)
Time Spent: 1h 50m (was: 1h 40m)
> Support recursive group resolution in LDAP Proxy Service
> --------------------------------------------------------
>
> Key: KNOX-3328
> URL: https://issues.apache.org/jira/browse/KNOX-3328
> Project: Apache Knox
> Issue Type: Improvement
> Components: Server
> Affects Versions: 3.0.0
> Reporter: Sandor Molnar
> Assignee: Sandor Molnar
> Priority: Major
> Fix For: 3.0.0
>
> Time Spent: 1h 50m
> Remaining Estimate: 0h
>
> The current Knox LDAP proxy implementation only supports direct group
> memberships for users. When a client queries for a user's {{memberOf}}
> attribute, Knox only returns the groups where the user is an explicit member,
> ignoring any transitive or nested group memberships.
> Additionally, group entries themselves are not enriched with the {{memberOf}}
> attribute, making it difficult for clients to walk the hierarchy manually.
> This task implements:
> # Recursive group resolution for both search-based and {{memberOf}}-based
> lookups.
> # Strict cycle detection to prevent infinite loops in misconfigured LDAP
> environments.
> # Configurable depth limits to prevent performance degradation.
> # Enrichment of group-type entries with the {{memberOf}} attribute, allowing
> clients to see parent group memberships.
--
This message was sent by Atlassian Jira
(v8.20.10#820010)