Class GoogleCloudSecretManagerService
java.lang.Object
com.broadleafcommerce.securevault.service.provider.GoogleCloudSecretManagerService
- All Implemented Interfaces:
SecureVaultService
Implementation of the
SecureVaultService for the Google Cloud Secret Manager.
In order to connect to the Secret Manager, make sure you have an account on GCP with at least the
`roles/secretmanager.secretAccessor` role. You will need to be locally authenticated by running:
gcloud auth application-default login
Follow the prompts to authenticate with you're authorized GCP account.
Additional information can be found in GCP's documentation:
https://cloud.google.com/secret-manager/docs/creating-and-accessing-secrets-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprotected StringconvertNameToKey(String propertyName) Because periods ('.') are not allowed in a secret's id, we need to replace them with underscores.protected StringgetSecretForKey(String key) protected StringgetSecretFromClientForKey(com.google.cloud.secretmanager.v1.SecretManagerServiceClient client, String key) getSecretsForKeys(List<String> keys)
-
Constructor Details
-
GoogleCloudSecretManagerService
-
-
Method Details
-
getSecretsForKeys
- Specified by:
getSecretsForKeysin interfaceSecureVaultService- Throws:
IOException
-
getSecretForKey
- Specified by:
getSecretForKeyin interfaceSecureVaultService- Throws:
IOException
-
getSecretFromClientForKey
-
convertNameToKey
Because periods ('.') are not allowed in a secret's id, we need to replace them with underscores. -
getProjectId
-