Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Remove default use of LDAP_MATCHING_RULE_IN_CHAIN #441

Merged
merged 3 commits into from
Feb 4, 2025

Conversation

ghsolomon
Copy link
Contributor

Client reported that our use of LDAP_MATCHING_RULE_IN_CHAIN has a negative performance impact on their LDAP databases and is unnecessary when querying groups without deep nesting. Additionally, it is proprietary to MS and therefore not suitable for other LDAP implementations. This change recurses LDAP directories with its own code by default but provides a flag on xhLdapConfig to enable the previous implementation in cases where an AD instance uses deeply nested groups.

if (!visitedGroups.add(dn)) return []
List<LdapPerson> users = searchMany("(memberOf=$dn)", LdapPerson, strictMode)
List<LdapGroup> groups = searchMany("(memberOf=$dn)", LdapGroup, strictMode)
groups.each { LdapGroup group ->
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Think this looks generally fine, but a bit worried about the efficiency if we were handling huge user lists (I know its unlikely). Looks like groovy's unique is n^2!
(https://softwareengineering.stackexchange.com/questions/202113/whats-the-computational-complexity-of-the-groovy-unique-method)

Probably safest to pass a collector Set in to recursive method that gathers the unique users, and just convert it to a list in the caller. No need for the recursive method to return anything

Copy link
Member

@cnrudd cnrudd Feb 3, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@lbwexler lbwexler merged commit bb30fde into develop Feb 4, 2025
4 checks passed
@lbwexler lbwexler deleted the ldapRecursiveSearch branch February 4, 2025 15:53
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.

3 participants