public abstract class GCPSecretSessionServiceFactory extends SessionServiceFactory
SessionServiceFactory
that retrieve the basic authentication
credentials from a Google Cloud Secret Manager secret.
It can be used to avoid having to pass the password as an option of your pipeline. For this
provider to work, the worker where the job runs needs to have the necessary credentials to access
the secret. In Dataflow, this implies adding the necessary permissions to the worker service
account. For other runners, set the credentials in the pipeline options using GcpOptions
.
It also shows how to implement a SessionServiceFactory
that depends on using external
resources to retrieve the Solace session properties. In this case, using the Google Cloud Secrete
Manager client.
Example of how to create the provider object:
GCPSecretSessionServiceFactory factory =
GCPSecretSessionServiceFactory.builder()
.username("user")
.host("host:port")
.passwordSecretName("secret-name")
.build();
SessionService serviceUsingGCPSecret = factory.create();
Modifier and Type | Class and Description |
---|---|
static class |
GCPSecretSessionServiceFactory.Builder |
Constructor and Description |
---|
GCPSecretSessionServiceFactory() |
Modifier and Type | Method and Description |
---|---|
static GCPSecretSessionServiceFactory.Builder |
builder() |
SessionService |
create()
This is the core method that subclasses must implement.
|
abstract java.lang.String |
host() |
abstract java.lang.String |
passwordSecretName() |
abstract java.lang.String |
passwordSecretVersion() |
abstract @Nullable java.lang.String |
secretManagerProjectId() |
abstract java.lang.String |
username() |
abstract java.lang.String |
vpnName() |
setQueue
public abstract java.lang.String username()
public abstract java.lang.String host()
public abstract java.lang.String passwordSecretName()
public abstract java.lang.String vpnName()
public abstract @Nullable java.lang.String secretManagerProjectId()
public abstract java.lang.String passwordSecretVersion()
public static GCPSecretSessionServiceFactory.Builder builder()
public SessionService create()
SessionServiceFactory
create
in class SessionServiceFactory