fix(gateway): honor scopes for WebChat session mutations#110931
Conversation
|
Codex review: needs real behavior proof before merge. Reviewed July 18, 2026, 3:45 PM ET / 19:45 UTC. Summary PR surface: Source -75, Tests +42, Docs +5. Total -28 across 10 files. Reproducibility: yes. from source, but not through an independently run live session: current main’s shared helper rejects qualifying WebChat clients before handlers execute, while the proposed test exercises the scope-policy outcomes. Review metrics: 1 noteworthy metric.
Stored data model Merge readiness Overall follows the weaker of proof and patch quality, so missing proof can cap an otherwise strong patch. Rank-up moves:
Proof guidance:
Risk before merge
Maintainer options:
Next step before merge
Maintainer decision needed
Security Review detailsBest possible solution: Adopt the centralized negotiated-scope contract only after a security owner confirms it is the intended WebChat boundary and a redacted live WebSocket/WebChat proof demonstrates both denied low-scope and permitted approved-scope mutations. Do we have a high-confidence way to reproduce the issue? Yes from source, but not through an independently run live session: current main’s shared helper rejects qualifying WebChat clients before handlers execute, while the proposed test exercises the scope-policy outcomes. Is this the best way to solve the issue? Yes, conditionally: using one centralized scope policy avoids a competing client-reported identity ACL, provided the security owner confirms that no affected method lacks the required scope or dynamic check. AGENTS.md: found and applied where relevant. Codex review notes: model internal, reasoning high; reviewed against bf2da1ce1af7. Label changesLabel changes:
Label justifications:
Evidence reviewedPR surface: Source -75, Tests +42, Docs +5. Total -28 across 10 files. View PR surface stats
Security concerns:
What I checked:
Likely related people:
What the crustacean ranks mean
Shiny media proof means a screenshot, video, or linked artifact directly shows the changed behavior. Runtime, network, CSP, and security claims still need visible diagnostics. How this review workflow works
|
|
Merged via squash.
|
…0931) * fix(gateway): authorize webchat session mutations by scope * chore: keep gateway release note in PR body
Closes #110930
What Problem This Solves
Fixes an issue where custom WebChat clients with approved operator scopes could
not patch, delete, compact, branch, restore, rewind, fork, switch, dispatch, or
reclaim sessions. The blanket WebChat restriction made client identity act as a
second authorization layer and encouraged clients to impersonate Control UI.
Why This Change Was Made
Session mutations now use the existing centralized method-scope policy,
including parameter-aware patch and delete checks. Client ID and mode no longer
grant or remove mutation authority. Connection admission, device pairing, scope
approval, and
gateway.controlUi.dangerouslyDisableDeviceAuthare unchanged.User Impact
Approved third-party WebChat clients can manage sessions with their negotiated
operator scopes. Lower-scope clients receive the same structured missing-scope
errors as other Gateway clients.
Evidence
6e20935154a76cd43f433f42df1a7a19006125b6:server.sessions.permissions-hooksplusmethod-scopes, 132/132 tests passed.pnpm check:changed: core and core-test typechecks, changedformatting, core lint, import-cycle checks, plugin boundaries, and security
guards passed.
every formerly identity-blocked mutation, unchanged session state after
rejection, and successful persisted branch/delete mutations for an
admin-scoped WebChat client.