Class DummySecretsProcedure

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

public class DummySecretsProcedure extends Object implements SecretsProcedure
Secrets procedure that do not fetch the secrets from anywhere, but it simply returns the Secret instance based on the values passed in the constructor.

This should be considered a fallback implementation if the format of the procedure is not compliant with the specified one

  • Constructor Details

    • DummySecretsProcedure

      public DummySecretsProcedure(String key, String value)
      Create a new secrets procedure lookup using the provided parameters.
      Parameters:
      key - the configuration key
      value - the configuration value
  • 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()
      Description copied from interface: SecretsProcedure
      Get the secret fetched
      Specified by:
      get in interface SecretsProcedure
      Returns:
      the instance of the fetched secret
    • 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