Class GoogleCloudSecretManagerService
- java.lang.Object
-
- com.broadleafcommerce.securevault.service.provider.GoogleCloudSecretManagerService
-
- All Implemented Interfaces:
SecureVaultService
public class GoogleCloudSecretManagerService extends Object implements SecureVaultService
Implementation of theSecureVaultService
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 Constructor Description GoogleCloudSecretManagerService(String projectId)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected String
convertNameToKey(String propertyName)
Because periods ('.') are not allowed in a secret's id, we need to replace them with underscores.protected String
getProjectId()
String
getSecretForKey(String key)
protected String
getSecretFromClientForKey(com.google.cloud.secretmanager.v1.SecretManagerServiceClient client, String key)
Map<String,Object>
getSecretsForKeys(List<String> keys)
-
-
-
Constructor Detail
-
GoogleCloudSecretManagerService
public GoogleCloudSecretManagerService(String projectId)
-
-
Method Detail
-
getSecretsForKeys
public Map<String,Object> getSecretsForKeys(List<String> keys) throws IOException
- Specified by:
getSecretsForKeys
in interfaceSecureVaultService
- Throws:
IOException
-
getSecretForKey
public String getSecretForKey(String key) throws IOException
- Specified by:
getSecretForKey
in interfaceSecureVaultService
- Throws:
IOException
-
getSecretFromClientForKey
protected String getSecretFromClientForKey(com.google.cloud.secretmanager.v1.SecretManagerServiceClient client, String key)
-
convertNameToKey
protected String convertNameToKey(String propertyName)
Because periods ('.') are not allowed in a secret's id, we need to replace them with underscores.
-
getProjectId
protected String getProjectId()
-
-