Package overit.geocall.secrets
Interface SecretsManagerClient
- All Known Implementing Classes:
AWSSecretsManagerClient,DBSecretsManagerClient
public interface SecretsManagerClient
Secret manager client that defines useful methods required to communicate to a specific remote secret manager.
-
Method Summary
Modifier and TypeMethodDescriptiondefault LastSecretVersionsCacheEntrycreateLastSecretVersionsCacheEntry(Long companyId, String name) Returns aLastSecretVersionsCacheEntryusing the provided parameters.default SecretEntrycreateSecretEntry(Long companyId, String name, String versionId) Returns aSecretEntryusing the provided parameters.default StringgetNormalizedName(Long companyId, @NotNull String name) Returns aStringabout a normalized secret name calculated using the provided parameters.Returns the secrets value identified by the company, the name and the versiongetSecretFullName(Long companyId, @NotNull String name) Returns the complete secret name that will identify a secret on the backend service.getType()String[]getVersionIds(Long companyId, @NotNull String name) Returns aString[] containing the version ids belonging to the current and the previous (if any) secrets
-
Method Details
-
createLastSecretVersionsCacheEntry
default LastSecretVersionsCacheEntry createLastSecretVersionsCacheEntry(Long companyId, String name) Returns aLastSecretVersionsCacheEntryusing the provided parameters.- 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:
- a
LastSecretVersionsCacheEntryusing the provided parameters.
-
createSecretEntry
Returns aSecretEntryusing the provided parameters.- 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-Stringabout the version ID.- Returns:
- a
SecretEntryusing the provided parameters.
-
getSecretFullName
Returns the complete secret name that will identify a secret on the backend service. -
getVersionIds
Returns aString[] containing the version ids belonging to the current and the previous (if any) secrets- 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.- Throws:
SecretsManagerException- in case of error during the secret retrieval or if it can not be found
-
getSecret
Returns the secrets value identified by the company, the name and the version- 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
-
getType
SecretsManagerType getType()- Returns:
- the
SecretsManagerType's type that this instance belongs to
-
getNormalizedName
Returns aStringabout a normalized secret name calculated using the provided parameters.
-