Package overit.geocall.secrets
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 Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionReturns the secrets value identified by the company, the name and the versiongetSecretFullName(Long companyId, String name) Returns the complete secret name that will identify a secret on the backend service.getType()String[]getVersionIds(Long companyId, String name) Returns aString[] containing the version ids belonging to the current and the previous (if any) secretsMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface overit.geocall.secrets.SecretsManagerClient
createLastSecretVersionsCacheEntry, createSecretEntry, getNormalizedName
-
Field Details
-
CURRENT_SUFFIX
- See Also:
-
ERROR_IN_SECRET_GENERATION
- See Also:
-
-
Constructor Details
-
DBSecretsManagerClient
-
-
Method Details
-
getVersionIds
Description copied from interface:SecretsManagerClientReturns aString[] containing the version ids belonging to the current and the previous (if any) secrets- Specified by:
getVersionIdsin interfaceSecretsManagerClient- Parameters:
companyId-Longabout the company ID. Usenullvalue if the secret doesn't belong to any company but is shared across all of themname-Stringabout 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:SecretsManagerClientReturns the secrets value identified by the company, the name and the version- Specified by:
getSecretin interfaceSecretsManagerClient- Parameters:
companyId-Longabout the company ID. Usenullvalue if the secret doesn't belong to any company but is shared across all of themname-Stringabout 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
Description copied from interface:SecretsManagerClientReturns the complete secret name that will identify a secret on the backend service.- Specified by:
getSecretFullNamein interfaceSecretsManagerClient- Parameters:
companyId-Longabout the company ID. Usenullvalue if the secret doesn't belong to any company but is shared across all of themname-Stringabout the secret name.- Returns:
- the complete secret name that will identify a secret on the backend service.
-
getType
- Specified by:
getTypein interfaceSecretsManagerClient- Returns:
- the
SecretsManagerType's type that this instance belongs to
-