Class ManagedSecretsProcedure

java.lang.Object
overit.geocall.secrets.procedures.ManagedSecretsProcedure
All Implemented Interfaces:
SecretsProcedure

public class ManagedSecretsProcedure extends Object implements SecretsProcedure
Create a new procedure lookup whose fetching logic is managed by a secret manager.
  • Constructor Details

    • ManagedSecretsProcedure

      public ManagedSecretsProcedure(@NotNull @NotNull String key, @NotNull @NotNull overit.geocall.secrets.procedures.WorkingStrategy strategy, long factory, SecretsManagerType type)
      Create a new secrets procedure lookup based on passed secrets manager type
      Parameters:
      key - the configuration key
      strategy - the strategy used to fetch the keys and verification phase
      factory - the factory id
      type - SecretsManagerType about the secrets manager type.
  • Method Details

    • getKey

      public String getKey()
      Description copied from interface: SecretsProcedure
      Returns the configuration key
      Specified by:
      getKey in interface SecretsProcedure
      Returns:
      the configuration key
    • get

      public Secret get() throws SecretsManagerException
      Description copied from interface: SecretsProcedure
      Get the secret fetched
      Specified by:
      get in interface SecretsProcedure
      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

      public <T> T verify(String versionId, @NotNull @NotNull Function<Secret,T> controller)
      Description copied from interface: SecretsProcedure
      Execute the validation process
      Specified by:
      verify in interface SecretsProcedure
      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