Set request token entry within fetchACLTokenEntryAndEntity (#5880)

This commit is contained in:
Calvin Leung Huang 2018-12-03 08:57:53 -08:00 committed by Jeff Mitchell
parent 1bc959ad5a
commit e9751fdfc5
3 changed files with 4 additions and 2 deletions

View file

@ -1,3 +1,5 @@
// +build !enterprise
package command
import (

View file

@ -1146,8 +1146,6 @@ func (c *Core) sealInitCommon(ctx context.Context, req *logical.Request) (retErr
return retErr
}
req.SetTokenEntry(te)
// Audit-log the request before going any further
auth := &logical.Auth{
ClientToken: req.ClientToken,

View file

@ -136,6 +136,8 @@ func (c *Core) fetchACLTokenEntryAndEntity(ctx context.Context, req *logical.Req
c.logger.Error("failed to lookup token", "error", err)
return nil, nil, nil, nil, ErrInternalError
}
// Set the token entry here since it has not been cached yet
req.SetTokenEntry(te)
default:
te = req.TokenEntry()
}