[ 
https://issues.apache.org/jira/browse/KNOX-3328?focusedWorklogId=1022566&page=com.atlassian.jira.plugin.system.issuetabpanels:worklog-tabpanel#worklog-1022566
 ]

ASF GitHub Bot logged work on KNOX-3328:
----------------------------------------

                Author: ASF GitHub Bot
            Created on: 28/May/26 11:10
            Start Date: 28/May/26 11:10
    Worklog Time Spent: 10m 
      Work Description: hanicz commented on code in PR #1242:
URL: https://github.com/apache/knox/pull/1242#discussion_r3317318423


##########
gateway-server/src/main/java/org/apache/knox/gateway/services/ldap/LdapMessages.java:
##########
@@ -96,4 +96,10 @@ public interface LdapMessages {
     @Message(level = MessageLevel.ERROR,
             text = "Failed to copy attribute: {0}")
     void ldapAttributeCopyError(@StackTrace(level = MessageLevel.DEBUG) 
Exception e);
+
+    @Message(level = MessageLevel.DEBUG, text = "LDAP authentication succeeded 
for user: {0}")
+    void ldapAuthSucceeded(String user);
+
+    @Message(level = MessageLevel.DEBUG, text = "LDAP authentication failed 
for user: {0}")

Review Comment:
   I think this could be INFO level at least.



##########
gateway-server/src/main/java/org/apache/knox/gateway/services/ldap/backend/FileBackend.java:
##########
@@ -141,4 +142,25 @@ public List<Entry> searchUsers(String filter, 
SchemaManager schemaManager) throw
 
         return results;
     }
+
+    @Override
+    public boolean authenticate(String userDn, String password) {
+        // Extract username from DN (e.g., 
uid=admin,ou=people,dc=hadoop,dc=apache,dc=org)
+        String username = null;
+        if (userDn != null && userDn.startsWith("uid=")) {

Review Comment:
   I think the Dn class should be used to parse the user just like in 
`extractUsernameFromDn` method. This parsing logic could easily break.





Issue Time Tracking
-------------------

    Worklog Id:     (was: 1022566)
    Time Spent: 3h 20m  (was: 3h 10m)

> 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: 3h 20m
>  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)

Reply via email to