diff --git a/src/main/java/com/bettercloud/vault/VaultConfig.java b/src/main/java/com/bettercloud/vault/VaultConfig.java index 8925cf54..9dde2be2 100644 --- a/src/main/java/com/bettercloud/vault/VaultConfig.java +++ b/src/main/java/com/bettercloud/vault/VaultConfig.java @@ -139,8 +139,21 @@ public VaultConfig token(final String token) { * "/secret/bar", "2" * @return This object, with secrets paths populated, ready for additional builder-pattern method calls or else finalization with the build() method */ - VaultConfig secretsEnginePathMap(final Map secretEngineVersions) { - this.secretsEnginePathMap = secretEngineVersions; + public VaultConfig secretsEnginePathMap(final Map secretEngineVersions) { + this.secretsEnginePathMap = new ConcurrentHashMap<>(secretEngineVersions); + return this; + } + + /** + *

Sets the secrets Engine version be used by Vault for the provided path.

+ * + * @param path the path to use for accessing Vault secrets. + * Example "/secret/foo" + * @return This object, with a new entry in the secrets paths map, ready for additional builder-pattern method calls or else finalization with + * the build() method + */ + public VaultConfig putSecretsEngineVersionForPath(String path, String version) { + this.secretsEnginePathMap.put(path, version); return this; }