Interface SecretsProcedure

All Known Implementing Classes:
DummySecretsProcedure, ManagedSecretsProcedure

public interface SecretsProcedure
Interface that is used to extract the Secret given a procedure related to a configuration property. The procedure's format must be compliant to the following format:

 [name:strategy]
 
where the name identify any configured lookups and the strategy define the way the SecretsManager is used in the validation process. Possible name values are:
  • awsSecret: the secrets will be fetched from AWS Secrets Manager
  • dbSecret: the secrets will be fetched from DB Secrets Manager
Possible strategy values are:
  • latest: the validation process uses the current secret first; If it fails, it tries with the previous one. For the fetching phases, it extract always the current secret
  • versioned: the fetch and validation process uses a specific secret version id
  • Method Summary

    Modifier and Type
    Method
    Description
    get()
    Get the secret fetched
    Returns the configuration key
    <T> T
    verify(String versionId, @NotNull Function<Secret,T> controller)
    Execute the validation process
  • Method Details

    • getKey

      String getKey()
      Returns the configuration key
      Returns:
      the configuration key
    • get

      Get the secret fetched
      Returns:
      the instance of the fetched secret
      Throws:
      SecretsManagerException - in case of errors while communicating with the secret manager or in case the requested secret has not been found.
    • verify

      <T> T verify(String versionId, @NotNull @NotNull Function<Secret,T> controller)
      Execute the validation process
      Type Parameters:
      T - the result type
      Parameters:
      versionId - the version id. It's mandatory if the strategy is VERSIONED, otherwise it can be null.
      controller - the validation function
      Returns:
      the output produced by the validation function