@Configuration(proxyBeanMethods=false) @ConditionalOnProperty(name="spring.cloud.vault.enabled", matchIfMissing=true) @ConditionalOnExpression(value="${spring.cloud.vault.reactive.enabled:true}") @ConditionalOnClass(value={reactor.core.publisher.Flux.class,org.springframework.web.reactive.function.client.WebClient.class,org.springframework.vault.core.ReactiveVaultOperations.class,reactor.netty.http.client.HttpClient.class}) @EnableConfigurationProperties(value=VaultProperties.class) @AutoConfigureBefore(value=VaultAutoConfiguration.class) public class VaultReactiveAutoConfiguration extends Object implements org.springframework.beans.factory.InitializingBean
Auto-configuration
for reactive Spring Vault support.
This auto-configuration only supports static endpoints without
VaultEndpointProvider
support as endpoint providers could be potentially
blocking implementations.
Modifier and Type | Class and Description |
---|---|
static class |
VaultReactiveAutoConfiguration.ClientHttpConnectorWrapper
Wrapper for
ClientHttpConnector to not expose the bean globally. |
Constructor and Description |
---|
VaultReactiveAutoConfiguration(org.springframework.context.ConfigurableApplicationContext applicationContext,
VaultProperties vaultProperties,
org.springframework.beans.factory.ObjectProvider<org.springframework.vault.client.ReactiveVaultEndpointProvider> reactiveEndpointProvider,
org.springframework.beans.factory.ObjectProvider<org.springframework.vault.client.VaultEndpointProvider> endpointProvider,
org.springframework.beans.factory.ObjectProvider<List<org.springframework.vault.client.WebClientCustomizer>> webClientCustomizers) |
VaultReactiveAutoConfiguration(VaultProperties vaultProperties,
org.springframework.beans.factory.ObjectProvider<org.springframework.vault.client.ReactiveVaultEndpointProvider> reactiveEndpointProvider,
org.springframework.beans.factory.ObjectProvider<org.springframework.vault.client.VaultEndpointProvider> endpointProvider,
org.springframework.beans.factory.ObjectProvider<List<org.springframework.vault.client.WebClientCustomizer>> webClientCustomizers)
Deprecated.
|
Modifier and Type | Method and Description |
---|---|
void |
afterPropertiesSet() |
VaultReactiveAutoConfiguration.ClientHttpConnectorWrapper |
clientHttpConnectorWrapper()
Creates a
VaultReactiveAutoConfiguration.ClientHttpConnectorWrapper containing a
ClientHttpConnector . |
protected org.springframework.http.client.reactive.ClientHttpConnector |
createConnector(VaultProperties vaultProperties)
Creates a
ClientHttpConnector configured with ClientOptions and
SslConfiguration which are not necessarily applicable for the whole
application. |
protected org.springframework.http.client.reactive.ClientHttpConnector |
getClientHttpConnector() |
org.springframework.vault.authentication.ReactiveSessionManager |
reactiveVaultSessionManager(org.springframework.beans.factory.BeanFactory beanFactory,
org.springframework.beans.factory.ObjectFactory<VaultAutoConfiguration.TaskSchedulerWrapper> asyncTaskExecutorFactory,
org.springframework.vault.client.WebClientFactory webClientFactory) |
org.springframework.vault.core.ReactiveVaultTemplate |
reactiveVaultTemplate(org.springframework.beans.factory.ObjectProvider<org.springframework.vault.authentication.ReactiveSessionManager> sessionManager)
Creates a
ReactiveVaultTemplate . |
org.springframework.vault.authentication.SessionManager |
vaultSessionManager(org.springframework.vault.authentication.ReactiveSessionManager sessionManager) |
org.springframework.vault.authentication.VaultTokenSupplier |
vaultTokenSupplier(org.springframework.beans.factory.ListableBeanFactory beanFactory,
org.springframework.vault.client.WebClientFactory webClientFactory) |
org.springframework.vault.client.WebClientFactory |
vaultWebClientFactory()
Create a
WebClientFactory bean that is used to produce WebClient . |
protected org.springframework.vault.client.WebClientBuilder |
webClientBuilder(org.springframework.http.client.reactive.ClientHttpConnector connector) |
@Deprecated public VaultReactiveAutoConfiguration(VaultProperties vaultProperties, org.springframework.beans.factory.ObjectProvider<org.springframework.vault.client.ReactiveVaultEndpointProvider> reactiveEndpointProvider, org.springframework.beans.factory.ObjectProvider<org.springframework.vault.client.VaultEndpointProvider> endpointProvider, org.springframework.beans.factory.ObjectProvider<List<org.springframework.vault.client.WebClientCustomizer>> webClientCustomizers)
VaultReactiveAutoConfiguration(ConfigurableApplicationContext, VaultProperties, ObjectProvider, ObjectProvider, ObjectProvider)
instead.@Autowired public VaultReactiveAutoConfiguration(@Nullable org.springframework.context.ConfigurableApplicationContext applicationContext, VaultProperties vaultProperties, org.springframework.beans.factory.ObjectProvider<org.springframework.vault.client.ReactiveVaultEndpointProvider> reactiveEndpointProvider, org.springframework.beans.factory.ObjectProvider<org.springframework.vault.client.VaultEndpointProvider> endpointProvider, org.springframework.beans.factory.ObjectProvider<List<org.springframework.vault.client.WebClientCustomizer>> webClientCustomizers)
protected org.springframework.vault.client.WebClientBuilder webClientBuilder(org.springframework.http.client.reactive.ClientHttpConnector connector)
@Bean @ConditionalOnMissingBean public VaultReactiveAutoConfiguration.ClientHttpConnectorWrapper clientHttpConnectorWrapper()
VaultReactiveAutoConfiguration.ClientHttpConnectorWrapper
containing a
ClientHttpConnector
. ClientHttpConnector
is not exposed as root
bean because ClientHttpConnector
is configured with ClientOptions
and SslConfiguration
which are not necessarily applicable for the whole
application.VaultReactiveAutoConfiguration.ClientHttpConnectorWrapper
to wrap a
ClientHttpConnector
instance.public void afterPropertiesSet()
afterPropertiesSet
in interface org.springframework.beans.factory.InitializingBean
protected org.springframework.http.client.reactive.ClientHttpConnector createConnector(VaultProperties vaultProperties)
ClientHttpConnector
configured with ClientOptions
and
SslConfiguration
which are not necessarily applicable for the whole
application.vaultProperties
- the Vault properties.ClientHttpConnector
.@Bean @ConditionalOnMissingBean public org.springframework.vault.client.WebClientFactory vaultWebClientFactory()
WebClientFactory
bean that is used to produce WebClient
.WebClientFactory
.protected org.springframework.http.client.reactive.ClientHttpConnector getClientHttpConnector()
@Bean @ConditionalOnMissingBean(value=org.springframework.vault.core.ReactiveVaultOperations.class) public org.springframework.vault.core.ReactiveVaultTemplate reactiveVaultTemplate(org.springframework.beans.factory.ObjectProvider<org.springframework.vault.authentication.ReactiveSessionManager> sessionManager)
ReactiveVaultTemplate
.sessionManager
- object provider for ReactiveSessionManager
.ReactiveVaultTemplate
bean.reactiveVaultSessionManager(BeanFactory, ObjectFactory, WebClientFactory)
@Bean @ConditionalOnMissingBean @ConditionalOnAuthentication public org.springframework.vault.authentication.ReactiveSessionManager reactiveVaultSessionManager(org.springframework.beans.factory.BeanFactory beanFactory, org.springframework.beans.factory.ObjectFactory<VaultAutoConfiguration.TaskSchedulerWrapper> asyncTaskExecutorFactory, org.springframework.vault.client.WebClientFactory webClientFactory)
beanFactory
- the BeanFactory
.asyncTaskExecutorFactory
- the ObjectFactory
for
VaultAutoConfiguration.TaskSchedulerWrapper
.webClientFactory
- the web client factoryReactiveSessionManager
for reactive session use.ReactiveSessionManager
,
ReactiveLifecycleAwareSessionManager
@Bean @ConditionalOnMissingBean @ConditionalOnAuthentication public org.springframework.vault.authentication.SessionManager vaultSessionManager(org.springframework.vault.authentication.ReactiveSessionManager sessionManager)
sessionManager
- the ReactiveSessionManager
.SessionManager
adapter wrapping ReactiveSessionManager
.@Bean @ConditionalOnMissingBean(name="vaultTokenSupplier") @ConditionalOnAuthentication public org.springframework.vault.authentication.VaultTokenSupplier vaultTokenSupplier(org.springframework.beans.factory.ListableBeanFactory beanFactory, org.springframework.vault.client.WebClientFactory webClientFactory)
beanFactory
- the BeanFactory
.webClientFactory
- the WebClientFactory
.VaultTokenSupplier
for reactive Vault session management
adapting ClientAuthentication
that also implement
AuthenticationStepsFactory
.AuthenticationStepsFactory
Copyright © 2022 Pivotal Software, Inc.. All rights reserved.