Class SecretManagerClientImpl
java.lang.Object
google.registry.privileges.secretmanager.SecretManagerClientImpl
- All Implemented Interfaces:
SecretManagerClient
Implements
SecretManagerClient
on Google Cloud Platform.-
Nested Class Summary
Nested classes/interfaces inherited from interface google.registry.privileges.secretmanager.SecretManagerClient
SecretManagerClient.NoSuchSecretResourceException, SecretManagerClient.SecretAlreadyExistsException, SecretManagerClient.SecretManagerException, SecretManagerClient.SecretVersionState
-
Method Summary
Modifier and TypeMethodDescriptionaddSecretVersion
(String secretId, String data) Adds a new version of data to a secret.void
createSecret
(String secretId) Creates a new secret in the Cloud Secret Manager with no data.void
deleteSecret
(String secretId) Deletes a secret from the Secret Manager.void
destroySecretVersion
(String secretId, String version) Destroys a secret version.void
disableSecretVersion
(String secretId, String version) Disables a secret version.void
enableSecretVersion
(String secretId, String version) Enables a secret version.Returns the project name with which this client is associated.getSecretData
(String secretId, Optional<String> version) Returns the data of a secret at the given version.Returns all secret IDs in the Cloud Secret Manager.listSecretVersions
(String secretId) Returns theSecretManagerClient.SecretVersionState
of all secrets withsecretId
.boolean
secretExists
(String secretId) Checks if a secret with the givensecretId
already exists.Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Methods inherited from interface google.registry.privileges.secretmanager.SecretManagerClient
createSecretIfAbsent, listSecretVersions
-
Method Details
-
getProject
Description copied from interface:SecretManagerClient
Returns the project name with which this client is associated.- Specified by:
getProject
in interfaceSecretManagerClient
-
createSecret
Description copied from interface:SecretManagerClient
Creates a new secret in the Cloud Secret Manager with no data.Use addVersion to add data to this secret.
- Specified by:
createSecret
in interfaceSecretManagerClient
- Parameters:
secretId
- The ID of the secret, must be unique in a project
-
secretExists
Description copied from interface:SecretManagerClient
Checks if a secret with the givensecretId
already exists.- Specified by:
secretExists
in interfaceSecretManagerClient
-
listSecrets
Description copied from interface:SecretManagerClient
Returns all secret IDs in the Cloud Secret Manager.- Specified by:
listSecrets
in interfaceSecretManagerClient
-
listSecretVersions
Description copied from interface:SecretManagerClient
Returns theSecretManagerClient.SecretVersionState
of all secrets withsecretId
.- Specified by:
listSecretVersions
in interfaceSecretManagerClient
-
addSecretVersion
Description copied from interface:SecretManagerClient
Adds a new version of data to a secret.- Specified by:
addSecretVersion
in interfaceSecretManagerClient
- Parameters:
secretId
- The ID of the secretdata
- The secret data to be stored in Cloud Secret Manager, encoded in utf-8 charset- Returns:
- The version string of the newly added secret data
-
getSecretData
Description copied from interface:SecretManagerClient
Returns the data of a secret at the given version.- Specified by:
getSecretData
in interfaceSecretManagerClient
- Parameters:
secretId
- The ID of the secretversion
- The version of the secret to fetch. If not provided, thelatest
version will be returned
-
enableSecretVersion
Description copied from interface:SecretManagerClient
Enables a secret version.- Specified by:
enableSecretVersion
in interfaceSecretManagerClient
- Parameters:
secretId
- The ID of the secretversion
- The version of the secret to fetch. If not provided, thelatest
version will be returned
-
disableSecretVersion
Description copied from interface:SecretManagerClient
Disables a secret version.- Specified by:
disableSecretVersion
in interfaceSecretManagerClient
- Parameters:
secretId
- The ID of the secretversion
- The version of the secret to fetch. If not provided, thelatest
version will be returned
-
destroySecretVersion
Description copied from interface:SecretManagerClient
Destroys a secret version.- Specified by:
destroySecretVersion
in interfaceSecretManagerClient
- Parameters:
secretId
- The ID of the secretversion
- The version of the secret to destroy
-
deleteSecret
Description copied from interface:SecretManagerClient
Deletes a secret from the Secret Manager. All versions of this secret will be destroyed.- Specified by:
deleteSecret
in interfaceSecretManagerClient
- Parameters:
secretId
- The ID of the secret to be deleted
-