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
-
Method Summary
Modifier and TypeMethodDescriptiondefault void
destroy()
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 String
Returns unique identifier of the provider.default ByteBuffer
getSecretBinary
(@NotNull String key) Returns secretByteBuffer
for given key.getSecretString
(@NotNull String key) Returns secretString
for given key.default void
Post-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 secretString
for 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 secretByteBuffer
for given key. Returns null if the secret does not exist.- Throws:
EncryptionException
- if the secret cannot be resolved (e.g. due to network problems)
-