Class GcpSecret
java.lang.Object
org.apache.beam.sdk.util.Secret
org.apache.beam.sdk.extensions.gcp.util.GcpSecret
- All Implemented Interfaces:
Serializable
public class GcpSecret
extends org.apache.beam.sdk.util.Secret
A
Secret manager implementation that retrieves secrets from Google Cloud Secret Manager.- See Also:
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionbooleanbyte[]Returns the secret as a byte array.Returns the version name of the secret.inthashCode()Methods inherited from class org.apache.beam.sdk.util.Secret
fromJson, fromJson, getBytes, getBytes, getString, getString, parseSecretOption
-
Constructor Details
-
GcpSecret
Initializes aGcpSecretobject.- Parameters:
versionName- The full version name of the secret in Google Cloud Secret Manager. For example: projects//secrets/ /versions/1. For more info, see https://cloud.google.com/python/docs/reference/secretmanager/latest/google.cloud.secretmanager_v1beta1.services.secret_manager_service.SecretManagerServiceClient#google_cloud_secretmanager_v1beta1_services_secret_manager_service_SecretManagerServiceClient_access_secret_version
-
-
Method Details
-
getSecretBytes
public byte[] getSecretBytes()Returns the secret as a byte array. Assumes that the current active service account has permissions to read the secret.- Specified by:
getSecretBytesin classorg.apache.beam.sdk.util.Secret- Returns:
- The secret as a byte array.
-
getVersionName
Returns the version name of the secret.- Returns:
- The version name as a String.
-
equals
-
hashCode
public int hashCode()
-