Polishing.
Adjust generics and wording in reactive Template API.
This commit is contained in:
@@ -30,7 +30,7 @@ import org.springframework.vault.support.VaultToken;
|
||||
*
|
||||
* @author Mark Paluch
|
||||
* @see CachingVaultTokenSupplier
|
||||
* @see VaultTokenSupplier
|
||||
* @see ReactiveLifecycleAwareSessionManager
|
||||
* @since 2.0
|
||||
*/
|
||||
public interface ReactiveSessionManager extends VaultTokenSupplier {
|
||||
|
||||
@@ -114,7 +114,7 @@ public interface ReactiveVaultOperations {
|
||||
* {@link org.springframework.web.reactive.function.client.WebClient}.
|
||||
*/
|
||||
<V, T extends Publisher<V>> T doWithVault(
|
||||
Function<WebClient, ? super T> clientCallback) throws VaultException,
|
||||
Function<WebClient, ? extends T> clientCallback) throws VaultException,
|
||||
WebClientException;
|
||||
|
||||
/**
|
||||
@@ -129,6 +129,6 @@ public interface ReactiveVaultOperations {
|
||||
* {@link org.springframework.web.reactive.function.client.WebClient}.
|
||||
*/
|
||||
<V, T extends Publisher<V>> T doWithSession(
|
||||
Function<WebClient, ? super T> sessionCallback) throws VaultException,
|
||||
Function<WebClient, ? extends T> sessionCallback) throws VaultException,
|
||||
WebClientException;
|
||||
}
|
||||
|
||||
@@ -170,7 +170,7 @@ public class ReactiveVaultTemplate implements ReactiveVaultOperations {
|
||||
@Override
|
||||
@SuppressWarnings("unchecked")
|
||||
public <V, T extends Publisher<V>> T doWithVault(
|
||||
Function<WebClient, ? super T> clientCallback) throws VaultException,
|
||||
Function<WebClient, ? extends T> clientCallback) throws VaultException,
|
||||
WebClientException {
|
||||
|
||||
Assert.notNull(clientCallback, "Client callback must not be null");
|
||||
@@ -186,7 +186,7 @@ public class ReactiveVaultTemplate implements ReactiveVaultOperations {
|
||||
@Override
|
||||
@SuppressWarnings("unchecked")
|
||||
public <V, T extends Publisher<V>> T doWithSession(
|
||||
Function<WebClient, ? super T> sessionCallback) throws VaultException,
|
||||
Function<WebClient, ? extends T> sessionCallback) throws VaultException,
|
||||
WebClientException {
|
||||
|
||||
Assert.notNull(sessionCallback, "Session callback must not be null");
|
||||
|
||||
@@ -5,7 +5,7 @@
|
||||
=== What's new in Spring Vault 2.0
|
||||
|
||||
* Authentication steps DSL to <<vault.authentication.steps,compose authentication flows>>.
|
||||
* Reactive Vault client via `ReactiveVaultOperations`.
|
||||
* <<vault.core.reactive.template,Reactive Vault client>> via `ReactiveVaultOperations`.
|
||||
* <<vault.repositories,Vault repository support>> based on Spring Data KeyValue.
|
||||
* Transit batch encrypt and decrypt support.
|
||||
* Policy management for policies stored as JSON.
|
||||
|
||||
@@ -18,9 +18,10 @@ too slow the data repository can also slow down or stop completely until network
|
||||
|
||||
Spring Vault's reactive client support is built on top of <<vault.authentication.steps,composable authentication steps>> and Spring's functional `WebClient` via Reactor Netty, which features a fully non-blocking, event-driven HTTP client.
|
||||
|
||||
It exposes `VaultTokenSupplier` as supplier of `VaultToken` to authenticate HTTP requests and `ReactiveVaultOperations`
|
||||
as the primary entry point. The core configuration of `VaultEndpoint`, `ClientOptions` and
|
||||
<<vault.client-ssl,SSL>> are reused across the various client implementation.
|
||||
It exposes `VaultTokenSupplier` as supplier of `VaultToken` to authenticate HTTP requests
|
||||
and `ReactiveVaultOperations` as the primary entry point. The core configuration of
|
||||
`VaultEndpoint`, `ClientOptions` and <<vault.client-ssl,SSL>> are reused across the
|
||||
various client implementation.
|
||||
|
||||
The class `ReactiveVaultTemplate`, located in the package `org.springframework.vault.core`,
|
||||
is the central class of the Spring's reactive Vault support providing a rich feature set to
|
||||
@@ -112,8 +113,8 @@ The reactive client requires a non-blocking token supplier whose contract is def
|
||||
in `VaultTokenSupplier`. Tokens can be static or obtained through a
|
||||
<<vault.authentication.steps,declared authentication flow>>.
|
||||
Vault login should not occur on each authenticated Vault interaction but
|
||||
must be reused throughout a session. This aspect is handled by a
|
||||
session manager implementing `VaultTokenSupplier`.
|
||||
the session token should be kept across a session. This aspect is handled by a
|
||||
session manager implementing `ReactiveSessionManager`, such as `ReactiveLifecycleAwareSessionManager`.
|
||||
|
||||
[[vault.core.reactive.executioncallback]]
|
||||
== Execution callbacks
|
||||
@@ -128,10 +129,10 @@ to perform uncommon operations that we've not exposed as methods on `ReactiveVau
|
||||
|
||||
Here is a list of execute callback methods.
|
||||
|
||||
* `<T> T` *doWithVault* `(Function<WebClient, ? super T> clientCallback)` Composes a reactive
|
||||
* `<T> T` *doWithVault* `(Function<WebClient, ? extends T> clientCallback)` Composes a reactive
|
||||
sequence the given `WebClient`, allows to interact with Vault without a session context.
|
||||
|
||||
* `<T> T` *doWithSession* `(Function<WebClient, ? super T> clientCallback)` Composes a reactive
|
||||
* `<T> T` *doWithSession* `(Function<WebClient, ? extends T> clientCallback)` Composes a reactive
|
||||
sequence the given `WebClient`, allows to interact with Vault in an authenticated session.
|
||||
|
||||
Here is an example that uses the callback to initialize Vault:
|
||||
|
||||
Reference in New Issue
Block a user