-
Notifications
You must be signed in to change notification settings - Fork 88
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
fix(authz): get username from authn.go request context #1383
Conversation
Codecov Report
@@ Coverage Diff @@
## main #1383 +/- ##
==========================================
- Coverage 90.71% 90.70% -0.01%
==========================================
Files 99 99
Lines 22246 22253 +7
==========================================
+ Hits 20180 20185 +5
- Misses 1540 1542 +2
Partials 526 526
... and 1 file with indirect coverage changes 📣 We’re building smart automated test selection to slash your CI/CD build times. Learn more |
5791261
to
9cfcfdc
Compare
da778b0
to
1b2ef2b
Compare
7066a44
to
18cd246
Compare
pkg/api/authz.go
Outdated
|
||
readGlobPatterns := ac.getGlobPatterns(username, acCtx.Groups, Read) | ||
dmcGlobPatterns := ac.getGlobPatterns(username, acCtx.Groups, DetectManifestCollision) | ||
// getContext updates an AccessControlContext for a user/anonymous and returns it. |
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.
Leave it as getContext()
pkg/api/authz.go
Outdated
readGlobPatterns := ac.getGlobPatterns(username, acCtx.Groups, Read) | ||
dmcGlobPatterns := ac.getGlobPatterns(username, acCtx.Groups, DetectManifestCollision) | ||
// getContext updates an AccessControlContext for a user/anonymous and returns it. | ||
func (ac *AccessController) updateContext(acCtx *localCtx.AccessControlContext, request *http.Request) context.Context { |
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.
getContext()
Signed-off-by: Petu Eusebiu <peusebiu@cisco.com>
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.
lgtm
What type of PR is this?
Which issue does this PR fix:
What does this PR do / Why do we need it:
If an issue # is not available please add repro steps and logs showing the issue:
Testing done on this change:
Automation added to e2e:
Will this break upgrades or downgrades?
Does this PR introduce any user-facing change?:
By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license.