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
-
Method Summary
Modifier and TypeMethodDescriptionstatic WebClient
createWebClient
(ReactiveVaultEndpointProvider endpointProvider, ClientHttpConnector connector) static WebClient
createWebClient
(VaultEndpointProvider endpointProvider, ClientHttpConnector connector) static WebClient
createWebClient
(VaultEndpoint endpoint, ClientHttpConnector connector) static ExchangeFilterFunction
Create aExchangeFilterFunction
that associates each request with aX-Vault-Namespace
header if the header is not present.wrap
(VaultEndpointProvider endpointProvider) Wrap aVaultEndpointProvider
into aReactiveVaultEndpointProvider
to invokeVaultEndpointProvider.getVaultEndpoint()
on a dedicatedscheduler
.
-
Constructor Details
-
ReactiveVaultClients
public ReactiveVaultClients()
-
-
Method Details
-
createWebClient
Create aWebClient
configured withVaultEndpoint
andClientHttpConnector
. 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 aWebClient
configured withVaultEndpoint
andClientHttpConnector
. The client accepts relative URIs without a leading slash that are expanded to useVaultEndpoint
.Requires Jackson 2 for Object-to-JSON mapping.
VaultEndpointProvider
is 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 aWebClient
configured withVaultEndpoint
andClientHttpConnector
. 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 aExchangeFilterFunction
that associates each request with aX-Vault-Namespace
header if the header is not present.- Parameters:
namespace
- the Vault namespace to use. Must not be null or empty.- Returns:
- the
ExchangeFilterFunction
to register withWebClient
. - Since:
- 2.2
- See Also:
-
wrap
Wrap aVaultEndpointProvider
into aReactiveVaultEndpointProvider
to invokeVaultEndpointProvider.getVaultEndpoint()
on a dedicatedscheduler
.- Parameters:
endpointProvider
- must not be null.- Returns:
ReactiveVaultEndpointProvider
wrappingVaultEndpointProvider
.- Since:
- 2.3
-