Repository navigation
Require a token on the queue api - #481
Merged
Merged
Conversation
A queue is a v3 edge table, so an unauthenticated /queue/v1 was a way around the token /graph/v3 asks for: create and delete queues, inject messages, poll another tenant's contents, commit away their offsets. The omission was drift rather than a decision - protectedPaths had not been revisited since the initial release, and queue/v1 arrived later in #437. protectedPaths is now every routable prefix, which is what PathPrefixes already calls FILTERED. This one is not code-only: a client that sends no token starts getting 401 the moment a deployment has kc.graph.use-token on. Audit the queue clients and roll tokens out to them before merging. Co-Authored-By: Claude Opus 5 (1M context) <[email protected]>
Contributor
Author
|
Optimistic |
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.
Summary
A queue is a v3 edge table —
queue/v1lowers to edge scans and table DDL over one. ButTokenAuthenticationFilteronly ever guarded/graph/v2and/graph/v3, so/queue/v1was an unauthenticated way to the same data the token is there to protect:POST/DELETE .../queues— create and delete queues, which is v3 table DDLPUT .../enable,.../disable— stop a queuePOST .../messages— inject messagesGET .../partitions/{p}/poll— read another tenant's contentsDELETE .../partitions/{p}/messages?offset=— commit their offsets awayThis was drift, not a decision.
protectedPathshad not been touched since the initial open-source release;queue/v1arrived later in #437 and nobody revisited the list. The same gap let/controlthrough until #480. Note that/queue/v1is already in the read-only filter's prefixes — the codebase treats it as a mutating surface everywhere except here.Changes
TokenAuthenticationFilter.protectedPathsis nowPathPrefixes.FILTERED, every routable prefixthe queue api needs no tokenbecomesthe queue api needs a token, plus a valid-token caseAny queue client that sends no
Authorizationheader starts getting 401 the moment a deployment haskc.graph.use-tokenon. Audit the queue clients and roll tokens out to them first. The shipped default isuse-token: false, so a deployment that never enabled tokens is unaffected either way.Nothing in this repo calls
/queue/v1outside tests, so the blast radius is entirely in callers we cannot see from here.How to Test
The probes are covered too —
/graph/health,/graph/health/livenessand/must keep answering unauthenticated or readiness fails on every pod.AI Assistance