@Configuration(proxyBeanMethods=false)
@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,
org.springframework.beans.factory.ObjectProvider<List<org.springframework.vault.client.RestTemplateCustomizer>> customizers,
org.springframework.beans.factory.ObjectProvider<List<org.springframework.vault.client.RestTemplateRequestCustomizer<?>>> requestCustomizers) |
| 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 |
vaultSessionManager(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()
Creates a
VaultTemplate. |
public VaultBootstrapConfiguration(org.springframework.context.ConfigurableApplicationContext applicationContext,
VaultProperties vaultProperties,
org.springframework.beans.factory.ObjectProvider<org.springframework.vault.client.VaultEndpointProvider> endpointProvider,
org.springframework.beans.factory.ObjectProvider<List<org.springframework.vault.client.RestTemplateCustomizer>> customizers,
org.springframework.beans.factory.ObjectProvider<List<org.springframework.vault.client.RestTemplateRequestCustomizer<?>>> requestCustomizers)
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(value=org.springframework.vault.core.VaultOperations.class) public org.springframework.vault.core.VaultTemplate vaultTemplate()
VaultTemplate.VaultTemplate bean.clientHttpRequestFactoryWrapper()@Bean @Lazy @ConditionalOnMissingBean(value=VaultBootstrapConfiguration.TaskSchedulerWrapper.class) public VaultBootstrapConfiguration.TaskSchedulerWrapper vaultTaskScheduler()
VaultBootstrapConfiguration.TaskSchedulerWrapper that encapsulates a bean implementing
TaskScheduler and AsyncTaskExecutor.VaultBootstrapConfiguration.TaskSchedulerWrapper bean.ThreadPoolTaskScheduler@Bean
@ConditionalOnMissingBean
@ConditionalOnAuthentication
public org.springframework.vault.authentication.SessionManager vaultSessionManager(org.springframework.vault.authentication.ClientAuthentication clientAuthentication,
org.springframework.beans.factory.ObjectFactory<VaultBootstrapConfiguration.TaskSchedulerWrapper> asyncTaskExecutorFactory)
clientAuthentication - the ClientAuthentication.asyncTaskExecutorFactory - the ObjectFactory for
VaultBootstrapConfiguration.TaskSchedulerWrapper.SessionManager for Vault session management.SessionManager,
LifecycleAwareSessionManager@Bean @ConditionalOnMissingBean @ConditionalOnAuthentication public org.springframework.vault.authentication.ClientAuthentication clientAuthentication()
ClientAuthentication to obtain a
VaultToken.SessionManager,
LifecycleAwareSessionManagerCopyright © 2021 Pivotal Software, Inc.. All rights reserved.