mirror of
https://github.com/spring-projects/spring-boot.git
synced 2026-09-17 20:19:06 +00:00
Start building against Spring LDAP 4.1.0-M1 snapshots
See gh-49119
This commit is contained in:
+5
-3
@@ -244,9 +244,11 @@ public final class EmbeddedLdapAutoConfiguration implements DisposableBean {
|
||||
EmbeddedLdapProperties embeddedProperties) {
|
||||
LdapContextSource source = new LdapContextSource();
|
||||
source.setBase(properties.getBase());
|
||||
if (embeddedProperties.getCredential().isAvailable()) {
|
||||
source.setUserDn(embeddedProperties.getCredential().getUsername());
|
||||
source.setPassword(embeddedProperties.getCredential().getPassword());
|
||||
String username = embeddedProperties.getCredential().getUsername();
|
||||
String password = embeddedProperties.getCredential().getPassword();
|
||||
if (StringUtils.hasText(username) && StringUtils.hasText(password)) {
|
||||
source.setUserDn(username);
|
||||
source.setPassword(password);
|
||||
}
|
||||
source.setUrls(properties.determineUrls(environment));
|
||||
return source;
|
||||
|
||||
-5
@@ -24,7 +24,6 @@ import org.jspecify.annotations.Nullable;
|
||||
import org.springframework.boot.context.properties.ConfigurationProperties;
|
||||
import org.springframework.boot.convert.Delimiter;
|
||||
import org.springframework.core.io.Resource;
|
||||
import org.springframework.util.StringUtils;
|
||||
|
||||
/**
|
||||
* Configuration properties for Embedded LDAP.
|
||||
@@ -135,10 +134,6 @@ public class EmbeddedLdapProperties {
|
||||
this.password = password;
|
||||
}
|
||||
|
||||
boolean isAvailable() {
|
||||
return StringUtils.hasText(this.username) && StringUtils.hasText(this.password);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
public static class Ssl {
|
||||
|
||||
+5
-3
@@ -37,7 +37,7 @@ import org.springframework.util.Assert;
|
||||
*/
|
||||
public class LdapHealthIndicator extends AbstractHealthIndicator {
|
||||
|
||||
private static final ContextExecutor<String> versionContextExecutor = new VersionContextExecutor();
|
||||
private static final ContextExecutor<@Nullable String> versionContextExecutor = new VersionContextExecutor();
|
||||
|
||||
private final LdapOperations ldapOperations;
|
||||
|
||||
@@ -50,10 +50,12 @@ public class LdapHealthIndicator extends AbstractHealthIndicator {
|
||||
@Override
|
||||
protected void doHealthCheck(Health.Builder builder) throws Exception {
|
||||
String version = this.ldapOperations.executeReadOnly(versionContextExecutor);
|
||||
builder.up().withDetail("version", version);
|
||||
if (version != null) {
|
||||
builder.up().withDetail("version", version);
|
||||
}
|
||||
}
|
||||
|
||||
private static final class VersionContextExecutor implements ContextExecutor<String> {
|
||||
private static final class VersionContextExecutor implements ContextExecutor<@Nullable String> {
|
||||
|
||||
@Override
|
||||
public @Nullable String executeWithContext(DirContext ctx) throws NamingException {
|
||||
|
||||
+1
-3
@@ -272,9 +272,7 @@ class LdapAutoConfigurationTests {
|
||||
@Bean
|
||||
@Primary
|
||||
PooledContextSource pooledContextSource(LdapContextSource ldapContextSource) {
|
||||
PooledContextSource pooledContextSource = new PooledContextSource(new PoolConfig());
|
||||
pooledContextSource.setContextSource(ldapContextSource);
|
||||
return pooledContextSource;
|
||||
return new PooledContextSource(ldapContextSource, new PoolConfig());
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -2549,7 +2549,7 @@ bom {
|
||||
releaseNotes("https://github.com/spring-projects/spring-kafka/releases/tag/v{version}")
|
||||
}
|
||||
}
|
||||
library("Spring LDAP", "4.0.1") {
|
||||
library("Spring LDAP", "4.1.0-SNAPSHOT") {
|
||||
considerSnapshots()
|
||||
group("org.springframework.ldap") {
|
||||
modules = [
|
||||
|
||||
Reference in New Issue
Block a user