Package org.springframework.vault.core
Interface ReactiveVaultOperations
- All Known Implementing Classes:
ReactiveVaultTemplate
public interface ReactiveVaultOperations
Interface that specifies a basic set of Vault operations executed on a reactive
infrastructure, implemented by
ReactiveVaultTemplate
. This is the main entry
point to interact with Vault in an authenticated and unauthenticated context.
ReactiveVaultOperations
allows execution of callback methods. Callbacks can
execute requests within a session context
and the
without a session
.
Paths used in this interface (and interfaces accessible from here) are considered
relative to the VaultEndpoint
. Paths that are fully-qualified URI's can be used
to access Vault cluster members in an authenticated context. To prevent unwanted full
URI access, make sure to sanitize paths before passing them to this interface.
- Since:
- 2.0
- Author:
- Mark Paluch, James Luke, Timothy R. Weiand
- See Also:
-
Method Summary
Modifier and TypeMethodDescriptionDelete a path.<V,
T extends org.reactivestreams.Publisher<V>>
TdoWithSession
(Function<WebClient, ? extends T> sessionCallback) Executes a VaultRestOperationsCallback
.<V,
T extends org.reactivestreams.Publisher<V>>
TdoWithVault
(Function<WebClient, ? extends T> clientCallback) Executes a VaultRestOperationsCallback
.Enumerate keys from a Vault path.opsForKeyValue
(String path, VaultKeyValueOperationsSupport.KeyValueBackend apiVersion) opsForTransit
(String path) ReturnReactiveVaultTransitOperations
if the transit backend is mounted on a different path thantransit
.Read from a Vault path.<T> Mono<VaultResponseSupport<T>>
Read from a Vault path.default Mono<VaultResponse>
Write to a Vault path.Write to a Vault path.
-
Method Details
-
opsForKeyValue
ReactiveVaultKeyValueOperations opsForKeyValue(String path, VaultKeyValueOperationsSupport.KeyValueBackend apiVersion) -
opsForVersionedKeyValue
- Parameters:
path
- the mount path- Returns:
- the operations interface to interact with the versioned Vault Key/Value (version 2) backend.
- Since:
- 3.1
-
opsForTransit
ReactiveVaultTransitOperations opsForTransit()- Returns:
- the operations interface to interact with the Vault transit backend.
- Since:
- 3.1
-
opsForTransit
ReturnReactiveVaultTransitOperations
if the transit backend is mounted on a different path thantransit
.- Parameters:
path
- the mount path- Returns:
- the operations interface to interact with the Vault transit backend.
- Since:
- 3.1
-
opsForSys
ReactiveVaultSysOperations opsForSys()- Returns:
- the operations interface administrative Vault access.
- Since:
- 3.1
-
read
Read from a Vault path. Reading data using this method is suitable for API calls/secret backends that do not require a request body.- Parameters:
path
- must not be null.- Returns:
- the data. May be empty if the path does not exist.
-
read
Read from a Vault path. Reading data using this method is suitable for API calls/secret backends that do not require a request body.- Parameters:
path
- must not be null.responseType
- must not be null.- Returns:
- the data. May be empty if the path does not exist.
-
list
Enumerate keys from a Vault path.- Parameters:
path
- must not be null.- Returns:
- the data. May be empty if the path does not exist.
-
write
Write to a Vault path.- Parameters:
path
- must not be null.- Returns:
- the response. May be empty if the response has no body.
-
write
Write to a Vault path.- Parameters:
path
- must not be null.body
- the body, may be null if absent.- Returns:
- the response. May be empty if the response has no body.
-
delete
Delete a path.- Parameters:
path
- must not be null.
-
doWithVault
<V,T extends org.reactivestreams.Publisher<V>> T doWithVault(Function<WebClient, ? extends T> clientCallback) throws VaultException, WebClientExceptionExecutes a VaultRestOperationsCallback
. Allows to interact with Vault usingRestOperations
without requiring a session.- Parameters:
clientCallback
- the request.- Returns:
- the
RestOperationsCallback
return value. - Throws:
VaultException
- when aHttpStatusCodeException
occurs.WebClientException
- exceptions fromWebClient
.
-
doWithSession
<V,T extends org.reactivestreams.Publisher<V>> T doWithSession(Function<WebClient, ? extends T> sessionCallback) throws VaultException, WebClientExceptionExecutes a VaultRestOperationsCallback
. Allows to interact with Vault in an authenticated session.- Parameters:
sessionCallback
- the request.- Returns:
- the
RestOperationsCallback
return value. - Throws:
VaultException
- when aHttpStatusCodeException
occurs.WebClientException
- exceptions fromWebClient
.
-