Class DefaultSecretManagerClient
java.lang.Object
io.micronaut.gcp.secretmanager.client.DefaultSecretManagerClient
- All Implemented Interfaces:
SecretManagerClient
@Singleton
@Requires(classes=com.google.cloud.secretmanager.v1.SecretManagerServiceClient.class)
public class DefaultSecretManagerClient
extends Object
implements SecretManagerClient
Default implementation of
SecretManagerClient
.- Since:
- 3.4.0
- Author:
- Vinicius Carvalho
-
Field Summary
Fields inherited from interface io.micronaut.gcp.secretmanager.client.SecretManagerClient
LATEST
-
Constructor Summary
ConstructorDescriptionDefaultSecretManagerClient
(com.google.cloud.secretmanager.v1.SecretManagerServiceClient client, GoogleCloudConfiguration googleCloudConfiguration, @Nullable ExecutorService executorService) Deprecated.DefaultSecretManagerClient
(com.google.cloud.secretmanager.v1.SecretManagerServiceClient client, GoogleCloudConfiguration googleCloudConfiguration, @Nullable ExecutorService executorService, SecretManagerConfigurationProperties configurationProperties) -
Method Summary
Modifier and TypeMethodDescriptionreactor.core.publisher.Mono<VersionedSecret>
Fetches a secret from the Secret Manager storage using the `gcp.projectId` project, and "latest" as the version.reactor.core.publisher.Mono<VersionedSecret>
Fetches a secret from the Secret Manager storage using the `gcp.projectId` project.reactor.core.publisher.Mono<VersionedSecret>
Fetches a secret from the Secret Manager storage.
-
Constructor Details
-
DefaultSecretManagerClient
@Inject public DefaultSecretManagerClient(com.google.cloud.secretmanager.v1.SecretManagerServiceClient client, GoogleCloudConfiguration googleCloudConfiguration, @Nullable @Named("blocking") @Nullable ExecutorService executorService, SecretManagerConfigurationProperties configurationProperties) - Parameters:
client
- SecretManagerServiceClientgoogleCloudConfiguration
- Google Cloud ConfigurationexecutorService
- IO ExecutorServiceconfigurationProperties
- Secret Manager Configuration Properties
-
DefaultSecretManagerClient
@Deprecated public DefaultSecretManagerClient(com.google.cloud.secretmanager.v1.SecretManagerServiceClient client, GoogleCloudConfiguration googleCloudConfiguration, @Nullable @Named("io") @Nullable ExecutorService executorService) Deprecated.- Parameters:
client
- SecretManagerServiceClientgoogleCloudConfiguration
- Google Cloud ConfigurationexecutorService
- IO ExecutorService
-
-
Method Details
-
getSecret
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 interfaceSecretManagerClient
- Parameters:
secretId
- - name of the secret- Returns:
- String value of the secret or empty
-
getSecret
Description copied from interface:SecretManagerClient
Fetches a secret from the Secret Manager storage using the `gcp.projectId` project.- Specified by:
getSecret
in interfaceSecretManagerClient
- Parameters:
secretId
- - name of the secretversion
- - version of the secret- Returns:
- String value of the secret or empty
-
getSecret
public reactor.core.publisher.Mono<VersionedSecret> getSecret(String secretId, String version, String projectId) Description copied from interface:SecretManagerClient
Fetches a secret from the Secret Manager storage.- Specified by:
getSecret
in interfaceSecretManagerClient
- Parameters:
secretId
- - name of the secretversion
- - version of the secretprojectId
- - project identifier- Returns:
- String value of the secret or empty
-
DefaultSecretManagerClient(SecretManagerServiceClient, GoogleCloudConfiguration, ExecutorService, SecretManagerConfigurationProperties)
instead.