Class DBSecretsManagerClient

java.lang.Object
overit.geocall.secrets.DBSecretsManagerClient
All Implemented Interfaces:
SecretsManagerClient

@Component @Scope(scopeName="prototype", proxyMode=NO) public class DBSecretsManagerClient extends Object implements SecretsManagerClient
SecretsManagerClient implementation to get the secrets from database.
  • Field Details

  • Constructor Details

  • Method Details

    • getVersionIds

      public String[] getVersionIds(Long companyId, String name)
      Description copied from interface: SecretsManagerClient
      Returns a String[] containing the version ids belonging to the current and the previous (if any) secrets
      Specified by:
      getVersionIds in interface SecretsManagerClient
      Parameters:
      companyId - Long about the company ID. Use null value if the secret doesn't belong to any company but is shared across all of them
      name - String about the secret name.
      Returns:
      String[] containing the current secrets version id in the first position, and the previous secrets version id in the second position. If there's no previous secrets, the array will contain only the current version id.
    • getSecret

      public Secret getSecret(Long companyId, @NotNull @NotNull String name, @NotNull @NotNull String versionId) throws SecretsManagerException
      Description copied from interface: SecretsManagerClient
      Returns the secrets value identified by the company, the name and the version
      Specified by:
      getSecret in interface SecretsManagerClient
      Parameters:
      companyId - Long about the company ID. Use null value if the secret doesn't belong to any company but is shared across all of them
      name - String about the secret name.
      versionId - the version identifier
      Returns:
      the secret's value
      Throws:
      SecretsManagerException - in case of error during the secret retrieval or if it can not be found
    • getSecretFullName

      public String getSecretFullName(Long companyId, String name)
      Description copied from interface: SecretsManagerClient
      Returns the complete secret name that will identify a secret on the backend service.
      Specified by:
      getSecretFullName in interface SecretsManagerClient
      Parameters:
      companyId - Long about the company ID. Use null value if the secret doesn't belong to any company but is shared across all of them
      name - String about the secret name.
      Returns:
      the complete secret name that will identify a secret on the backend service.
    • getType

      public SecretsManagerType getType()
      Specified by:
      getType in interface SecretsManagerClient
      Returns:
      the SecretsManagerType's type that this instance belongs to