@Configuration
@ConditionalOnProperty(name="spring.cloud.vault.enabled",
matchIfMissing=true)
@EnableConfigurationProperties(value=VaultProperties.class)
@Order(value=2147483642)
public class VaultBootstrapConfiguration
extends Object
implements org.springframework.beans.factory.InitializingBean
Auto-configuration for Spring Vault support.| Modifier and Type | Class and Description |
|---|---|
static class |
VaultBootstrapConfiguration.TaskSchedulerWrapper
Wrapper to keep
TaskScheduler local to Spring Cloud Vault. |
| Constructor and Description |
|---|
VaultBootstrapConfiguration(org.springframework.context.ConfigurableApplicationContext applicationContext,
VaultProperties vaultProperties,
org.springframework.beans.factory.ObjectProvider<org.springframework.vault.client.VaultEndpointProvider> endpointProvider) |
| Modifier and Type | Method and Description |
|---|---|
void |
afterPropertiesSet() |
org.springframework.vault.authentication.ClientAuthentication |
clientAuthentication() |
org.springframework.vault.config.AbstractVaultConfiguration.ClientFactoryWrapper |
clientHttpRequestFactoryWrapper()
Creates a
AbstractVaultConfiguration.ClientFactoryWrapper containing a
ClientHttpRequestFactory. |
org.springframework.vault.authentication.SessionManager |
sessionManager(org.springframework.vault.authentication.ClientAuthentication clientAuthentication,
org.springframework.beans.factory.ObjectFactory<VaultBootstrapConfiguration.TaskSchedulerWrapper> asyncTaskExecutorFactory) |
VaultBootstrapConfiguration.TaskSchedulerWrapper |
vaultTaskScheduler()
Creates a new
VaultBootstrapConfiguration.TaskSchedulerWrapper that encapsulates a bean implementing
TaskScheduler and AsyncTaskExecutor. |
org.springframework.vault.core.VaultTemplate |
vaultTemplate(org.springframework.vault.authentication.SessionManager sessionManager)
Creates a
VaultTemplate. |
public VaultBootstrapConfiguration(org.springframework.context.ConfigurableApplicationContext applicationContext,
VaultProperties vaultProperties,
org.springframework.beans.factory.ObjectProvider<org.springframework.vault.client.VaultEndpointProvider> endpointProvider)
public void afterPropertiesSet()
afterPropertiesSet in interface org.springframework.beans.factory.InitializingBean@Bean @ConditionalOnMissingBean public org.springframework.vault.config.AbstractVaultConfiguration.ClientFactoryWrapper clientHttpRequestFactoryWrapper()
AbstractVaultConfiguration.ClientFactoryWrapper containing a
ClientHttpRequestFactory. ClientHttpRequestFactory is not exposed
as root bean because ClientHttpRequestFactory is configured with
ClientOptions and SslConfiguration which are not necessarily
applicable for the whole application.AbstractVaultConfiguration.ClientFactoryWrapper to wrap a ClientHttpRequestFactory
instance.@Bean @ConditionalOnMissingBean public org.springframework.vault.core.VaultTemplate vaultTemplate(org.springframework.vault.authentication.SessionManager sessionManager)
VaultTemplate.clientHttpRequestFactoryWrapper()@Bean @Lazy @ConditionalOnMissingBean(value=VaultBootstrapConfiguration.TaskSchedulerWrapper.class) public VaultBootstrapConfiguration.TaskSchedulerWrapper vaultTaskScheduler()
VaultBootstrapConfiguration.TaskSchedulerWrapper that encapsulates a bean implementing
TaskScheduler and AsyncTaskExecutor.ThreadPoolTaskScheduler@Bean
@ConditionalOnMissingBean
public org.springframework.vault.authentication.SessionManager sessionManager(org.springframework.vault.authentication.ClientAuthentication clientAuthentication,
org.springframework.beans.factory.ObjectFactory<VaultBootstrapConfiguration.TaskSchedulerWrapper> asyncTaskExecutorFactory)
SessionManager for Vault session management.SessionManager,
LifecycleAwareSessionManager@Bean @ConditionalOnMissingBean public org.springframework.vault.authentication.ClientAuthentication clientAuthentication()
ClientAuthentication to obtain a
VaultToken.SessionManager,
LifecycleAwareSessionManagerCopyright © 2018 Pivotal Software, Inc.. All rights reserved.