Skip to content

Commit

Permalink
Update API to use lease_id in body of sys/leases/revoke call (#7777) (#…
Browse files Browse the repository at this point in the history
…7800)

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 hashicorp/vault-ssh-helper#40
  • Loading branch information
jefferai authored Nov 5, 2019
1 parent 10e6016 commit 879cdfb
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion api/sys_leases.go
Original file line number Diff line number Diff line change
Expand Up @@ -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()
Expand Down

0 comments on commit 879cdfb

Please sign in to comment.