mirror of
https://github.com/optim-enterprises-bv/vault.git
synced 2025-11-01 19:17:58 +00:00
Remove RevokePrefix from the API too as we simply do not support it any
longer.
This commit is contained in:
@@ -1,11 +1,11 @@
|
||||
package api
|
||||
|
||||
// TokenAuth is used to perform token backend operations on Vault.
|
||||
// TokenAuth is used to perform token backend operations on Vault
|
||||
type TokenAuth struct {
|
||||
c *Client
|
||||
}
|
||||
|
||||
// Token is used to return the client for logical-backend API calls.
|
||||
// Token is used to return the client for token-backend API calls
|
||||
func (a *Auth) Token() *TokenAuth {
|
||||
return &TokenAuth{c: a.c}
|
||||
}
|
||||
@@ -136,19 +136,6 @@ func (c *TokenAuth) RevokeOrphan(token string) error {
|
||||
return nil
|
||||
}
|
||||
|
||||
// RevokePrefix revokes a token based on a prefix, which can be used to revoke
|
||||
// e.g. all tokens issued by a certain credential mount
|
||||
func (c *TokenAuth) RevokePrefix(token string) error {
|
||||
r := c.c.NewRequest("PUT", "/v1/auth/token/revoke-prefix/"+token)
|
||||
resp, err := c.c.RawRequest(r)
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
defer resp.Body.Close()
|
||||
|
||||
return nil
|
||||
}
|
||||
|
||||
// RevokeSelf revokes the token making the call
|
||||
func (c *TokenAuth) RevokeSelf(token string) error {
|
||||
r := c.c.NewRequest("PUT", "/v1/auth/token/revoke-self")
|
||||
|
||||
Reference in New Issue
Block a user