You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Adds an opt-in, versioned authorization contract for native and other external clients on the existing /api/ws JSON-RPC transport.
An authenticated client can request a single-use hermes.mobile ticket with explicit conversation scopes. The resulting server-derived grant is carried through upgrade, reported in the additive gateway.ready payload, and enforced by a fail-closed method and parameter policy before handlers run.
Bodyless dashboard ticket minting, internal credentials, loopback tokens, stdio dispatch, and the existing skin ready field remain compatible.
This is a draft for maintainer feedback on contract naming, versioning, and the intentionally narrow v1 boundary.
Extend POST /api/auth/ws-ticket with an opt-in mobile audience and validated explicit scopes while preserving the bodyless legacy response.
Carry the effective ticket grant through /api/ws and report server, protocol, contract, schema, capability, and authorization metadata in gateway.ready.
Enforce a minimum mobile method and parameter allowlist with structured missing or non-grantable scope errors.
Require read access in every mobile grant; require write plus control to create live sessions.
Prevent write-scoped busy submissions from interrupting, steering, or seizing another client in-flight transport.
Add public cookie login to ticket mint to real WebSocket upgrade to ready and denied-dispatch coverage.
Security Boundary
The mobile ticket is connection attenuation, not a persistent device credential or a replacement for the existing auth gate. It is accepted only on /api/ws, remains single-use with the existing TTL, and cannot authorize hidden parameters such as profile, cwd, seeded system history, model or provider overrides, transcript truncation, or future fields.
Replay cursors, mutation idempotency, and stable addressable approvals are intentionally not advertised by this slice.
Run git diff --check and scripts/check-windows-footguns.py --diff main.
Refreshed onto current official main f67aae3; head d8bc3bc.
Local result: 44 files, 975 tests passed, 0 failed on macOS 27.0. Ruff, diff check, and Windows-footgun scan pass. The full repository suite was not run locally and is left to CI.
Checklist
Code
Read CONTRIBUTING.md and AGENTS.md
Conventional commit messages
Searched open and merged issues and PRs for duplicates
Focused change with no unrelated dependency or config updates
Full pytest tests/ -q suite run locally
Added behavior and public-boundary tests
Tested on macOS 27.0
Documentation and Housekeeping
Relevant module and API docstrings updated; broader client docs deferred pending contract feedback
cli-config.yaml.example N/A
Contributor workflow docs N/A
Cross-platform impact considered and Windows-footgun scan passed
Tool descriptions and schemas N/A
Screenshots / Logs
No UI change. Focused hermetic result: 975 passed, 0 failed.
Thanks for the narrowly scoped gateway authorization work. The premise is present on current main: /api/ws authenticates and then calls handle_ws(ws) without an authorization grant (hermes_cli/web_server.py:15593-15603), while the dispatcher routes normalized requests directly to handlers (tui_gateway/server.py:1270-1285).
The proposed pre-dispatch, fail-closed mobile policy is at the correct transport boundary, preserves the legacy ticket path, and includes focused ticket, upgrade, dispatch, parameter-denial, and busy-transport coverage. I found no concrete blocking defect in static review.
Superseded by #72635, which reconstructs this scoped mobile WebSocket authorization contract on current main while preserving the original Eric Lewis commit authorship. The replacement integrates current process-isolation, busy-session, transport-ownership, MCP-startup, and desktop recovery behavior; adds current-path end-to-end mobile ticket/WebSocket/dispatch coverage; and has passed the full required GitHub CI matrix. The original branch remains read-only to the replacement PR author, so it cannot be safely refreshed in place.
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
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.
What does this PR do?
Adds an opt-in, versioned authorization contract for native and other external clients on the existing
/api/wsJSON-RPC transport.An authenticated client can request a single-use
hermes.mobileticket with explicit conversation scopes. The resulting server-derived grant is carried through upgrade, reported in the additivegateway.readypayload, and enforced by a fail-closed method and parameter policy before handlers run.Bodyless dashboard ticket minting, internal credentials, loopback tokens, stdio dispatch, and the existing
skinready field remain compatible.This is a draft for maintainer feedback on contract naming, versioning, and the intentionally narrow v1 boundary.
Related Issue
Fixes #62857
Type of Change
Changes Made
POST /api/auth/ws-ticketwith an opt-in mobile audience and validated explicit scopes while preserving the bodyless legacy response./api/wsand report server, protocol, contract, schema, capability, and authorization metadata ingateway.ready.Security Boundary
The mobile ticket is connection attenuation, not a persistent device credential or a replacement for the existing auth gate. It is accepted only on
/api/ws, remains single-use with the existing TTL, and cannot authorize hidden parameters such asprofile,cwd, seeded system history, model or provider overrides, transcript truncation, or future fields.Replay cursors, mutation idempotency, and stable addressable approvals are intentionally not advertised by this slice.
How to Test
scripts/run_tests.sh tests/tui_gateway tests/test_tui_gateway_loop_noise.py tests/test_tui_gateway_queue_on_busy.py tests/test_tui_gateway_server.py tests/test_tui_gateway_ws.py tests/hermes_cli/test_dashboard_auth_*.py -qgit diff --checkandscripts/check-windows-footguns.py --diff main.Refreshed onto current official main f67aae3; head d8bc3bc.
Local result: 44 files, 975 tests passed, 0 failed on macOS 27.0. Ruff, diff check, and Windows-footgun scan pass. The full repository suite was not run locally and is left to CI.
Checklist
Code
CONTRIBUTING.mdandAGENTS.mdpytest tests/ -qsuite run locallyDocumentation and Housekeeping
cli-config.yaml.exampleN/AScreenshots / Logs
No UI change. Focused hermetic result:
975 passed, 0 failed.