Repository navigation
fix(rest): gate SOX tree and file reads behind the editor gate (R-55, S-33) - #31
Merged
Merged
Conversation
… S-33)
GET /api/sox/tree, /api/sox/comp/{id}, /api/sox/palette, /api/sox/names
and GET /file/* now sit behind check_upgrade_auth (bearer header or
sandstar_session cookie, plus Origin check), the same gate as
/live/sedonaState, which carries the same component tree.
Routes and auth layer:
- inside check_upgrade_auth: the four SOX tree reads and GET /file/*;
- PUT /file/* stays behind require_auth (bearer only);
- /library/ and GET /tags stay outside on purpose (read-only stubs, no
device data; comment in rest/mod.rs).
Behavior: with no auth configured (field default) every request passes,
unchanged. With auth on, the browser editor keeps working: it fetches
/file/* same-origin with the session cookie after SCRAM login (S-32b).
Tests: auth_layer.rs covers 401 without/with bad credential (GET and
HEAD), exact status with cookie or bearer, same-host Origin accepted,
foreign Origin 403 with bearer or cookie, PUT /file with cookie only
401, library stubs open, auth off open. The main test fails on the old
code. Gates: 2890 passed, 0 failed. Local E2E with auth on and the
trkrDevelop editor: /file and /api/sox/tree 200 after login, 401
without.
docs: HARDCODED_LIMITS.md not needed, only tests changed there.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01QKRNiek8qYRoRt7dcrDDVC
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.
GET /api/sox/{tree,comp/{id},palette,names} and GET /file/* move behind
check_upgrade_auth(bearer or session cookie + Origin), the same gate as /live/sedonaState. PUT /file/* stays bearer-only; /library/ and /tags stay open (stubs).Tests: auth_layer.rs; gates 2890 passed / 0 failed.
🤖 Generated with Claude Code
https://claude.ai/code/session_01QKRNiek8qYRoRt7dcrDDVC