Repository navigation
feat(gateway): make List pagination token-only, drop web cursor secret - #899
Merged
Merged
Conversation
## Summary ### Why? The gateway's `List` token already carries the queue and window, yet callers had to resend both bounds on every page. So `web/submitqueue` wrapped the window plus the token in a second, HMAC-signed cursor, and every deployment needed a signing secret that protected nothing the gateway does not already validate. Stovepipe's `List` already does this right. ### What? - `ListRequest` bounds become optional (`oneof`, same field numbers 2/3, so the wire format is unchanged). The first page still requires both; with a `page_token`, the window comes from the token and any bound supplied must match it. - `ListResponse` echoes the resolved window (`received_at_or_after_ms`, `received_before_ms`), so clients can show it without decoding the token. - Tokens are versioned base64url JSON, checked field by field, including that the last receipt lies inside the window. Unversioned tokens still decode for one release (`TODO(list-token)`). - The Go client sends bounds on the first page only. - `web/submitqueue` links the raw gateway token as `?page=` and calls `list` without bounds when one is present; a token the gateway rejects redirects to the live page. `CursorCodec`, `extension/cursor` (HMAC) and the `cursors` option are removed, along with `SUBMITQUEUE_WEB_CURSOR_SECRET` from the reference host, Makefile, compose and e2e harness. - Breaking for web hosts: `GatewayReader.list` takes the `oneof` bound shape and must return the window. A Connect client satisfies it as-is; hand-written adapters need updating, and callers must drop `cursors`. ## Test Plan ✅ `./tool/bazel test //submitqueue/gateway/controller/... //service/submitqueue/gateway/... //submitqueue/client/...` — first page needs both bounds, token-only continuation, matching/mismatched bounds, tampered/wrong-version/out-of-range/legacy tokens, proto presence round-trip ✅ `./tool/bazel test //web:check` — raw token in links, token-only `list` on `?page=`, rejected-token redirect, no `CursorCodec` ✅ `./tool/bazel build //...` (integration and e2e suites compile); `make test` passes except `//tool/compose:compose_test`, a macOS `/private/var` tmp-path mismatch unrelated to this change⚠️ Gateway integration suite (`//test/integration/submitqueue/gateway:go_default_test`) not run locally — needs Docker; CI covers it
behinddwalls
marked this pull request as ready for review
October 20, 2026 21:38
mnoah1
approved these changes
Oct 20, 2026
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
Why?
The gateway's
Listtoken already carries the queue and window, yet callers had to resend both bounds on every page. Soweb/submitqueuewrapped the window plus the token in a second, HMAC-signed cursor, and every deployment needed a signing secret that protected nothing the gateway does not already validate. Stovepipe'sListalready does this right.What?
ListRequestbounds become optional (oneof, same field numbers 2/3, so the wire format is unchanged). The first page still requires both; with apage_token, the window comes from the token and any bound supplied must match it.ListResponseechoes the resolved window (received_at_or_after_ms,received_before_ms), so clients can show it without decoding the token.TODO(list-token)).web/submitqueuelinks the raw gateway token as?page=and callslistwithout bounds when one is present; a token the gateway rejects redirects to the live page.CursorCodec,extension/cursor(HMAC) and thecursorsoption are removed, along withSUBMITQUEUE_WEB_CURSOR_SECRETfrom the reference host, Makefile, compose and e2e harness.GatewayReader.listtakes theoneofbound shape and must return the window. A Connect client satisfies it as-is; hand-written adapters need updating, and callers must dropcursors.Test Plan
✅
⚠️ Gateway integration suite (
./tool/bazel test //submitqueue/gateway/controller/... //service/submitqueue/gateway/... //submitqueue/client/...— first page needs both bounds, token-only continuation, matching/mismatched bounds, tampered/wrong-version/out-of-range/legacy tokens, proto presence round-trip✅
./tool/bazel test //web:check— raw token in links, token-onlyliston?page=, rejected-token redirect, noCursorCodec✅
./tool/bazel build //...(integration and e2e suites compile);make testpasses except//tool/compose:compose_test, a macOS/private/vartmp-path mismatch unrelated to this change//test/integration/submitqueue/gateway:go_default_test) not run locally — needs Docker; CI covers it🤖 Generated with Claude Code