public interface VaultOperations
VaultTemplate
. This is the main entry point to
interact with Vault in an authenticated and unauthenticated context.
VaultOperations
allows execution of callback methods. Callbacks can execute
requests within a session context
and
the without a session
.
doWithSession(RestOperationsCallback)
,
doWithVault(RestOperationsCallback)
,
RestOperations
,
VaultTemplate
,
VaultTokenOperations
,
SessionManager
VaultKeyValueOperations opsForKeyValue(String path, VaultKeyValueOperationsSupport.KeyValueBackend apiVersion)
VaultKeyValueOperations
.path
- the mount path, must not be empty or null.apiVersion
- API version to use, must not be null.VaultVersionedKeyValueOperations opsForVersionedKeyValue(String path)
VaultVersionedKeyValueOperations
.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 pathVaultSysOperations opsForSys()
VaultTokenOperations opsForToken()
VaultTransformOperations opsForTransform()
VaultTransformOperations opsForTransform(String path)
VaultTransformOperations
if the transit backend is mounted on a
different path than transform
.path
- the mount pathVaultTransitOperations opsForTransit()
VaultTransitOperations opsForTransit(String path)
VaultTransitOperations
if the transit backend is mounted on a
different path than transit
.path
- the mount pathVaultWrappingOperations opsForWrapping()
@Nullable VaultResponse read(String path)
path
- must not be null.@Nullable <T> VaultResponseSupport<T> read(String path, Class<T> responseType)
path
- must not be null.responseType
- must not be null.@Nullable List<String> list(String path)
path
- must not be null.@Nullable default VaultResponse write(String path)
path
- must not be null.@Nullable VaultResponse write(String path, @Nullable Object body)
path
- must not be null.body
- the body, may be null if absent.void delete(String path)
path
- must not be null.@Nullable <T> T doWithVault(RestOperationsCallback<T> clientCallback) throws VaultException, org.springframework.web.client.RestClientException
RestOperationsCallback
. Allows to interact with Vault
using RestOperations
without requiring a
session.clientCallback
- the request.RestOperationsCallback
return value.VaultException
- when a
HttpStatusCodeException
occurs.org.springframework.web.client.RestClientException
- exceptions from
RestOperations
.@Nullable <T> T doWithSession(RestOperationsCallback<T> sessionCallback) throws VaultException, org.springframework.web.client.RestClientException
RestOperationsCallback
. Allows to interact with Vault in
an authenticated session.sessionCallback
- the request.RestOperationsCallback
return value.VaultException
- when a
HttpStatusCodeException
occurs.org.springframework.web.client.RestClientException
- exceptions from
RestOperations
.Copyright © 2016–2024 Pivotal Software, Inc.. All rights reserved.