public class ReactiveVaultTemplate extends Object implements ReactiveVaultOperations
ReactiveVaultTemplate
will log
into Vault on initialization and use the token throughout the whole lifetime.SessionManager
Constructor and Description |
---|
ReactiveVaultTemplate(VaultEndpoint vaultEndpoint,
org.springframework.http.client.reactive.ClientHttpConnector connector,
VaultTokenSupplier vaultTokenSupplier)
Create a new
ReactiveVaultTemplate with a VaultEndpoint ,
ClientHttpConnector and VaultTokenSupplier . |
ReactiveVaultTemplate(VaultEndpointProvider endpointProvider,
org.springframework.http.client.reactive.ClientHttpConnector connector,
VaultTokenSupplier vaultTokenSupplier)
Create a new
ReactiveVaultTemplate with a VaultEndpointProvider ,
ClientHttpConnector and VaultTokenSupplier . |
Modifier and Type | Method and Description |
---|---|
reactor.core.publisher.Mono<Void> |
delete(String path)
Delete a path in the secret backend.
|
<V,T extends org.reactivestreams.Publisher<V>> |
doWithSession(Function<org.springframework.web.reactive.function.client.WebClient,? super T> sessionCallback)
Executes a Vault
RestOperationsCallback . |
<V,T extends org.reactivestreams.Publisher<V>> |
doWithVault(Function<org.springframework.web.reactive.function.client.WebClient,? super T> clientCallback)
Executes a Vault
RestOperationsCallback . |
reactor.core.publisher.Flux<String> |
list(String path)
Enumerate keys from a secret backend.
|
reactor.core.publisher.Mono<VaultResponse> |
read(String path)
Read from a secret backend.
|
<T> reactor.core.publisher.Mono<VaultResponseSupport<T>> |
read(String path,
Class<T> responseType)
Read from a secret backend.
|
reactor.core.publisher.Mono<Void> |
write(String path,
Object body)
Write to a secret backend.
|
public ReactiveVaultTemplate(VaultEndpoint vaultEndpoint, org.springframework.http.client.reactive.ClientHttpConnector connector, VaultTokenSupplier vaultTokenSupplier)
ReactiveVaultTemplate
with a VaultEndpoint
,
ClientHttpConnector
and VaultTokenSupplier
.vaultEndpoint
- must not be null.connector
- must not be null.vaultTokenSupplier
- must not be null.public ReactiveVaultTemplate(VaultEndpointProvider endpointProvider, org.springframework.http.client.reactive.ClientHttpConnector connector, VaultTokenSupplier vaultTokenSupplier)
ReactiveVaultTemplate
with a VaultEndpointProvider
,
ClientHttpConnector
and VaultTokenSupplier
.endpointProvider
- must not be null.connector
- must not be null.vaultTokenSupplier
- must not be null.public reactor.core.publisher.Mono<VaultResponse> read(String path)
ReactiveVaultOperations
read
in interface ReactiveVaultOperations
path
- must not be null.public <T> reactor.core.publisher.Mono<VaultResponseSupport<T>> read(String path, Class<T> responseType)
ReactiveVaultOperations
read
in interface ReactiveVaultOperations
path
- must not be null.responseType
- must not be null.public reactor.core.publisher.Flux<String> list(String path)
ReactiveVaultOperations
list
in interface ReactiveVaultOperations
path
- must not be null.public reactor.core.publisher.Mono<Void> write(String path, Object body)
ReactiveVaultOperations
write
in interface ReactiveVaultOperations
path
- must not be null.body
- the body, may be null if absent.public reactor.core.publisher.Mono<Void> delete(String path)
ReactiveVaultOperations
delete
in interface ReactiveVaultOperations
path
- must not be null.public <V,T extends org.reactivestreams.Publisher<V>> T doWithVault(Function<org.springframework.web.reactive.function.client.WebClient,? super T> clientCallback) throws VaultException, org.springframework.web.reactive.function.client.WebClientException
ReactiveVaultOperations
RestOperationsCallback
. Allows to interact with Vault
using RestOperations
without requiring a
session.doWithVault
in interface ReactiveVaultOperations
clientCallback
- the request.RestOperationsCallback
return value.VaultException
- when a
HttpStatusCodeException
occurs.org.springframework.web.reactive.function.client.WebClientException
- exceptions from
WebClient
.public <V,T extends org.reactivestreams.Publisher<V>> T doWithSession(Function<org.springframework.web.reactive.function.client.WebClient,? super T> sessionCallback) throws VaultException, org.springframework.web.reactive.function.client.WebClientException
ReactiveVaultOperations
RestOperationsCallback
. Allows to interact with Vault in
an authenticated session.doWithSession
in interface ReactiveVaultOperations
sessionCallback
- the request.RestOperationsCallback
return value.VaultException
- when a
HttpStatusCodeException
occurs.org.springframework.web.reactive.function.client.WebClientException
- exceptions from
WebClient
.Copyright © 2016–2017 Pivotal Software, Inc.. All rights reserved.