Class SecretManagerFactory

java.lang.Object
io.micronaut.gcp.secretmanager.SecretManagerFactory

@Factory @Requires(classes=com.google.cloud.secretmanager.v1.SecretManagerServiceClient.class) public class SecretManagerFactory extends Object
Factory to create SecretManager clients.
Since:
3.4.0
Author:
Vinicius Carvalho
  • Constructor Summary

    Constructors
    Constructor
    Description
     
  • Method Summary

    Modifier and Type
    Method
    Description
    com.google.api.gax.core.CredentialsProvider
    credentialsProvider(com.google.auth.oauth2.GoogleCredentials credentials)
    Returns a default CredentialsProvider, allows users to override it and provide their own implementation.
    com.google.cloud.secretmanager.v1.SecretManagerServiceClient
    secretManagerServiceClient(com.google.api.gax.core.CredentialsProvider credentialsProvider, com.google.api.gax.rpc.TransportChannelProvider transportChannelProvider)
    Creates a SecretManagerServiceClient instance.
    com.google.api.gax.rpc.TransportChannelProvider
     

    Methods inherited from class java.lang.Object

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

    • SecretManagerFactory

      public SecretManagerFactory()
  • Method Details

    • secretManagerServiceClient

      @Singleton public com.google.cloud.secretmanager.v1.SecretManagerServiceClient secretManagerServiceClient(@Named("secret-manager") com.google.api.gax.core.CredentialsProvider credentialsProvider, @Named("secret-manager") com.google.api.gax.rpc.TransportChannelProvider transportChannelProvider)
      Creates a SecretManagerServiceClient instance.
      Parameters:
      credentialsProvider - - Google Cloud Credentials Provider
      transportChannelProvider - - TransportChannel Provider
      Returns:
      an instance using defaults.
    • credentialsProvider

      @Singleton @Named("secret-manager") public com.google.api.gax.core.CredentialsProvider credentialsProvider(com.google.auth.oauth2.GoogleCredentials credentials) throws IOException
      Returns a default CredentialsProvider, allows users to override it and provide their own implementation.
      Parameters:
      credentials - default credentials, if not overridden by user should be provided by GoogleCredentialsFactory
      Returns:
      A FixedCredentialsProvider holding the given credentials.
      Throws:
      IOException
    • transportChannelProvider

      @Singleton @Named("secret-manager") public com.google.api.gax.rpc.TransportChannelProvider transportChannelProvider()
      Returns:
      default TransportChannelProviderTransportChannelProvider