Class AWSSecretsManagerClient

java.lang.Object
overit.geocall.aws.secretsmanager.AWSSecretsManagerClient
All Implemented Interfaces:
SecretsManagerClient

public class AWSSecretsManagerClient extends Object implements SecretsManagerClient
SecretsManagerClient implementation to get secrets from AWS.
  • Constructor Details

    • AWSSecretsManagerClient

      public AWSSecretsManagerClient()
  • Method Details

    • getSecretFullName

      public String getSecretFullName(Long companyId, @NotNull @NotNull 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.
    • 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, String name, String versionId)
      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
    • getType

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