Address some review feedback
This commit is contained in:
parent
99a5b4402d
commit
09f06554cb
|
@ -183,7 +183,7 @@ func requestWrapTTL(r *http.Request, req *logical.Request) (*logical.Request, er
|
|||
if err != nil {
|
||||
return req, err
|
||||
}
|
||||
req.WrapTTL = time.Duration(time.Duration(seconds) * time.Second)
|
||||
req.WrapTTL = time.Duration(seconds) * time.Second
|
||||
}
|
||||
|
||||
return req, nil
|
||||
|
|
|
@ -112,8 +112,10 @@ func (c *Core) HandleRequest(req *logical.Request) (resp *logical.Response, err
|
|||
},
|
||||
}
|
||||
|
||||
_, err = c.router.Route(cubbyReq)
|
||||
if err != nil {
|
||||
cubbyResp, err := c.router.Route(cubbyReq)
|
||||
if err != nil || cubbyResp == nil || cubbyResp.IsError() {
|
||||
// Revoke since it's not yet being tracked for expiration
|
||||
c.tokenStore.Revoke(te.ID)
|
||||
c.logger.Printf("[ERR] core: failed to store wrapped response information: %v", err)
|
||||
return nil, ErrInternalError
|
||||
}
|
||||
|
@ -129,6 +131,8 @@ func (c *Core) HandleRequest(req *logical.Request) (resp *logical.Response, err
|
|||
|
||||
// Register the wrapped token with the expiration manager
|
||||
if err := c.expiration.RegisterAuth(te.Path, auth); err != nil {
|
||||
// Revoke since it's not yet being tracked for expiration
|
||||
c.tokenStore.Revoke(te.ID)
|
||||
c.logger.Printf("[ERR] core: failed to register cubbyhole wrapping token lease "+
|
||||
"(request path: %s): %v", req.Path, err)
|
||||
return nil, ErrInternalError
|
||||
|
|
Loading…
Reference in a new issue