Package io.micronaut.gcp.secretmanager
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
-
Method Summary
Modifier and TypeMethodDescriptioncom.google.api.gax.core.CredentialsProvider
credentialsProvider
(com.google.auth.oauth2.GoogleCredentials credentials) Returns a defaultCredentialsProvider
, 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 aSecretManagerServiceClient
instance.com.google.api.gax.rpc.TransportChannelProvider
-
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 aSecretManagerServiceClient
instance.- Parameters:
credentialsProvider
- - Google Cloud Credentials ProvidertransportChannelProvider
- - 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 defaultCredentialsProvider
, allows users to override it and provide their own implementation.- Parameters:
credentials
- default credentials, if not overridden by user should be provided byGoogleCredentialsFactory
- Returns:
- A
FixedCredentialsProvider
holding the given credentials. - Throws:
IOException
-
transportChannelProvider
@Singleton @Named("secret-manager") public com.google.api.gax.rpc.TransportChannelProvider transportChannelProvider()- Returns:
- default
TransportChannelProvider
TransportChannelProvider
-