Interface VaultKeyValueOperations

All Superinterfaces:
VaultKeyValueOperationsSupport

public interface VaultKeyValueOperations extends VaultKeyValueOperationsSupport
Interface that specifies a basic set of Vault operations using Vault's Key/Value secret backend. Paths used in this operations interface are relative and outgoing requests prepend paths with the according operation-specific prefix.

This API supports both, versioned and unversioned key-value backends. Versioned usage is limited as updates requiring compare-and-set (CAS) are not possible. Use VaultVersionedKeyValueOperations in such cases instead.

Since:
2.1
Author:
Mark Paluch, Younghwan Jang
See Also:
  • Method Details

    • get

      Read the secret at path.
      Specified by:
      get in interface VaultKeyValueOperationsSupport
      Parameters:
      path - must not be null.
      Returns:
      the data. May be null if the path does not exist.
    • get

      @Nullable <T> VaultResponseSupport<T> get(String path, Class<T> responseType)
      Read the secret at path.
      Parameters:
      path - must not be null.
      responseType - must not be null.
      Returns:
      the data. May be null if the path does not exist.
    • patch

      boolean patch(String path, Map<String,?> patch)
      Update the secret at path without removing the existing secrets. Requires a Key-Value version 2 mount to ensure an atomic update.
      Parameters:
      path - must not be null.
      patch - must not be null.
      Returns:
      true if the patch operation is successful, false otherwise.
      Since:
      2.3
    • put

      void put(String path, Object body)
      Write the secret at path.
      Parameters:
      path - must not be null.
      body - must not be null.