Repository navigation
Conversation
…(uncommitted 2026-10-18)
…authorization over paired-dashboard gate
Contributor
|
Important Draft PR not reviewedDraft PRs are not automatically reviewed by default.
To automatically review draft PRs, update your CodeRabbit configuration: reviews:
auto_review:
drafts: true
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. |
Contributor
|
✅ Deterministic PR hygiene checks passed. |
Contributor
⏳ DRAFT
What to do
This pull request was already a draft. Its draft status will be preserved after every issue above is resolved. |
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.
Summary
GUI-side desktop pairing local step-up authorization for the desktop-compatibility panel, upstreaming uncommitted work preserved from the 2026-10-18 session worktree. Follow-up to #7775 (server-side paired authority).
Instead of treating any operator-paired dashboard session as sufficient for Desktop mutations, a local dashboard session must now consume a Desktop-purpose one-use grant minted by
ocx gui pair --desktop --origin <dashboard-origin>. The grant is purpose-bound, origin-bound, single-use, and expires after at most five minutes; ordinary or remote pairing codes cannot supply the Desktop scope.What this adds
src/lib/desktop-gui-origin.ts— standalone loopback dashboard origin check (localhost/literal origin + exact configured/listening port, forwarding-header refusal).src/server/gui-desktop-authorization.ts+src/server/management/desktop-authorization.ts—GET/POST /api/codex/desktop-compatibility/authorizationscope endpoint and therequireDesktopAuthorizationgate (desktop_authorization_required), plus session-boundcanMutateLocalDesktop/authorizeLocalDesktopcontrol.gui/src/pages/desktop-compatibility-authorization.tsx— grant-code authorization card in the compatibility panel; authorization state polls/authorizationevery 5 s, resets consent on transitions, and never replays a prior action.fetchDesktopSession— dedicated session fetch for sensitive Desktop operations: no renewal, no admin fallback, no POST replay; cross-target requests reject asdesktop_target_changed. Routed on the machine plane to match theclassify()mapping dev assigns to/api/codex/desktop-compatibility/.Merge note
dev had meanwhile introduced a simpler gate (
paired local dashboard+local_dashboard_confirmation_required). This PR intentionally keeps the preserved work's stronger step-up model and swaps that gate out; the dev-side helpermanagement/desktop-compatibility-authorization.tswas removed after its last reference disappeared. Dev's newer panel layout (acc-desktop,InlineBanner, session-expiry handling) is kept and the authorization card is wired into it.Validation
bun x tsc --noEmit(root) andtsc -b(gui): clean.management-desktop-compatibility-{routes,runtime-routes,settings}— 22/22 pass, including Desktop grant purpose/origin binding, scope revocation on role/listener change and logout, and expiry semantics.desktop-compatibility-panel,desktop-compatibility-api,api-auth-memory— 52/52 pass.gui-pair-{capability,client,delivery,http}andcli-management-auth: pass.tests/server/server-management-auth.test.ts: 31 failures identical on unmodified dev —SPEND_LEDGER_OWNER_HOME_CONFLICTbecause a live ocx service holds the ledger in this environment; unrelated to this change.Provenance
The preserved work was committed as
codex/desktop-gui-stepup-20261018(34 files, +622/−52) from the dirty tree ofdesktop-local-stepup-20261018(detached base8640c2f30), then merged onto current dev (9e863b1816) with conflicts resolved toward the step-up model.