Move code from spring-boot-actuator to spring-boot-ldap

This commit is contained in:
Andy Wilkinson
2025-05-09 16:55:15 +01:00
committed by Phillip Webb
parent 0e489acfdb
commit 22e09fb277
7 changed files with 15 additions and 12 deletions

View File

@@ -20,12 +20,12 @@ import org.springframework.beans.factory.config.ConfigurableListableBeanFactory;
import org.springframework.boot.actuate.autoconfigure.health.CompositeHealthContributorConfiguration;
import org.springframework.boot.actuate.autoconfigure.health.ConditionalOnEnabledHealthIndicator;
import org.springframework.boot.actuate.health.HealthContributor;
import org.springframework.boot.actuate.ldap.LdapHealthIndicator;
import org.springframework.boot.autoconfigure.AutoConfiguration;
import org.springframework.boot.autoconfigure.EnableAutoConfiguration;
import org.springframework.boot.autoconfigure.condition.ConditionalOnBean;
import org.springframework.boot.autoconfigure.condition.ConditionalOnClass;
import org.springframework.boot.autoconfigure.condition.ConditionalOnMissingBean;
import org.springframework.boot.ldap.actuate.health.LdapHealthIndicator;
import org.springframework.context.annotation.Bean;
import org.springframework.ldap.core.LdapOperations;
@@ -37,7 +37,7 @@ import org.springframework.ldap.core.LdapOperations;
* @since 2.0.0
*/
@AutoConfiguration(afterName = "org.springframework.boot.ldap.autoconfigure.LdapAutoConfiguration")
@ConditionalOnClass(LdapOperations.class)
@ConditionalOnClass({ LdapOperations.class, LdapHealthIndicator.class })
@ConditionalOnBean(LdapOperations.class)
@ConditionalOnEnabledHealthIndicator("ldap")
public class LdapHealthContributorAutoConfiguration

View File

@@ -1,5 +1,5 @@
/*
* Copyright 2012-2023 the original author or authors.
* Copyright 2012-2025 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -19,8 +19,8 @@ package org.springframework.boot.actuate.autoconfigure.ldap;
import org.junit.jupiter.api.Test;
import org.springframework.boot.actuate.autoconfigure.health.HealthContributorAutoConfiguration;
import org.springframework.boot.actuate.ldap.LdapHealthIndicator;
import org.springframework.boot.autoconfigure.AutoConfigurations;
import org.springframework.boot.ldap.actuate.health.LdapHealthIndicator;
import org.springframework.boot.test.context.runner.ApplicationContextRunner;
import org.springframework.ldap.core.LdapOperations;

View File

@@ -73,7 +73,6 @@ dependencies {
optional("org.springframework:spring-web")
optional("org.springframework:spring-webmvc")
optional("org.springframework.graphql:spring-graphql")
optional("org.springframework.data:spring-data-ldap")
optional("org.springframework.data:spring-data-rest-webmvc")
optional("org.springframework.security:spring-security-core")
optional("org.springframework.security:spring-security-web")

View File

@@ -12,9 +12,13 @@ dependencies {
api(project(":spring-boot-project:spring-boot"))
api("org.springframework.ldap:spring-ldap-core")
compileOnly("com.fasterxml.jackson.core:jackson-annotations")
optional(project(":spring-boot-project:spring-boot-actuator"))
optional(project(":spring-boot-project:spring-boot-autoconfigure"))
optional("com.unboundid:unboundid-ldapsdk")
testCompileOnly("com.fasterxml.jackson.core:jackson-annotations")
testImplementation(project(":spring-boot-project:spring-boot-test"))
testImplementation(project(":spring-boot-project:spring-boot-tools:spring-boot-test-support"))

View File

@@ -14,7 +14,7 @@
* limitations under the License.
*/
package org.springframework.boot.actuate.ldap;
package org.springframework.boot.ldap.actuate.health;
import javax.naming.NamingException;
import javax.naming.directory.DirContext;
@@ -31,7 +31,7 @@ import org.springframework.util.Assert;
*
* @author Eddú Meléndez
* @author Stephane Nicoll
* @since 2.0.0
* @since 4.0.0
*/
public class LdapHealthIndicator extends AbstractHealthIndicator {

View File

@@ -1,5 +1,5 @@
/*
* Copyright 2012-2019 the original author or authors.
* Copyright 2012-2025 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -15,6 +15,6 @@
*/
/**
* Actuator support for LDAP.
* Health integration for LDAP.
*/
package org.springframework.boot.actuate.ldap;
package org.springframework.boot.ldap.actuate.health;

View File

@@ -1,5 +1,5 @@
/*
* Copyright 2012-2023 the original author or authors.
* Copyright 2012-2025 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -14,7 +14,7 @@
* limitations under the License.
*/
package org.springframework.boot.actuate.ldap;
package org.springframework.boot.ldap.actuate.health;
import org.junit.jupiter.api.Test;