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 java.lang.Object implements SecretManagerClient
Default implementation ofSecretManagerClient
.- Since:
- 3.4.0
- Author:
- Vinicius Carvalho
-
-
Field Summary
-
Fields inherited from interface io.micronaut.gcp.secretmanager.client.SecretManagerClient
LATEST
-
-
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.
-
-
-
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 interfaceSecretManagerClient
- 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 interfaceSecretManagerClient
- Parameters:
secretId
- - name of the secretversion
- - 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 interfaceSecretManagerClient
- Parameters:
secretId
- - name of the secretversion
- - version of the secretprojectId
- - project identifier- Returns:
- String value of the secret or empty
-
-