Package org.springframework.vault.core
Class VaultWrappingTemplate
java.lang.Object
org.springframework.vault.core.VaultWrappingTemplate
- All Implemented Interfaces:
VaultWrappingOperations
- Author:
- Mark Paluch
-
Constructor Summary
ConstructorsConstructorDescriptionVaultWrappingTemplate(VaultOperations vaultOperations) Create a newVaultWrappingTemplategivenVaultOperations. -
Method Summary
Modifier and TypeMethodDescriptionlookup(VaultToken token) Looks upmetadatafor the given token containing a wrapped response.read(VaultToken token) Read a wrapped secret.<T> VaultResponseSupport<T>read(VaultToken token, Class<T> responseType) Read a wrapped secret of typeresponseType.rewrap(VaultToken token) Rewraps a response-wrapped token.Wraps the given user-supplied data inside a response-wrapped token.
-
Constructor Details
-
VaultWrappingTemplate
Create a newVaultWrappingTemplategivenVaultOperations.- Parameters:
vaultOperations- must not be null.
-
-
Method Details
-
lookup
Description copied from interface:VaultWrappingOperationsLooks upmetadatafor the given token containing a wrapped response.- Specified by:
lookupin interfaceVaultWrappingOperations- Parameters:
token- must not be null.- Returns:
- the
WrappedMetadatathetokenor null if the token was invalid or expired.
-
read
Description copied from interface:VaultWrappingOperationsRead a wrapped secret.- Specified by:
readin interfaceVaultWrappingOperations- Parameters:
token- must not be null.- Returns:
- the data or null if the token was invalid or expired.
-
read
Description copied from interface:VaultWrappingOperationsRead a wrapped secret of typeresponseType.- Specified by:
readin interfaceVaultWrappingOperations- Parameters:
token- must not be null.responseType- must not be null.- Returns:
- the data or null if the token was invalid or expired.
-
rewrap
Description copied from interface:VaultWrappingOperationsRewraps a response-wrapped token. The new token will use the same creation TTL as the original token and contain the same response. The old token will be invalidated. This can be used for long-term storage of a secret in a response-wrapped token when rotation is a requirement. Rewrapping with an invalid token throwsVaultException.- Specified by:
rewrapin interfaceVaultWrappingOperations- Parameters:
token- must not be null.- Returns:
- the
WrappedMetadatafor this wrapping operation.
-
wrap
Description copied from interface:VaultWrappingOperationsWraps the given user-supplied data inside a response-wrapped token.- Specified by:
wrapin interfaceVaultWrappingOperations- Parameters:
body- must not be null.duration- must not be null.- Returns:
- the
WrappedMetadatafor this wrapping operation.
-