Interface SecretsProvider<C>
- All Known Implementing Classes:
CacheableSecretsProviderDelegate,ContainerSecretsProvider,DockerSecretsProvider,EnvironmentVariablesSecretsProvider,FileSecretsProvider,PropertiesSecretsProvider,SecretsProviderImpl
public interface SecretsProvider<C>
Interface for component that can resolve secrets from external secrets managers (e.g. instead of decrypting them).
-
Field Summary
Fields -
Method Summary
Modifier and TypeMethodDescriptiondefault voiddestroy()This method can be used to clean-up resources of secret provider.Returns configuration of the provider.default @NotNull String[]Returns list of providers that this provider depends on.@NotNull StringReturns unique identifier of the provider.default ByteBuffergetSecretBinary(@NotNull String key) Returns secretByteBufferfor given key.getSecretString(@NotNull String key) Returns secretStringfor given key.default voidPost-construction initialization.
-
Field Details
-
EMPTY_DEPENDENCIES
-
-
Method Details
-
initialize
default void initialize()Post-construction initialization. Called before the provider is added to the list of usable providers. -
destroy
default void destroy()This method can be used to clean-up resources of secret provider. Called after provider was removed from the list of usable providers. -
getIdentifier
Returns unique identifier of the provider. -
getDependencies
Returns list of providers that this provider depends on. The provider will be initialized after all dependencies are available and initialized. Default implementation returns an empty array. -
getConfiguration
C getConfiguration()Returns configuration of the provider. -
getSecretString
Returns secretStringfor given key. Returns null if the secret does not exist.- Throws:
EncryptionException- if the secret cannot be resolved (e.g. due to network problems)
-
getSecretBinary
Returns secretByteBufferfor given key. Returns null if the secret does not exist.- Throws:
EncryptionException- if the secret cannot be resolved (e.g. due to network problems)
-