Skip to content

fix(rest): gate SOX tree and file reads behind the editor gate (R-55, S-33) - #31

Merged
TurkerMertkan merged 1 commit into
developfrom
s33-read-gate
Nov 21, 2026
Merged

TurkerMertkan merged 1 commit into
developfrom
s33-read-gate

Conversation

@TurkerMertkan

Copy link
Copy Markdown
Collaborator

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).

  • Auth off (field default): unchanged.
  • Auth on: the editor (S-32b, sedonaWebEditor trkrDevelop) fetches /file/* same-origin with its cookie; verified locally.
  • Known gap (R-56): the editor's kit upload (PUT /file/*) sends only the cookie and gets 401 with auth on.

Tests: auth_layer.rs; gates 2890 passed / 0 failed.

🤖 Generated with Claude Code

https://claude.ai/code/session_01QKRNiek8qYRoRt7dcrDDVC

… 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
@TurkerMertkan
TurkerMertkan merged commit b4953aa into develop Nov 21, 2026
2 checks passed
@TurkerMertkan
TurkerMertkan deleted the s33-read-gate branch November 21, 2026 12:16
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant