You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
redesign how shard-per-workspace-authentication works to allow TokenReviews 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]>
0 commit comments