Class AwsSecretsBiz

java.lang.Object
net.solarnetwork.central.cloud.aws.biz.AwsSecretsBiz
All Implemented Interfaces:
SecretsBiz

public class AwsSecretsBiz extends Object implements SecretsBiz
Implementation of SecretsBiz using AWS Secrets Manager.
  • Constructor Details

    • AwsSecretsBiz

      public AwsSecretsBiz(String region, String accessKey, String accessKeySecret)
      Constructor.
      Parameters:
      region - the AWS region name
      accessKey - the access key
      accessKeySecret - the access key secret
    • AwsSecretsBiz

      public AwsSecretsBiz(software.amazon.awssdk.regions.Region region, software.amazon.awssdk.auth.credentials.AwsCredentialsProvider credentialsProvider)
      Constructor.
      Parameters:
      region - the AWS region
      credentialsProvider - the credentials provider
  • Method Details

    • putSecret

      public void putSecret(String secretName, String secretValue)
      Description copied from interface: SecretsBiz
      Put a secret value.

      This will replace any existing value of a secret with the same name.

      Specified by:
      putSecret in interface SecretsBiz
      Parameters:
      secretName - the unique name of the secret to put
      secretValue - the value to store
    • getSecret

      public String getSecret(String secretName)
      Description copied from interface: SecretsBiz
      Get a secret value.
      Specified by:
      getSecret in interface SecretsBiz
      Parameters:
      secretName - the unique name of the secret to get
      Returns:
      the secret value, or null if one does not exist
    • deleteSecret

      public void deleteSecret(String secretName)
      Description copied from interface: SecretsBiz
      Delete a secret.
      Specified by:
      deleteSecret in interface SecretsBiz
      Parameters:
      secretName - the name of the secret to delete
    • setSecretCache

      public void setSecretCache(javax.cache.Cache<String,String> secretCache)
      Configure a cache to use for secrets.
      Parameters:
      secretCache - the cache