Reduce need for bean method proxying and disable where not needed.
Closes gh-360.
This commit is contained in:
@@ -35,7 +35,7 @@ import org.springframework.vault.core.util.PropertyTransformer;
|
||||
*
|
||||
* @author Mark Paluch
|
||||
*/
|
||||
@Configuration
|
||||
@Configuration(proxyBeanMethods = false)
|
||||
@EnableConfigurationProperties(VaultAwsProperties.class)
|
||||
public class VaultConfigAwsBootstrapConfiguration {
|
||||
|
||||
@@ -65,7 +65,7 @@ public class VaultConfigAwsBootstrapConfiguration {
|
||||
|
||||
Assert.notNull(properties, "VaultAwsProperties must not be null");
|
||||
|
||||
final PropertyNameTransformer transformer = new PropertyNameTransformer();
|
||||
PropertyNameTransformer transformer = new PropertyNameTransformer();
|
||||
transformer.addKeyTransformation("access_key",
|
||||
properties.getAccessKeyProperty());
|
||||
transformer.addKeyTransformation("secret_key",
|
||||
|
||||
@@ -59,7 +59,7 @@ public class VaultConfigAwsBootstrapConfigurationTests extends IntegrationTestSu
|
||||
assertThat(metadata.getPath()).isEqualTo(this.properties.getRole());
|
||||
}
|
||||
|
||||
@Configuration
|
||||
@Configuration(proxyBeanMethods = false)
|
||||
public static class CustomBootstrapConfiguration {
|
||||
|
||||
@Bean
|
||||
|
||||
@@ -35,7 +35,7 @@ import org.springframework.vault.core.util.PropertyTransformer;
|
||||
*
|
||||
* @author Mark Paluch
|
||||
*/
|
||||
@Configuration
|
||||
@Configuration(proxyBeanMethods = false)
|
||||
@EnableConfigurationProperties(VaultConsulProperties.class)
|
||||
public class VaultConfigConsulBootstrapConfiguration {
|
||||
|
||||
@@ -63,7 +63,7 @@ public class VaultConfigConsulBootstrapConfiguration {
|
||||
|
||||
Assert.notNull(properties, "VaultConsulProperties must not be null");
|
||||
|
||||
final PropertyNameTransformer transformer = new PropertyNameTransformer();
|
||||
PropertyNameTransformer transformer = new PropertyNameTransformer();
|
||||
transformer.addKeyTransformation("token", properties.getTokenProperty());
|
||||
|
||||
return new SecretBackendMetadata() {
|
||||
|
||||
@@ -61,7 +61,7 @@ public class VaultConfigConsulBootstrapConfigurationTests extends IntegrationTes
|
||||
assertThat(metadata.getPath()).isEqualTo(this.properties.getRole());
|
||||
}
|
||||
|
||||
@Configuration
|
||||
@Configuration(proxyBeanMethods = false)
|
||||
public static class CustomBootstrapConfiguration {
|
||||
|
||||
@Bean
|
||||
|
||||
@@ -38,7 +38,7 @@ import org.springframework.vault.core.util.PropertyTransformer;
|
||||
* @author Per Abich
|
||||
* @author Sebastien Nahelou
|
||||
*/
|
||||
@Configuration
|
||||
@Configuration(proxyBeanMethods = false)
|
||||
@EnableConfigurationProperties({ VaultMySqlProperties.class,
|
||||
VaultPostgreSqlProperties.class, VaultCassandraProperties.class,
|
||||
VaultMongoProperties.class, VaultDatabaseProperties.class })
|
||||
@@ -71,7 +71,7 @@ public class VaultConfigDatabaseBootstrapConfiguration {
|
||||
|
||||
Assert.notNull(properties, "DatabaseSecretProperties must not be null");
|
||||
|
||||
final PropertyNameTransformer transformer = new PropertyNameTransformer();
|
||||
PropertyNameTransformer transformer = new PropertyNameTransformer();
|
||||
transformer.addKeyTransformation("username",
|
||||
properties.getUsernameProperty());
|
||||
transformer.addKeyTransformation("password",
|
||||
|
||||
@@ -61,7 +61,7 @@ public class VaultConfigDatabaseBootstrapConfigurationTests
|
||||
assertThat(metadata.getPath()).isEqualTo(this.properties.getRole());
|
||||
}
|
||||
|
||||
@Configuration
|
||||
@Configuration(proxyBeanMethods = false)
|
||||
public static class CustomBootstrapConfiguration {
|
||||
|
||||
@Bean
|
||||
|
||||
@@ -35,7 +35,7 @@ import org.springframework.vault.core.util.PropertyTransformer;
|
||||
*
|
||||
* @author Mark Paluch
|
||||
*/
|
||||
@Configuration
|
||||
@Configuration(proxyBeanMethods = false)
|
||||
@EnableConfigurationProperties
|
||||
public class VaultConfigRabbitMqBootstrapConfiguration {
|
||||
|
||||
@@ -71,7 +71,7 @@ public class VaultConfigRabbitMqBootstrapConfiguration {
|
||||
|
||||
Assert.notNull(properties, "VaultRabbitMqProperties must not be null");
|
||||
|
||||
final PropertyNameTransformer transformer = new PropertyNameTransformer();
|
||||
PropertyNameTransformer transformer = new PropertyNameTransformer();
|
||||
transformer.addKeyTransformation("username",
|
||||
properties.getUsernameProperty());
|
||||
transformer.addKeyTransformation("password",
|
||||
|
||||
@@ -61,7 +61,7 @@ public class VaultConfigRabbitMqBootstrapConfigurationTests
|
||||
assertThat(metadata.getPath()).isEqualTo(this.properties.getRole());
|
||||
}
|
||||
|
||||
@Configuration
|
||||
@Configuration(proxyBeanMethods = false)
|
||||
public static class CustomBootstrapConfiguration {
|
||||
|
||||
@Bean
|
||||
|
||||
@@ -41,7 +41,7 @@ import org.springframework.vault.client.VaultEndpointProvider;
|
||||
* @author Mark Paluch
|
||||
* @since 1.1
|
||||
*/
|
||||
@Configuration
|
||||
@Configuration(proxyBeanMethods = false)
|
||||
@ConditionalOnProperty("spring.cloud.vault.discovery.enabled")
|
||||
@EnableConfigurationProperties(VaultProperties.class)
|
||||
@Order(Ordered.LOWEST_PRECEDENCE - 2)
|
||||
@@ -69,9 +69,8 @@ public class DiscoveryClientVaultBootstrapConfiguration {
|
||||
public VaultEndpointProvider vaultEndpointProvider(
|
||||
VaultServiceInstanceProvider instanceProvider) {
|
||||
|
||||
final String serviceId = this.vaultProperties.getDiscovery().getServiceId();
|
||||
|
||||
final String fallbackScheme;
|
||||
String serviceId = this.vaultProperties.getDiscovery().getServiceId();
|
||||
String fallbackScheme;
|
||||
|
||||
if (StringUtils.hasText(this.vaultProperties.getUri())) {
|
||||
fallbackScheme = URI.create(this.vaultProperties.getUri()).getScheme();
|
||||
@@ -82,7 +81,7 @@ public class DiscoveryClientVaultBootstrapConfiguration {
|
||||
|
||||
ServiceInstance server = instanceProvider.getVaultServerInstance(serviceId);
|
||||
|
||||
final VaultEndpoint vaultEndpoint = VaultEndpoint.create(server.getHost(),
|
||||
VaultEndpoint vaultEndpoint = VaultEndpoint.create(server.getHost(),
|
||||
server.getPort());
|
||||
|
||||
if (server.getMetadata().containsKey("scheme")) {
|
||||
|
||||
@@ -66,7 +66,7 @@ import org.springframework.web.client.RestTemplate;
|
||||
* @author Spencer Gibb
|
||||
* @author Mark Paluch
|
||||
*/
|
||||
@Configuration
|
||||
@Configuration(proxyBeanMethods = false)
|
||||
@ConditionalOnProperty(name = "spring.cloud.vault.enabled", matchIfMissing = true)
|
||||
@EnableConfigurationProperties(VaultProperties.class)
|
||||
@Order(Ordered.LOWEST_PRECEDENCE - 5)
|
||||
|
||||
@@ -47,7 +47,7 @@ import org.springframework.vault.core.lease.SecretLeaseContainer;
|
||||
* @author Mårten Svantesson
|
||||
* @since 1.1
|
||||
*/
|
||||
@Configuration
|
||||
@Configuration(proxyBeanMethods = false)
|
||||
@ConditionalOnProperty(name = "spring.cloud.vault.enabled", matchIfMissing = true)
|
||||
@EnableConfigurationProperties({ VaultGenericBackendProperties.class,
|
||||
VaultKeyValueBackendProperties.class })
|
||||
|
||||
@@ -33,7 +33,7 @@ import org.springframework.context.annotation.Import;
|
||||
* @author Mark Paluch
|
||||
* @since 2.0
|
||||
*/
|
||||
@Configuration
|
||||
@Configuration(proxyBeanMethods = false)
|
||||
@ConditionalOnEnabledHealthIndicator("vault")
|
||||
@ConditionalOnBean(VaultBootstrapConfiguration.class)
|
||||
@ConditionalOnClass(HealthIndicator.class)
|
||||
|
||||
@@ -33,7 +33,7 @@ import org.springframework.vault.core.VaultOperations;
|
||||
* @author Mark Paluch
|
||||
* @since 1.1
|
||||
*/
|
||||
@Configuration
|
||||
@Configuration(proxyBeanMethods = false)
|
||||
@ConditionalOnBean(VaultOperations.class)
|
||||
class VaultHealthIndicatorConfiguration extends
|
||||
CompositeHealthIndicatorConfiguration<VaultHealthIndicator, VaultOperations> {
|
||||
|
||||
@@ -76,7 +76,7 @@ import org.springframework.web.reactive.function.client.WebClient;
|
||||
* @author Mark Paluch
|
||||
* @since 2.0.0
|
||||
*/
|
||||
@Configuration
|
||||
@Configuration(proxyBeanMethods = false)
|
||||
@ConditionalOnProperty(name = "spring.cloud.vault.enabled", matchIfMissing = true)
|
||||
@ConditionalOnExpression("${spring.cloud.vault.reactive.enabled:true}")
|
||||
@ConditionalOnClass({ Flux.class, WebClient.class, ReactiveVaultOperations.class,
|
||||
|
||||
@@ -35,7 +35,7 @@ import org.springframework.vault.core.ReactiveVaultOperations;
|
||||
* @author Mark Paluch
|
||||
* @since 2.0
|
||||
*/
|
||||
@Configuration
|
||||
@Configuration(proxyBeanMethods = false)
|
||||
@ConditionalOnClass(Flux.class)
|
||||
@ConditionalOnBean(ReactiveVaultOperations.class)
|
||||
class VaultReactiveHealthIndicatorConfiguration extends
|
||||
|
||||
@@ -97,7 +97,7 @@ public class DiscoveryClientVaultBootstrapConfigurationTests {
|
||||
|
||||
}
|
||||
|
||||
@Configuration
|
||||
@Configuration(proxyBeanMethods = false)
|
||||
static class DiscoveryConfiguration {
|
||||
|
||||
@Bean
|
||||
|
||||
@@ -118,7 +118,7 @@ public class VaultConfigAppIdCustomMechanismTests {
|
||||
|
||||
}
|
||||
|
||||
@Configuration
|
||||
@Configuration(proxyBeanMethods = false)
|
||||
public static class BootstrapConfiguration {
|
||||
|
||||
@ConditionalOnProperty("VaultConfigAppIdCustomMechanismTests.custom.config")
|
||||
|
||||
@@ -109,7 +109,7 @@ public class VaultReactiveBootstrapConfigurationTests {
|
||||
});
|
||||
}
|
||||
|
||||
@Configuration
|
||||
@Configuration(proxyBeanMethods = false)
|
||||
static class AuthenticationFactoryConfiguration {
|
||||
|
||||
@Bean
|
||||
@@ -119,7 +119,7 @@ public class VaultReactiveBootstrapConfigurationTests {
|
||||
|
||||
}
|
||||
|
||||
@Configuration
|
||||
@Configuration(proxyBeanMethods = false)
|
||||
static class TokenSupplierConfiguration {
|
||||
|
||||
@Bean
|
||||
|
||||
Reference in New Issue
Block a user