From 2bcfa6fdccf5ddff515af2b5002f2e652d743eda Mon Sep 17 00:00:00 2001 From: Jeff Mitchell Date: Fri, 1 Nov 2019 10:33:12 -0400 Subject: [PATCH] Update API to use lease_id in body of sys/leases/revoke call We didn't make this change earlier because not everyone would have had an updated version of Vault with this API change but it's definitely time. Fixes https://github.com/hashicorp/vault-ssh-helper/issues/40 --- api/sys_leases.go | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/api/sys_leases.go b/api/sys_leases.go index 09c9642a95d8..40826a7d23f1 100644 --- a/api/sys_leases.go +++ b/api/sys_leases.go @@ -28,7 +28,13 @@ func (c *Sys) Renew(id string, increment int) (*Secret, error) { } func (c *Sys) Revoke(id string) error { - r := c.c.NewRequest("PUT", "/v1/sys/leases/revoke/"+id) + r := c.c.NewRequest("PUT", "/v1/sys/leases/revoke") + body := map[string]interface{}{ + "lease_id": id, + } + if err := r.SetJSONBody(body); err != nil { + return err + } ctx, cancelFunc := context.WithCancel(context.Background()) defer cancelFunc()