Class DefaultSecretManagerClient

  • All Implemented Interfaces:
    SecretManagerClient

    @Singleton
    @Requires(classes=com.google.cloud.secretmanager.v1.SecretManagerServiceClient.class)
    public class DefaultSecretManagerClient
    extends java.lang.Object
    implements SecretManagerClient
    Default implementation of SecretManagerClient.
    Since:
    3.4.0
    Author:
    Vinicius Carvalho
    • Constructor Summary

      Constructors 
      Constructor Description
      DefaultSecretManagerClient​(com.google.cloud.secretmanager.v1.SecretManagerServiceClient client, io.micronaut.context.env.Environment environment, GoogleCloudConfiguration googleCloudConfiguration)  
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      io.reactivex.Maybe<VersionedSecret> getSecret​(java.lang.String secretId)
      Fetches a secret from the Secret Manager storage using the `gcp.projectId` project, and "latest" as the version.
      io.reactivex.Maybe<VersionedSecret> getSecret​(java.lang.String secretId, java.lang.String version)
      Fetches a secret from the Secret Manager storage using the `gcp.projectId` project.
      io.reactivex.Maybe<VersionedSecret> getSecret​(java.lang.String secretId, java.lang.String version, java.lang.String projectId)
      Fetches a secret from the Secret Manager storage.
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Constructor Detail

      • DefaultSecretManagerClient

        public DefaultSecretManagerClient​(com.google.cloud.secretmanager.v1.SecretManagerServiceClient client,
                                          io.micronaut.context.env.Environment environment,
                                          GoogleCloudConfiguration googleCloudConfiguration)
    • Method Detail

      • getSecret

        public io.reactivex.Maybe<VersionedSecret> getSecret​(java.lang.String secretId)
        Description copied from interface: SecretManagerClient
        Fetches a secret from the Secret Manager storage using the `gcp.projectId` project, and "latest" as the version.
        Specified by:
        getSecret in interface SecretManagerClient
        Parameters:
        secretId - - name of the secret
        Returns:
        String value of the secret or empty
      • getSecret

        public io.reactivex.Maybe<VersionedSecret> getSecret​(java.lang.String secretId,
                                                             java.lang.String version)
        Description copied from interface: SecretManagerClient
        Fetches a secret from the Secret Manager storage using the `gcp.projectId` project.
        Specified by:
        getSecret in interface SecretManagerClient
        Parameters:
        secretId - - name of the secret
        version - - version of the secret
        Returns:
        String value of the secret or empty
      • getSecret

        public io.reactivex.Maybe<VersionedSecret> getSecret​(java.lang.String secretId,
                                                             java.lang.String version,
                                                             java.lang.String projectId)
        Description copied from interface: SecretManagerClient
        Fetches a secret from the Secret Manager storage.
        Specified by:
        getSecret in interface SecretManagerClient
        Parameters:
        secretId - - name of the secret
        version - - version of the secret
        projectId - - project identifier
        Returns:
        String value of the secret or empty