Support multiple authenticators with path matching#52
Open
philipgough wants to merge 6 commits intorhobs-obs-api-konfluxfrom
Open
Support multiple authenticators with path matching#52philipgough wants to merge 6 commits intorhobs-obs-api-konfluxfrom
philipgough wants to merge 6 commits intorhobs-obs-api-konfluxfrom
Conversation
…nv to support multiple authenticators
9772bad to
b426d9d
Compare
philipgough
commented
Apr 10, 2026
| // for the given list of tenants. Otherwise, it returns an error. | ||
| // It protects the Prometheus remote write and Loki push endpoints. The tracing endpoint is not protected because | ||
| // it goes through the gRPC middleware stack, which behaves differently from the HTTP one. | ||
| func EnforceAccessTokenPresentOnSignalWrite(oidcTenants map[string]struct{}) func(http.Handler) http.Handler { |
Author
There was a problem hiding this comment.
i really dont understand why this was here. it was enforcing oidc on all write requests.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What
Although the proxy allowed an end user to configure multiple authenticators, at runtime, only one was selected in order of preference.
This change allows support for multiple authenticators.
The default behaviour remains intact.
Optionally, users can specify paths which should not match for specific authenticators.
It also adds middleware that ensures that at least one authenticator has run in order to support users not mistakingly bypassing auth with their configuration.
Furthermore, this change sets up an environment similar to what we have in RHOBS Cell in a KinD cluster.
This utility was badly needed in any case to facilitate the testing of auth which was practically non-existent or difficult to hook into.
It generates a simple configuration that splits read and write for logs and metrics on oidc for read and mtls for write respectively.
Key points to note that if you want optional mtls the api needs to be passed the
- --tls.client-auth-type=RequestClientCertflag that already existed prior to this change.From the working test, here is a sample of what a tenants config for multi-auth will look like