Package org.forgerock.secrets.vault
Class VaultConfig.Builder
java.lang.Object
org.forgerock.secrets.vault.VaultConfig.Builder
- Enclosing class:
- VaultConfig
Builder object for Vault configuration settings. Setting a
clock(Clock)
explicitly is recommended.-
Method Summary
Modifier and TypeMethodDescriptionbuild()
Builds the Vault configuration based on the supplied settings.Specifies the clock to use for calculating expiry times.Specifies the (optional) namespace to use in calls to Vault.Specifies the path on the server of the secret engine to use.purposeMapping
(Function<Purpose<?>, String> purposeMapping) Configures the mapping from purposes to named entries in a Vault secret engine.purposeMapping
(Map<Purpose<?>, String> purposeMapping) Configures the mapping from purposes to named entries in a Vault secret engine.
-
Method Details
-
clock
Specifies the clock to use for calculating expiry times.- Parameters:
clock
- the clock to use.- Returns:
- this builder.
-
namespace
Specifies the (optional) namespace to use in calls to Vault. This will become the X-Vault-Namespace header on requests if specified.- Parameters:
namespace
- the vault namespace to use.- Returns:
- this builder.
-
path
Specifies the path on the server of the secret engine to use. If not specified a default will be chosen based on the type of secret engine being used.- Parameters:
path
- the path to the secret engine relative to the base URI.- Returns:
- this builder.
-
purposeMapping
Configures the mapping from purposes to named entries in a Vault secret engine. The default mapping uses the purpose label. If the function returnsnull
for a given purpose then aNoSuchSecretException
will be thrown when retrieving secrets for that purpose.- Parameters:
purposeMapping
- the mapping from purposes to Vault secret names.- Returns:
- this builder.
-
purposeMapping
Configures the mapping from purposes to named entries in a Vault secret engine. If no explicit mapping is provided then aNoSuchSecretException
will be thrown when attempting to access a secret for that purpose.- Parameters:
purposeMapping
- the purpose mapping.- Returns:
- this builder.
-
build
Builds the Vault configuration based on the supplied settings.- Returns:
- the vault configuration.
-