Interface SecretsProvider

All Known Implementing Classes:
ClearTextSecretsProvider, EnvironmentBasedSecretsProvider

public interface SecretsProvider
This file defines the SecretsProvider interface. This interface is used by the function instances/containers to actually fetch the secrets. What SecretsProvider to use is decided by the SecretsProviderConfigurator.
  • Method Summary

    Modifier and Type
    Method
    Description
    default void
    init(Map<String,String> config)
    Initialize the SecretsProvider.
    default String
    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.
  • Method Details

    • init

      default void init(Map<String,String> config)
      Initialize the SecretsProvider.
    • provideSecret

      String provideSecret(String secretName, Object pathToSecret)
      Fetches a secret.
      Returns:
      The actual secret
    • interpolateSecretForValue

      default String interpolateSecretForValue(String value)
      If 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.
      Parameters:
      value - a config value that may be formatted as a reference to a secret
      Returns:
      the materialized secret. Otherwise, null.