mirror of
https://github.com/optim-enterprises-bv/vault.git
synced 2025-11-02 19:47:54 +00:00
Use RenewTokenAsSelf instead
This commit is contained in:
@@ -135,9 +135,9 @@ func (c *TokenAuth) RenewSelf(increment int) (*Secret, error) {
|
|||||||
return ParseSecret(resp.Body)
|
return ParseSecret(resp.Body)
|
||||||
}
|
}
|
||||||
|
|
||||||
// RenewSelfAsToken behaves like renew-self, but authenticates using a provided
|
// RenewTokenAsSelf behaves like renew-self, but authenticates using a provided
|
||||||
// token instead of the token attached to the client.
|
// token instead of the token attached to the client.
|
||||||
func (c *TokenAuth) RenewSelfAsToken(token string, increment int) (*Secret, error) {
|
func (c *TokenAuth) RenewTokenAsSelf(token string, increment int) (*Secret, error) {
|
||||||
r := c.c.NewRequest("PUT", "/v1/auth/token/renew-self")
|
r := c.c.NewRequest("PUT", "/v1/auth/token/renew-self")
|
||||||
r.ClientToken = token
|
r.ClientToken = token
|
||||||
|
|
||||||
|
|||||||
@@ -148,7 +148,7 @@ func (r *Renewer) renewAuth() error {
|
|||||||
}
|
}
|
||||||
|
|
||||||
// Renew the auth.
|
// Renew the auth.
|
||||||
renewal, err := client.Auth().Token().RenewSelfAsToken(token, 0)
|
renewal, err := client.Auth().Token().RenewTokenAsSelf(token, 0)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return err
|
return err
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user