Skip to content

[WRONG BRANCH] fix(oauth): require dashboard consent for Meta Muse Keychain import - #474

Draft
luvs01 wants to merge 1 commit into
mainfrom
codex/propose-fix-for-oauth-consent-bypass
Draft

[WRONG BRANCH] fix(oauth): require dashboard consent for Meta Muse Keychain import#474
luvs01 wants to merge 1 commit into
mainfrom
codex/propose-fix-for-oauth-consent-bypass

Conversation

@luvs01

@luvs01 luvs01 commented Sep 9, 2026

Copy link
Copy Markdown
Owner

Motivation

  • Prevent a consent bypass where the management POST /api/oauth/login endpoint could import a Muse CLI API key from the macOS Keychain without a GUI consent acknowledgement.

Description

  • Add a server-side gate in handleOauthAccountRoutes that rejects meta-muse login attempts unless the request principal is the dashboard gui-session, returning 403 with code: "oauth_consent_required" when not satisfied. 【F:src/server/management/oauth-account-routes.ts†L150-L164】
  • Thread principal into the management OAuth handler so the route can distinguish consent-bearing GUI sessions from admin-token or other non-consent principals. 【F:src/server/management/oauth-account-routes.ts†L129-L131】
  • Add a route-level regression test that asserts non-consent principals (including admin-token and gui-pair-capability) are rejected and that a gui-session principal continues into the existing flow. 【F:tests/oauth/oauth-public-surface.test.ts†L87-L114】

Testing

  • ✅ Ran the focused OAuth tests with bun run test -- tests/oauth/oauth-public-surface.test.ts, and the suite passed including the new assertion. 【F:tests/oauth/oauth-public-surface.test.ts†L87-L114】
  • ✅ Ran type checking with bun run typecheck, which completed successfully.
  • ✅ Ran the privacy scan with bun run privacy:scan, which passed.
  • ⚠️ Ran the full bun run test; the environment/contention run produced many unrelated failures in the full suite, but the focused OAuth regression passed independently.

Codex Task

@coderabbitai

coderabbitai Bot commented Sep 9, 2026

Copy link
Copy Markdown

Important

  • 🔍 Trigger review

This repository does not receive automatic reviews because it has fewer than 10 stars.

⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: ASSERTIVE

Plan: Advanced

Run ID: 26120908-c543-4aa7-986f-cbbb43b5cf06


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.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Sep 9, 2026

Copy link
Copy Markdown

Codex Review Summary

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review Completed 2026-09-09T04:26:10.273710Z 58c5412 PR opened
ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

@github-actions github-actions Bot added the bug Something isn't working label Sep 9, 2026
@github-actions

github-actions Bot commented Sep 9, 2026

Copy link
Copy Markdown

Deterministic PR hygiene checks passed.

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 58c5412fd0

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

// access, not that a person acknowledged that credential move and its ToS
// risk. The dashboard warning therefore needs this matching server-side gate;
// headers are not evidence because an admin-token holder can forge them.
if (provider === "meta-muse" && principal !== "gui-session") {

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Badge Preserve the advertised Meta Muse CLI login path

When an operator runs ocx login meta-muse or ocx account login meta-muse, src/cli/account-auth.ts posts to this endpoint using the admin token, so this condition now always returns 403 before the existing CLI consent warning, Keychain import, or manual-key prompt can run. This also contradicts src/oauth/meta-muse.ts, which explicitly directs users without another paste surface to run that command, and makes headless Meta Muse setup impossible. Either add a consent mechanism that the CLI can satisfy or remove/update the CLI fallback and its user-facing documentation and regression coverage.

AGENTS.md reference: AGENTS.md:L367-L372

Useful? React with 👍 / 👎.

@github-actions github-actions Bot changed the title fix(oauth): require dashboard consent for Meta Muse Keychain import [WRONG BRANCH] fix(oauth): require dashboard consent for Meta Muse Keychain import Sep 9, 2026
@github-actions

github-actions Bot commented Sep 9, 2026

Copy link
Copy Markdown

⏳ DRAFT

  • wrong target branch (main); retarget to dev.

What to do

  • Retarget this PR to dev — all contributions go to dev.

Its title has been prefixed with [WRONG BRANCH].
This pull request was already a draft. Its draft status will be preserved after every issue above is resolved.

@github-actions
github-actions Bot marked this pull request as draft September 9, 2026 04:26
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

aardvark bug Something isn't working codex

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant