From a1cc38f36983427a4c891c50773722495ae62ea3 Mon Sep 17 00:00:00 2001 From: Jeremy Goodrum Date: Thu, 21 Mar 2019 07:47:50 -0500 Subject: [PATCH] UPDATE: Vault::Api::Leases url to match current model --- src/main/java/com/bettercloud/vault/api/Leases.java | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/src/main/java/com/bettercloud/vault/api/Leases.java b/src/main/java/com/bettercloud/vault/api/Leases.java index 99a54ee8..1a54c6e8 100644 --- a/src/main/java/com/bettercloud/vault/api/Leases.java +++ b/src/main/java/com/bettercloud/vault/api/Leases.java @@ -54,8 +54,14 @@ public VaultResponse revoke(final String leaseId) throws VaultException { int retryCount = 0; while (true) { try { + /** + * 2019-03-21 + * Changed the Lease revoke url due to invalid path. Vault deprecated the original + * path (/v1/sys/revoke) in favor of a new leases mount point (/v1/sys/leases/revoke) + * https://github.com/hashicorp/vault/blob/master/CHANGELOG.md#080-august-9th-2017 + */ final RestResponse restResponse = new Rest()//NOPMD - .url(config.getAddress() + "/v1/sys/revoke/" + leaseId) + .url(config.getAddress() + "/v1/sys/leases/revoke/" + leaseId) .header("X-Vault-Token", config.getToken()) .optionalHeader("X-Vault-Namespace", this.nameSpace) .connectTimeoutSeconds(config.getOpenTimeout())