Skip to content

Commit

Permalink
Merge pull request BetterCloud#163 from goodrum/fix/lease-revoke-url
Browse files Browse the repository at this point in the history
FIX: Vault::Api::Leases url to match Hashicorp Vault API
  • Loading branch information
steve-perkins authored Jun 4, 2019
2 parents 0732a5f + d42ef45 commit aa54dc8
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion src/main/java/com/bettercloud/vault/api/Leases.java
Original file line number Diff line number Diff line change
Expand Up @@ -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())
Expand Down

0 comments on commit aa54dc8

Please sign in to comment.