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)
,
VaultOperations#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.
|
Modifier and Type | Method and Description |
---|---|
void |
delete(String path)
Delete a path in the secret backend.
|
<T> T |
doWithRestTemplate(String pathTemplate,
Map<String,?> variables,
VaultAccessor.RestTemplateCallback<T> callback)
Executes
VaultAccessor.RestTemplateCallback . |
<T> T |
doWithVault(VaultOperations.ClientCallback<T> clientCallback)
Executes a Vault
VaultOperations.ClientCallback . |
<T> T |
doWithVault(VaultOperations.SessionCallback<T> sessionCallback)
Executes a Vault
VaultOperations.SessionCallback . |
List<String> |
list(String path)
Enumerate keys from a secret backend.
|
VaultPkiOperations |
opsForPki() |
VaultPkiOperations |
opsForPki(String path)
Returns
VaultPkiOperations if the PKI backend is mounted on a different
path than pki . |
VaultSysOperations |
opsForSys() |
VaultTokenOperations |
opsForToken() |
VaultTransitOperations |
opsForTransit() |
VaultTransitOperations |
opsForTransit(String path)
Returns
VaultTransitOperations if the transit backend is mounted on a
different path than transit . |
VaultResponse |
read(String path)
Read from a secret backend.
|
<T> VaultResponseSupport<T> |
read(String path,
Class<T> responseType)
Read from a secret backend.
|
VaultResponse |
write(String path,
Object body)
Write to a secret backend.
|
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 pathVaultPkiOperations opsForPki()
VaultPkiOperations opsForPki(String path)
VaultPkiOperations
if the PKI backend is mounted on a different
path than pki
.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.body
- the body, may be null if absent.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–2017 Pivotal Software, Inc.. All rights reserved.