Class CacheableSecretsProviderDelegate<C>
java.lang.Object
com.evolveum.midpoint.common.secrets.CacheableSecretsProviderDelegate<C>
- Type Parameters:
C
-
- All Implemented Interfaces:
SecretsProvider<C>
Delegate implementation for secret providers that is able to cache the resolved secrets and check keys for allowed prefixes.
-
Field Summary
Fields inherited from interface com.evolveum.midpoint.prism.crypto.SecretsProvider
EMPTY_DEPENDENCIES
-
Constructor Summary
ConstructorDescriptionCacheableSecretsProviderDelegate
(@NotNull SecretsProvider<C> delegate, Duration duration) -
Method Summary
Modifier and TypeMethodDescriptionvoid
destroy()
This method can be used to clean-up resources of secret provider.Returns configuration of the provider.@NotNull String[]
Returns list of providers that this provider depends on.@NotNull String
Returns unique identifier of the provider.getSecretBinary
(@NotNull String key) Returns secretByteBuffer
for given key.getSecretString
(@NotNull String key) Returns secretString
for given key.void
Post-construction initialization.protected <ST> ST
resolveSecret
(@NotNull String key, @NotNull Class<ST> type)
-
Constructor Details
-
CacheableSecretsProviderDelegate
public CacheableSecretsProviderDelegate(@NotNull @NotNull SecretsProvider<C> delegate, Duration duration)
-
-
Method Details
-
initialize
public void initialize()Description copied from interface:SecretsProvider
Post-construction initialization. Called before the provider is added to the list of usable providers.- Specified by:
initialize
in interfaceSecretsProvider<C>
-
destroy
public void destroy()Description copied from interface:SecretsProvider
This method can be used to clean-up resources of secret provider. Called after provider was removed from the list of usable providers.- Specified by:
destroy
in interfaceSecretsProvider<C>
-
getIdentifier
Description copied from interface:SecretsProvider
Returns unique identifier of the provider.- Specified by:
getIdentifier
in interfaceSecretsProvider<C>
-
getDependencies
Description copied from interface:SecretsProvider
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.- Specified by:
getDependencies
in interfaceSecretsProvider<C>
-
getConfiguration
Description copied from interface:SecretsProvider
Returns configuration of the provider.- Specified by:
getConfiguration
in interfaceSecretsProvider<C>
-
getSecretBinary
Description copied from interface:SecretsProvider
Returns secretByteBuffer
for given key. Returns null if the secret does not exist.- Specified by:
getSecretBinary
in interfaceSecretsProvider<C>
- Throws:
EncryptionException
- if the secret cannot be resolved (e.g. due to network problems)
-
getSecretString
Description copied from interface:SecretsProvider
Returns secretString
for given key. Returns null if the secret does not exist.- Specified by:
getSecretString
in interfaceSecretsProvider<C>
- Throws:
EncryptionException
- if the secret cannot be resolved (e.g. due to network problems)
-
resolveSecret
protected <ST> ST resolveSecret(@NotNull @NotNull String key, @NotNull @NotNull Class<ST> type) throws EncryptionException - Throws:
EncryptionException
-