Skip to content

Commit d37348c

Browse files
committed
Rollback of PR #194 due to breaking unit tests
1 parent 1ed864c commit d37348c

File tree

2 files changed

+3
-7
lines changed

2 files changed

+3
-7
lines changed

README.md

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -273,7 +273,6 @@ should represent non-breaking changes. The third number represents any very min
273273

274274
* **5.1.0 (IN PROGRESS)**: This release contains the following updates:
275275
* Supports path prefixes when using K/V engine V2. [(PR #189)](https://github.com/BetterCloud/vault-java-driver/pull/189)
276-
* Changes the logic for mapping paths to engine versions, to support generating AWS credentials using roles. [(PR #194)](https://github.com/BetterCloud/vault-java-driver/pull/194/)
277276
* Fixes issues with bulk requests in the transit API. [(PR #195)](https://github.com/BetterCloud/vault-java-driver/pull/195)
278277
* Adds response body to exception for Auth failures. [(PR #198)](https://github.com/BetterCloud/vault-java-driver/pull/198)
279278
* Support all options for the createToken operation. [(PR #199)](https://github.com/BetterCloud/vault-java-driver/pull/199)

src/main/java/com/bettercloud/vault/api/Logical.java

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,6 @@
1212
import java.nio.charset.StandardCharsets;
1313
import java.util.Arrays;
1414
import java.util.Map;
15-
import java.util.Map.Entry;
1615

1716
import static com.bettercloud.vault.api.LogicalUtilities.adjustPathForDelete;
1817
import static com.bettercloud.vault.api.LogicalUtilities.adjustPathForList;
@@ -626,11 +625,9 @@ public LogicalResponse upgrade(final String kvPath) throws VaultException {
626625

627626
private Integer engineVersionForSecretPath(final String secretPath) {
628627
if (!this.config.getSecretsEnginePathMap().isEmpty()) {
629-
for (Entry<String, String> entry : this.config.getSecretsEnginePathMap().entrySet()) {
630-
if (secretPath.startsWith(entry.getKey())) {
631-
return Integer.valueOf(entry.getValue());
632-
}
633-
}
628+
return this.config.getSecretsEnginePathMap().containsKey(secretPath + "/") ?
629+
Integer.valueOf(this.config.getSecretsEnginePathMap().get(secretPath + "/"))
630+
: this.config.getGlobalEngineVersion();
634631
}
635632
return this.config.getGlobalEngineVersion();
636633
}

0 commit comments

Comments
 (0)