Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Set request token entry within fetchACLTokenEntryAndEntity #5880

Merged
merged 2 commits into from Dec 3, 2018
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
2 changes: 2 additions & 0 deletions command/seal_migration_test.go
@@ -1,3 +1,5 @@
// +build !enterprise

package command

import (
Expand Down
2 changes: 0 additions & 2 deletions vault/core.go
Expand Up @@ -1146,8 +1146,6 @@ func (c *Core) sealInitCommon(ctx context.Context, req *logical.Request) (retErr
return retErr
}

req.SetTokenEntry(te)
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This was the only instance that I found where req.SetTokenEntry was called after a fetchACLTokenEntryAndEntity call.


// Audit-log the request before going any further
auth := &logical.Auth{
ClientToken: req.ClientToken,
Expand Down
2 changes: 2 additions & 0 deletions vault/request_handling.go
Expand Up @@ -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()
}
Expand Down