|
|
@ -30,6 +30,7 @@ import org.springframework.boot.autoconfigure.condition.ConditionalOnClass;
|
|
|
|
import org.springframework.boot.autoconfigure.condition.ConditionalOnCloudPlatform;
|
|
|
|
import org.springframework.boot.autoconfigure.condition.ConditionalOnCloudPlatform;
|
|
|
|
import org.springframework.boot.autoconfigure.condition.ConditionalOnProperty;
|
|
|
|
import org.springframework.boot.autoconfigure.condition.ConditionalOnProperty;
|
|
|
|
import org.springframework.boot.autoconfigure.security.IgnoredRequestCustomizer;
|
|
|
|
import org.springframework.boot.autoconfigure.security.IgnoredRequestCustomizer;
|
|
|
|
|
|
|
|
import org.springframework.boot.bind.RelaxedPropertyResolver;
|
|
|
|
import org.springframework.boot.cloud.CloudPlatform;
|
|
|
|
import org.springframework.boot.cloud.CloudPlatform;
|
|
|
|
import org.springframework.boot.web.client.RestTemplateBuilder;
|
|
|
|
import org.springframework.boot.web.client.RestTemplateBuilder;
|
|
|
|
import org.springframework.context.annotation.Bean;
|
|
|
|
import org.springframework.context.annotation.Bean;
|
|
|
@ -83,9 +84,11 @@ public class CloudFoundryActuatorAutoConfiguration {
|
|
|
|
|
|
|
|
|
|
|
|
private CloudFoundrySecurityService getCloudFoundrySecurityService(
|
|
|
|
private CloudFoundrySecurityService getCloudFoundrySecurityService(
|
|
|
|
RestTemplateBuilder restTemplateBuilder, Environment environment) {
|
|
|
|
RestTemplateBuilder restTemplateBuilder, Environment environment) {
|
|
|
|
|
|
|
|
RelaxedPropertyResolver cloudFoundryProperties = new RelaxedPropertyResolver(
|
|
|
|
|
|
|
|
environment, "management.cloudfoundry.");
|
|
|
|
String cloudControllerUrl = environment.getProperty("vcap.application.cf_api");
|
|
|
|
String cloudControllerUrl = environment.getProperty("vcap.application.cf_api");
|
|
|
|
boolean skipSslValidation = Boolean.parseBoolean(
|
|
|
|
boolean skipSslValidation = cloudFoundryProperties
|
|
|
|
environment.getProperty("management.cloudfoundry.skipSslValidation"));
|
|
|
|
.getProperty("skip-ssl-validation", Boolean.class, false);
|
|
|
|
return cloudControllerUrl == null ? null
|
|
|
|
return cloudControllerUrl == null ? null
|
|
|
|
: new CloudFoundrySecurityService(restTemplateBuilder, cloudControllerUrl,
|
|
|
|
: new CloudFoundrySecurityService(restTemplateBuilder, cloudControllerUrl,
|
|
|
|
skipSslValidation);
|
|
|
|
skipSslValidation);
|
|
|
|