Package org.springframework.vault.client
Class ReactiveVaultClients
java.lang.Object
org.springframework.vault.client.ReactiveVaultClients
Vault Client factory to create
WebClient configured to the needs of accessing
Vault.- Since:
- 2.0
- Author:
- Mark Paluch
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic WebClientcreateWebClient(ReactiveVaultEndpointProvider endpointProvider, ClientHttpConnector connector) static WebClientcreateWebClient(VaultEndpointProvider endpointProvider, ClientHttpConnector connector) static WebClientcreateWebClient(VaultEndpoint endpoint, ClientHttpConnector connector) static ExchangeFilterFunctionCreate aExchangeFilterFunctionthat associates each request with aX-Vault-Namespaceheader if the header is not present.wrap(VaultEndpointProvider endpointProvider) Wrap aVaultEndpointProviderinto aReactiveVaultEndpointProviderto invokeVaultEndpointProvider.getVaultEndpoint()on a dedicatedscheduler.
-
Constructor Details
-
ReactiveVaultClients
public ReactiveVaultClients()
-
-
Method Details
-
createWebClient
Create aWebClientconfigured withVaultEndpointandClientHttpConnector. The client accepts relative URIs without a leading slash that are expanded to useVaultEndpoint.Requires Jackson 2 for Object-to-JSON mapping.
- Parameters:
endpoint- must not be null.connector- must not be null.- Returns:
- the configured
WebClient.
-
createWebClient
public static WebClient createWebClient(VaultEndpointProvider endpointProvider, ClientHttpConnector connector) Create aWebClientconfigured withVaultEndpointandClientHttpConnector. The client accepts relative URIs without a leading slash that are expanded to useVaultEndpoint.Requires Jackson 2 for Object-to-JSON mapping.
VaultEndpointProvideris called onSchedulers.boundedElastic()to ensure that I/O threads are never blocked.- Parameters:
endpointProvider- must not be null.connector- must not be null.- Returns:
- the configured
WebClient.
-
createWebClient
public static WebClient createWebClient(ReactiveVaultEndpointProvider endpointProvider, ClientHttpConnector connector) Create aWebClientconfigured withVaultEndpointandClientHttpConnector. The client accepts relative URIs without a leading slash that are expanded to useVaultEndpoint.Requires Jackson 2 for Object-to-JSON mapping.
- Parameters:
endpointProvider- must not be null.connector- must not be null.- Returns:
- the configured
WebClient. - Since:
- 2.3
-
namespace
Create aExchangeFilterFunctionthat associates each request with aX-Vault-Namespaceheader if the header is not present.- Parameters:
namespace- the Vault namespace to use. Must not be null or empty.- Returns:
- the
ExchangeFilterFunctionto register withWebClient. - Since:
- 2.2
- See Also:
-
wrap
Wrap aVaultEndpointProviderinto aReactiveVaultEndpointProviderto invokeVaultEndpointProvider.getVaultEndpoint()on a dedicatedscheduler.- Parameters:
endpointProvider- must not be null.- Returns:
ReactiveVaultEndpointProviderwrappingVaultEndpointProvider.- Since:
- 2.3
-