-
Notifications
You must be signed in to change notification settings - Fork 4.2k
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
Skip unneeded resolve role #22597
Skip unneeded resolve role #22597
Conversation
CI Results: |
4e79120
to
8c16ca5
Compare
771d162
to
0f2ab8e
Compare
Build Results: |
c1d2a77
to
e59b252
Compare
// ns would have been made non-empty during insertion. Use non-empty | ||
// value during query as well. | ||
if req.NamespacePath == "" { | ||
req.NamespacePath = "root" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is this used anywhere upstream? We are changing the request downstream and I am wondering what effect could it have for the upstream caller?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Good thought. Note that this is specifically for the quotas.Request
, so I don't think it will have any outside impacts (this is just used internally to query memdb). This is consistent with the way its done for other queries if you look at queryQuota
.
// If this is not a role-based quota, we still need to associate the | ||
// login role with this lease for later lease-count quotas to be | ||
// accurate. | ||
if reqRole == nil && resp.Auth.TokenType != logical.TokenTypeBatch { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is this how we determine if a request generates a lease? just make sure it's not a batch token?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes, for login requests. In general it's more complicated.
This PR skips
ResolveRoleOperation
calls for requests if the namespace/mount doesn't have role-based quotas.We later perform the operation on-demand for lease creation if it has not already been done.