-
Couldn't load subscription status.
- Fork 424
Fix TokenReviews when using WorkspaceAuthentication #3624
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
Conversation
|
Skipping CI for Draft Pull Request. |
|
/test all |
|
/test all |
|
/retest |
1 similar comment
|
/retest |
|
/retest |
|
what is going on /retest |
|
/retest |
1 similar comment
|
/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.
/approve
|
LGTM label has been added. Git tree hash: ec0dd348203a2a35a800c02ad66cf4e57fc03d19
|
|
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: embik 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 |
|
/retest |
…eviews to be handled The original design for per-workspace-auth was in the front-proxy only, only later did I add it to each shard, primarily to make writing e2e tests easier. In the front-proxy, there is a chain of middleware handlers that * resolve the cluster path * find the authenticator for a workspace * inject the authenticator into the request context * the handle the "optional auth", where the authenticator is read from the context again This means the actual authenticator used (i.e. in genericConfig.Authentication.Authenticator) is one that simply reads the authenticator from step 3 (out of the context) and calls it. In the shard variant, this concept was kept the same, i.e. there are handlers that are involved to make the per-workspace-authenticator work. This however means that any other component in kcp that uses the .Authenticator has one that has no concept of per-workspace auth anymore, since the middlewares are not being called. Thankfully the concept of middlewares is not required to make per-workspace-auth working on the shard level, so this commit condenses the logic on the shards to instead provide a "standalone" authenticator that does all steps listed above in one big function. Required for this refactoring is untangling the previous LocalProxy initialisation routine. Now the cluster index is started separatedly (since the new standalone auther needs it) and then handed into the middleware. On-behalf-of: @SAP [email protected] Signed-off-by: Marvin Beckers <[email protected]>
This test will only work in sharded setups if and when we extend the local workspace authenticator to use replication, so it can see other shards. On-behalf-of: @SAP [email protected] Signed-off-by: Marvin Beckers <[email protected]>
|
/retest |
|
LGTM label has been added. Git tree hash: 71602157249b683d0cd5ed0011b7bb80391cd73d
|
Summary
The original design for per-workspace-auth was in the front-proxy only, only later did I add it to each shard, primarily to make writing e2e tests easier.
In the front-proxy, there is a chain of middleware handlers that
This means the actual authenticator used (i.e. in genericConfig.Authentication.Authenticator) is one that simply reads the authenticator from step 3 (out of the context) and calls it.
In the shard variant, this concept was kept the same, i.e. there are handlers that are involved to make the per-workspace-authenticator work. This however means that any other component in kcp that uses the .Authenticator has one that has no concept of per-workspace auth anymore, since the middlewares are not being called.
Thankfully the concept of middlewares is not required to make per-workspace-auth working on the shard level, so this commit condenses the logic on the shards to instead provide a "standalone" authenticator that does all steps listed above in one big function. This required the Kube patch introduced via #3622 (kcp-dev/kubernetes#180)
Required for this refactoring is untangling the previous LocalProxy initialisation routine. Now the cluster index is started separatedly (since the new standalone auther needs it) and then handed into the middleware.
What Type of PR Is This?
/kind bug
Related Issue(s)
Fixes #3614
Release Notes