-
Notifications
You must be signed in to change notification settings - Fork 391
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
🐛 pkg/server: ensure that home workspace handler gets authz with audit … #2628
Conversation
apiHandler = genericapiserver.DefaultBuildHandlerChainFromAuthz(apiHandler, genericConfig) | ||
genericConfig.Authorization.Authorizer = authorizerWithoutAudit |
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.
isn't authorizerWithoutAudit
what we pass to WithHomeWorkspaces
? (line 342)
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.
if I don't pass it there, I don't get audits at all.
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.
let me retest 🤔
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.
yeah, i believe something changed and WithHomeWorkspaces
now hosts regular workspaces as well after the refactoring? (not sure)
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.
my audit logs are empty with what is in main
without this PR.
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.
shouldn't we be passing an authoriser decorated with authorization.EnableAuditLogging
?
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, that's done in line 335 👍
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.
genericConfig.Authorization.Authorizer = authorization.EnableAuditLogging(genericConfig.Authorization.Authorizer)
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.
don't we pass genericConfig.Authorization.Authorizer
which is overwritten in line 337
(authorizerWithoutAudit
) to WithHomeWorkspaces
?
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.
he, yes, that's confusing 😆 You're right, but the audit enabled handler is given to the wrapped apiHandler
. I'll comment to make it clearer 👍
6c3cc1d
to
d63ceec
Compare
d63ceec
to
4f4771f
Compare
/lgtm thanks for the comment! |
4f4771f
to
4ec26db
Compare
/approve |
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: p0lyn0mial, sttts The full list of commands accepted by this bot can be found here. The pull request process is described here
Needs approval from an approver in each of these files:
Approvers can indicate their approval by writing |
/lgtm |
…logging
Summary
This resolves #2627
This resolves #2627
This resolves #2627
This resolves #2627
Related issue(s)
Fixes #2627