Skip to content

Use modern Spring LDAP APIs#19408

Open
therepanic wants to merge 1 commit into
spring-projects:mainfrom
therepanic:use-modern-spring-ldap-apis
Open

Use modern Spring LDAP APIs#19408
therepanic wants to merge 1 commit into
spring-projects:mainfrom
therepanic:use-modern-spring-ldap-apis

Conversation

@therepanic

Copy link
Copy Markdown
Contributor

With the release of spring-ldap 4.1.0, the LdapClient API has been updated, so we should update our usage of it. See: spring-projects/spring-ldap#1446

Closes: gh-19407

With the release of spring-ldap 4.1.0, the `LdapClient` API has been
updated, so we should update our usage of it.

Closes: spring-projectsgh-19407

Signed-off-by: Andrey Litvitski <andrey1010102008@gmail.com>
@therepanic therepanic mentioned this pull request Jul 1, 2026
1 task
@therepanic

Copy link
Copy Markdown
Contributor Author

I suppose there are no more deprecated usages on this side.

@spring-projects-issues spring-projects-issues added the status: waiting-for-triage An issue we've not yet triaged label Jul 1, 2026
Comment on lines -318 to 321
DirContextOperations result = ldapClient.search().query(query).toEntry();
if (result == null) {
throw new IncorrectResultSizeDataAccessException(1, 0);
}
return result;
return ldapClient.search()
.query(query)
.<DirContextOperations>optional()
.orElseThrow(() -> new IncorrectResultSizeDataAccessException(1, 0));
}

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

A good case of this is the API update in Spring LDAP.

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.

Use modern Spring LDAP APIs

2 participants