Class EnvironmentBasedSecretsProvider
java.lang.Object
org.apache.pulsar.functions.secretsprovider.EnvironmentBasedSecretsProvider
- All Implemented Interfaces:
SecretsProvider
This defines a very simple Secrets Provider that looks up environment variable
thats named the same as secretName and fetches it.
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptioninterpolateSecretForValue(String value) If the passed value is formatted as a reference to a secret, as defined by the implementation, return the referenced secret.provideSecret(String secretName, Object pathToSecret) Fetches a secret.Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface org.apache.pulsar.functions.secretsprovider.SecretsProvider
init
-
Constructor Details
-
EnvironmentBasedSecretsProvider
public EnvironmentBasedSecretsProvider()
-
-
Method Details
-
provideSecret
Fetches a secret.- Specified by:
provideSecretin interfaceSecretsProvider- Returns:
- The actual secret
-
interpolateSecretForValue
Description copied from interface:SecretsProviderIf the passed value is formatted as a reference to a secret, as defined by the implementation, return the referenced secret. If the value is not formatted as a secret reference or the referenced secret does not exist, return null.- Specified by:
interpolateSecretForValuein interfaceSecretsProvider- Parameters:
value- a config value that may be formatted as a reference to a secret- Returns:
- the materialized secret. Otherwise, null.
-