Class FileSystemSecretStore.FileSystemSecretStoreBuilder
java.lang.Object
org.forgerock.secrets.propertyresolver.FileSystemSecretStore.FileSystemSecretStoreBuilder
- Enclosing class:
- FileSystemSecretStore
A builder for more fluently creating a FileSystemSecretStore.
-
Method Summary
Modifier and TypeMethodDescriptionbuild()
Builds the secret store.Sets the clock to determine the expiry deadline.withDefaultSecretPropertyFormat
(SecretPropertyFormat defaultFormat) Sets the defaultSecretPropertyFormat
for the secret store.withDirectoryWatcher
(DirectoryWatcher directoryWatcher) Sets theDirectoryWatcher
used by the secret store.withExpiryDuration
(Duration expiryDuration) Sets the amount of time to allow secrets to be reused until they must be refreshed.withSecretMappings
(Map<String, SecretPropertyFormat> secretMappings) Sets the secrets mapping which is allows specifying individual secret property formats for purposes.withStableIdResolver
(StableIdResolver stableIdResolver) Sets the stableIdResolver to determine the stable id for secret.withSuffix
(String suffix) Sets the file suffix to use when retrieving secrets.
-
Method Details
-
withSuffix
Sets the file suffix to use when retrieving secrets. Defaults to an empty string indicating no suffix.- Parameters:
suffix
- the file suffix- Returns:
- the builder
-
withDirectoryWatcher
public FileSystemSecretStore.FileSystemSecretStoreBuilder withDirectoryWatcher(DirectoryWatcher directoryWatcher) Sets theDirectoryWatcher
used by the secret store. Defaults to no directory watcher.- Parameters:
directoryWatcher
- the directory watcher- Returns:
- the builder
-
withDefaultSecretPropertyFormat
public FileSystemSecretStore.FileSystemSecretStoreBuilder withDefaultSecretPropertyFormat(SecretPropertyFormat defaultFormat) Sets the defaultSecretPropertyFormat
for the secret store. Defaults to the base64-encoded format.- Parameters:
defaultFormat
- the default secret property format- Returns:
- the builder
-
withSecretMappings
public FileSystemSecretStore.FileSystemSecretStoreBuilder withSecretMappings(Map<String, SecretPropertyFormat> secretMappings) Sets the secrets mapping which is allows specifying individual secret property formats for purposes. Defaults to no overrides and all secrets will use the default secret property format.- Parameters:
secretMappings
- the mapping of secret purposes to their secret property formats- Returns:
- the builder
-
withExpiryDuration
public FileSystemSecretStore.FileSystemSecretStoreBuilder withExpiryDuration(Duration expiryDuration) Sets the amount of time to allow secrets to be reused until they must be refreshed. Defaults to a duration of 0. Note that this value will be ignored if no Clock is provided.- Parameters:
expiryDuration
- the expiration duration- Returns:
- the builder
-
withClock
Sets the clock to determine the expiry deadline. Defaults to null which to disable expiring secrets.- Parameters:
clock
- the clock- Returns:
- the builder
-
withStableIdResolver
public FileSystemSecretStore.FileSystemSecretStoreBuilder withStableIdResolver(StableIdResolver stableIdResolver) Sets the stableIdResolver to determine the stable id for secret.- Parameters:
stableIdResolver
- the stable id resolver- Returns:
- the builder
-
build
Builds the secret store.- Returns:
- a new filesystem secret store
-