Interface SecretsBiz

All Known Implementing Classes:
AwsSecretsBiz, SimpleSecretsBiz

public interface SecretsBiz
API for secret management.

The intention of this API is that implementations store the secret values in a secure, encrypted manner.

  • Field Details

  • Method Details

    • getSecret

      String getSecret(String secretName)
      Get a secret value.
      Parameters:
      secretName - the unique name of the secret to get
      Returns:
      the secret value, or null if one does not exist
    • putSecret

      void putSecret(String secretName, String secretValue)
      Put a secret value.

      This will replace any existing value of a secret with the same name.

      Parameters:
      secretName - the unique name of the secret to put
      secretValue - the value to store
    • deleteSecret

      void deleteSecret(String secretName)
      Delete a secret.
      Parameters:
      secretName - the name of the secret to delete
    • getSecretMap

      default Map<String,Object> getSecretMap(String secretName)
      Get a secret value that is a JSON object string.

      This method will interpret the associated secret value as a JSON object string, and return that as a Map. If the secret value exists but cannot be decoded as a JSON object, null will be returned.

      Parameters:
      secretName - the unique name of the secret to put
      Returns:
      the secret value, decoded from a JSON object
    • putSecret

      default void putSecret(String secretName, Map<String,?> secretValue)
      Put a Map as a JSON object string secret value.
      Parameters:
      secretName - the unique name of the secret to put
      secretValue - the Map to encode as a JSON object value