Interface VaultWrappingOperations

All Known Implementing Classes:
VaultWrappingTemplate

public interface VaultWrappingOperations
Interface that specifies wrapping-related operations.
Since:
2.1
Author:
Mark Paluch
  • Method Details

    • lookup

      Looks up metadata for the given token containing a wrapped response.
      Parameters:
      token - must not be null.
      Returns:
      the WrappedMetadata the token or null if the token was invalid or expired.
    • read

      Read a wrapped secret.
      Parameters:
      token - must not be null.
      Returns:
      the data or null if the token was invalid or expired.
    • read

      @Nullable <T> VaultResponseSupport<T> read(VaultToken token, Class<T> responseType)
      Read a wrapped secret of type responseType.
      Parameters:
      token - must not be null.
      responseType - must not be null.
      Returns:
      the data or null if the token was invalid or expired.
    • rewrap

      WrappedMetadata rewrap(VaultToken token)
      Rewraps 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 throws VaultException.
      Parameters:
      token - must not be null.
      Returns:
      the WrappedMetadata for this wrapping operation.
    • wrap

      WrappedMetadata wrap(Object body, Duration ttl)
      Wraps the given user-supplied data inside a response-wrapped token.
      Parameters:
      body - must not be null.
      ttl - must not be null.
      Returns:
      the WrappedMetadata for this wrapping operation.