Skip to content

Update LDAP authority and role handling to use LdapClient #17035

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

Draft
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

fer-marino
Copy link

refer #17028
Still a work in progress.

Replaced SpringSecurityLdapTemplate with LdapClient for improved LDAP search and entry handling. Refactored related methods and tests to handle NamingException, use LdapName for DNs, and support updated attribute handling with Attributes. Updated authority mapping logic to streamline nested group resolution and enhance test cases.

Integrarion tests for the NestedLdapAuthoritiesPopulator are failing. I can't find an efficient way to get the DN of the result set to build LdapAuthorities, so the resulting set is messed up.

Another major difference with the LdapTemplate is that every search result contains at least the key spring.security.ldap.dn while the LdapClient does not. This breaks some other tests that maybe can be removed.

Another note worth mentioning is that integration tests still uses ApacheDSContainer, which is deprecated and should be replaced by UnboundIdContainer

Comments are very welcome! :)

Replaced SpringSecurityLdapTemplate with LdapClient for improved LDAP search and entry handling. Refactored related methods and tests to handle `NamingException`, use `LdapName` for DNs, and support updated attribute handling with `Attributes`. Updated authority mapping logic to streamline nested group resolution and enhance test cases.

Signed-off-by: Fernando Marino <f.marino@stariongroup.eu>
@spring-projects-issues spring-projects-issues added the status: waiting-for-triage An issue we've not yet triaged label May 3, 2025
Copy link
Contributor

@jzheaux jzheaux left a comment

Choose a reason for hiding this comment

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

Thanks for the contribution, @fer-marino. It think there may be some misunderstanding that is causing this extra work for you. We cannot change public or protected constructors or methods as this will break applications when they upgrade. For this reason, the ticket indicates the following (emphasis mine)

Add an LdapAuthoritiesPopulator implementation that uses LdapClient

I hope this helps with some of your concerns about failing tests, etc., as well.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
status: waiting-for-triage An issue we've not yet triaged
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants