public interface VaultOperations
VaultTemplate
. This is the main
entry point to interact with Vault in an authenticated and unauthenticated context with configured
VaultClient
instances.
VaultOperations
resolves VaultClient
instances and allows execution of callback methods on various
levels. Callbacks can execute requests within a session
, the
client (without requiring a session)
and a
low-level
RestTemplate
level.
doWithVault(ClientCallback)
,
doWithVault(SessionCallback)
,
#doWithRestTemplate(String, Map, RestTemplateCallback)
,
VaultClient
,
VaultTemplate
,
VaultTokenOperations
,
SessionManager
Modifier and Type | Interface and Description |
---|---|
static interface |
VaultOperations.ClientCallback<T>
A callback for executing arbitrary operations on the
VaultClient . |
static interface |
VaultOperations.SessionCallback<T>
A callback for executing arbitrary operations on the
VaultOperations.VaultSession . |
static interface |
VaultOperations.VaultSession
An authenticated Vault session.
|
VaultSysOperations opsForSys()
VaultTokenOperations opsForToken()
VaultTransitOperations opsForTransit()
VaultTransitOperations opsForTransit(String path)
VaultTransitOperations
if the transit backend is mounted on a different path than transit
.path
- the mount pathVaultResponse read(String path)
path
- must not be null.<T> VaultResponseSupport<T> read(String path, Class<T> responseType)
path
- must not be null.responseType
- must not be null.List<String> list(String path)
path
- must not be null.VaultResponse write(String path, Object body)
path
- must not be null.void delete(String path)
path
- must not be null.<T> T doWithVault(VaultOperations.ClientCallback<T> clientCallback)
VaultOperations.ClientCallback
. Allows to interact with Vault using VaultClient
without requiring
a session.clientCallback
- the request.VaultOperations.ClientCallback
return value.<T> T doWithVault(VaultOperations.SessionCallback<T> sessionCallback)
VaultOperations.SessionCallback
. Allows to interact with Vault in an authenticated session.sessionCallback
- the request.VaultOperations.SessionCallback
return value.<T> T doWithRestTemplate(String pathTemplate, Map<String,?> variables, VaultAccessor.RestTemplateCallback<T> callback)
VaultAccessor.RestTemplateCallback
. Expands the pathTemplate
to an URI
and allows
low-level interaction with the underlying RestTemplate
.pathTemplate
- the path of the resource, e.g. transit/{key}/foo
, must not be empty or null.variables
- the variables for expansion of the pathTemplate
, must not be null.callback
- the request callback.VaultAccessor.RestTemplateCallback
return value.Copyright © 2016 Pivotal Software, Inc.. All rights reserved.