Fix protected-ingress auth cache key colliding for Authorization-header clients#446
Draft
mhotan wants to merge 1 commit into
Draft
Fix protected-ingress auth cache key colliding for Authorization-header clients#446mhotan wants to merge 1 commit into
mhotan wants to merge 1 commit into
Conversation
…er clients The REST and console protected-ingress annotations key their nginx auth-request cache on `$http_flyte_authorization$http_cookie`. A client that authenticates with the standard `Authorization` header and no cookie produces an empty, shared cache key, so every such request collapses into one auth-cache entry. That single entry is then served to all of them for the cache TTL. A `/me` subrequest that returns 401 (an unauthenticated probe, an expired session) gets cached and handed back to valid requests as a 302 redirect to /login, producing intermittent auth failures uncorrelated with the caller's token. The inverse is a cached 200 under the same empty key, which can let a token-less request through and serve it another caller's cached identity headers. Prefix the three REST/console cache keys with `$http_authorization` so each distinct bearer credential gets its own cache entry, matching `protectedIngressAnnotationsGrpc`, which already includes it. Regenerated the controlplane snapshot fixtures. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Contributor
Current Aviator status
This pull request is currently open (not queued). How to mergeTo merge this PR, comment
See the real-time status of this PR on the
Aviator webapp.
Use the Aviator Chrome Extension
to see the status of your PR within GitHub.
|
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.
Overview
The REST and console protected-ingress annotations key their nginx auth-request
cache on
$http_flyte_authorization$http_cookie. A client that authenticateswith the standard
Authorizationheader and no cookie produces an empty,shared cache key, so every such request collapses into one auth-cache entry.
A
/meauth subrequest that returns 401 (an unauthenticated probe, an expiredsession) then gets cached and served back to valid requests as a
302 → /loginfor the cache TTL — intermittent auth failures uncorrelated with the caller's
token. The inverse is a cached
200under the empty key letting a token-lessrequest through with another caller's identity headers.
This prefixes the three REST/console cache keys with
$http_authorizationsoeach bearer credential gets its own cache entry, matching
protectedIngressAnnotationsGrpc, which already includes it.Test
make generate-expected && make test— green. Onlyauth-cache-keylineschange in the controlplane snapshots.
Rollout
Values-only default change; picked up on the next chart render / ArgoCD sync.
No template or resource-shape changes.
Rollback
Revert the commit; the cache key returns to its prior value.