@Configuration(proxyBeanMethods=false) public abstract class AbstractVaultConfiguration extends Object implements org.springframework.context.ApplicationContextAware
| Modifier and Type | Class and Description |
|---|---|
static class |
AbstractVaultConfiguration.ClientFactoryWrapper
Wrapper for
ClientHttpRequestFactory to not expose the bean globally. |
static class |
AbstractVaultConfiguration.TaskSchedulerWrapper
Wrapper to keep
ThreadPoolTaskScheduler local to Spring Vault and to not
expose the bean globally. |
| Constructor and Description |
|---|
AbstractVaultConfiguration() |
| Modifier and Type | Method and Description |
|---|---|
abstract ClientAuthentication |
clientAuthentication()
Annotate with
Bean in case you want to expose a
ClientAuthentication instance to the
ApplicationContext. |
AbstractVaultConfiguration.ClientFactoryWrapper |
clientHttpRequestFactoryWrapper()
Create a
AbstractVaultConfiguration.ClientFactoryWrapper containing a ClientHttpRequestFactory
. |
ClientOptions |
clientOptions() |
protected org.springframework.beans.factory.BeanFactory |
getBeanFactory() |
protected org.springframework.core.env.Environment |
getEnvironment()
Return the
Environment to access property sources during Spring Vault
bootstrapping. |
protected RestTemplateFactory |
getRestTemplateFactory()
Return the
RestTemplateFactory. |
protected org.springframework.scheduling.concurrent.ThreadPoolTaskScheduler |
getVaultThreadPoolTaskScheduler() |
org.springframework.web.client.RestOperations |
restOperations()
Construct a
RestOperations object configured for Vault session management
and authentication usage. |
protected RestTemplateBuilder |
restTemplateBuilder(VaultEndpointProvider endpointProvider,
org.springframework.http.client.ClientHttpRequestFactory requestFactory)
|
RestTemplateFactory |
restTemplateFactory(AbstractVaultConfiguration.ClientFactoryWrapper requestFactoryWrapper)
Create a
RestTemplateFactory bean that is used to produce
RestTemplate. |
SecretLeaseContainer |
secretLeaseContainer()
|
SessionManager |
sessionManager()
Construct a
LifecycleAwareSessionManager using
clientAuthentication(). |
void |
setApplicationContext(org.springframework.context.ApplicationContext applicationContext) |
SslConfiguration |
sslConfiguration() |
AbstractVaultConfiguration.TaskSchedulerWrapper |
threadPoolTaskScheduler()
Create a
AbstractVaultConfiguration.TaskSchedulerWrapper used by LifecycleAwareSessionManager
and SecretLeaseContainer wrapping
ThreadPoolTaskScheduler. |
abstract VaultEndpoint |
vaultEndpoint() |
VaultEndpointProvider |
vaultEndpointProvider() |
VaultTemplate |
vaultTemplate()
Create a
VaultTemplate. |
public abstract VaultEndpoint vaultEndpoint()
public VaultEndpointProvider vaultEndpointProvider()
VaultEndpointProvider returning the value of
vaultEndpoint().public abstract ClientAuthentication clientAuthentication()
Bean in case you want to expose a
ClientAuthentication instance to the
ApplicationContext.ClientAuthentication to use. Must not be null.protected RestTemplateBuilder restTemplateBuilder(VaultEndpointProvider endpointProvider, org.springframework.http.client.ClientHttpRequestFactory requestFactory)
RestTemplateBuilder initialized with VaultEndpointProvider
and ClientHttpRequestFactory. May be overridden by subclasses.RestTemplateBuilder.vaultEndpointProvider(),
clientHttpRequestFactoryWrapper()@Bean public RestTemplateFactory restTemplateFactory(AbstractVaultConfiguration.ClientFactoryWrapper requestFactoryWrapper)
RestTemplateFactory bean that is used to produce
RestTemplate.RestTemplateFactory.vaultEndpointProvider(),
clientHttpRequestFactoryWrapper()@Bean public VaultTemplate vaultTemplate()
VaultTemplate.VaultTemplate.vaultEndpointProvider(),
clientHttpRequestFactoryWrapper(),
sessionManager()@Bean public SessionManager sessionManager()
LifecycleAwareSessionManager using
clientAuthentication(). This SessionManager uses
threadPoolTaskScheduler().SessionManager for Vault session management.SessionManager,
LifecycleAwareSessionManager,
restOperations(),
clientAuthentication(),
()@Bean public SecretLeaseContainer secretLeaseContainer() throws Exception
SecretLeaseContainer to allocate, renew and rotate secrets and
their leases.ExceptionvaultTemplate(),
threadPoolTaskScheduler()@Bean(value="vaultThreadPoolTaskScheduler") public AbstractVaultConfiguration.TaskSchedulerWrapper threadPoolTaskScheduler()
AbstractVaultConfiguration.TaskSchedulerWrapper used by LifecycleAwareSessionManager
and SecretLeaseContainer wrapping
ThreadPoolTaskScheduler. Subclasses may override this method to reuse a
different/existing scheduler.AbstractVaultConfiguration.TaskSchedulerWrapper to use. Must not be null.AbstractVaultConfiguration.TaskSchedulerWrapper.fromInstance(ThreadPoolTaskScheduler)public org.springframework.web.client.RestOperations restOperations()
RestOperations object configured for Vault session management
and authentication usage. Can be customized by providing a
RestTemplateFactory bean.RestOperations to be used for Vault access.restTemplateFactory(ClientFactoryWrapper)@Bean public 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.clientOptions(),
sslConfiguration()public ClientOptions clientOptions()
ClientOptions to configure communication parameters.ClientOptionspublic SslConfiguration sslConfiguration()
SslConfiguration.unconfigured().SslConfiguration,
SslConfiguration.unconfigured()protected org.springframework.core.env.Environment getEnvironment()
Environment to access property sources during Spring Vault
bootstrapping. Requires ApplicationContext to be set.Environment to access property sources during Spring Vault
bootstrapping.public void setApplicationContext(org.springframework.context.ApplicationContext applicationContext)
throws org.springframework.beans.BeansException
setApplicationContext in interface org.springframework.context.ApplicationContextAwareorg.springframework.beans.BeansExceptionprotected RestTemplateFactory getRestTemplateFactory()
RestTemplateFactory.RestTemplateFactory bean.protected org.springframework.scheduling.concurrent.ThreadPoolTaskScheduler getVaultThreadPoolTaskScheduler()
protected org.springframework.beans.factory.BeanFactory getBeanFactory()
Copyright © 2016–2024 Pivotal Software, Inc.. All rights reserved.