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 Details

    • SecretManagerFactory

      @Inject public SecretManagerFactory(SecretManagerConfigurationProperties configurationProperties)
      Parameters:
      configurationProperties - SecretManager Configuration Properties
    • SecretManagerFactory

      @Deprecated public SecretManagerFactory()
      Deprecated.
  • 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