Repository navigation
feat(gateway): take the control token on the older /svc REST state routes - #740
Closed
andrewpark-scaleai wants to merge 1 commit into
Closed
andrewpark-scaleai wants to merge 1 commit into
andrewpark-scaleai wants to merge 1 commit into
Conversation
andrewpark-scaleai
force-pushed
the
andrewpark/vuln-5158-gateway-guard
branch
from
November 17, 2026 18:39
6da03e2 to
0c48886
Compare
This was referenced Nov 17, 2026
andrewpark-scaleai
force-pushed
the
andrewpark/vuln-5158-callers-send-control-token
branch
2 times, most recently
from
November 18, 2026 18:55
51545f0 to
ffa4ca9
Compare
andrewpark-scaleai
marked this pull request as ready for review
November 19, 2026 18:26
…utes LEGACY_STATE_ROUTES lists the older state routes a backing server serves beside its data plane. On a gateway with a control token, every /svc/<key>/ route takes the token for each of them, after path normalization. A site's /website route serves none of them. A gateway booted without a token behaves as before.
andrewpark-scaleai
force-pushed
the
andrewpark/vuln-5158-gateway-guard
branch
from
November 19, 2026 18:48
0c48886 to
ab1fd64
Compare
andrewpark-scaleai
force-pushed
the
andrewpark/vuln-5158-callers-send-control-token
branch
from
November 19, 2026 18:48
ffa4ca9 to
58f18f0
Compare
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.
Why
The gateway's data plane routes take the control token. This PR applies the same rule to the older REST state routes behind
/svc/<key>/, so every state-changing or state-reading route behind the gateway uses one auth scheme.What changed
LEGACY_STATE_ROUTESingateway/constants.pylists the older state routes:/api/reset,/api/add,/api/bridge/apply,/export-state,/export-snapshot,/snapshot-dirty,/reset-memory,/validate-rows,/api/_state,/api/_resetand/api/debug/seed.token_pathsadds them to every/svc/<key>/route. Matching reusesreaches, so paths are normalized before the check./website/<site>/route serves none of these routes. The harness reaches sites through/svc/<site>/.run_bundle_built_envs_test.pyembeds sends the run's grant to/export-state.Rollout
Verification
tst/unit/env/gateway/control_token_test.py: 354 passed.tst/unit/env/gateway: 1356 passed.ruff checkis clean.

Confidence Score: 5/5
No code issues found that block merging, but the external caller rollout must finish first.Summary
The gateway now requires the control token for older state routes under
/svcand blocks those routes under/websitewhen a token is configured./svc/now require the control token.No new actionable issues found. Keep the stated rollout hold until the external callers are merged and deployed.
Reviews (2) · Last reviewed commit: "feat(gateway): take the control token on..." · Reviewed by Greptile