Skip to content

Commit f6321bc

Browse files
Merge pull request #163 from goodrum/fix/lease-revoke-url
FIX: Vault::Api::Leases url to match Hashicorp Vault API
2 parents 0926aee + a1cc38f commit f6321bc

File tree

1 file changed

+7
-1
lines changed

1 file changed

+7
-1
lines changed

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

+7-1
Original file line numberDiff line numberDiff line change
@@ -54,8 +54,14 @@ public VaultResponse revoke(final String leaseId) throws VaultException {
5454
int retryCount = 0;
5555
while (true) {
5656
try {
57+
/**
58+
* 2019-03-21
59+
* Changed the Lease revoke url due to invalid path. Vault deprecated the original
60+
* path (/v1/sys/revoke) in favor of a new leases mount point (/v1/sys/leases/revoke)
61+
* https://github.com/hashicorp/vault/blob/master/CHANGELOG.md#080-august-9th-2017
62+
*/
5763
final RestResponse restResponse = new Rest()//NOPMD
58-
.url(config.getAddress() + "/v1/sys/revoke/" + leaseId)
64+
.url(config.getAddress() + "/v1/sys/leases/revoke/" + leaseId)
5965
.header("X-Vault-Token", config.getToken())
6066
.optionalHeader("X-Vault-Namespace", this.nameSpace)
6167
.connectTimeoutSeconds(config.getOpenTimeout())

0 commit comments

Comments
 (0)