Repository navigation
feat(gateway): take the control token on the older /svc REST state routes - #822
Draft
andrewpark-scaleai wants to merge 1 commit into
Draft
andrewpark-scaleai wants to merge 1 commit into
andrewpark-scaleai wants to merge 1 commit into
Conversation
…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.
This branch has not been deployed
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.