Skip to content

Add OAuth agent login and signed rotating API keys - #189

Merged
LIghtJUNction merged 3 commits into
mainfrom
feat/oauth-agent-login-20260930
Sep 30, 2026
Merged

LIghtJUNction merged 3 commits into
mainfrom
feat/oauth-agent-login-20260930

Conversation

@LIghtJUNction

@LIghtJUNction LIghtJUNction commented Sep 30, 2026 •

Copy link
Copy Markdown
Contributor

MSG currently requires repeated private-key proofs or custodial bootstrap tokens for agent access. This change adds persistent browser and CLI login while retaining existing identity ownership, permissions, recovery gates, and signature requirements.

  • Add public-client OAuth authorization code + PKCE S256, device authorization, rotating refresh tokens, revocation, discovery, and signed OIDC ID tokens/userinfo.
  • Add browser consent and HttpOnly sessions, and reuse the existing custodial-key signup/vault flow.
  • Add msg login, --no-browser, logout/status/approval commands, and origin-bound 0600 CLI credentials with serialized refresh.
  • Add private-key-signed API key creation, atomic rotation, expiry (maximum 24 hours), revocation, and existing lost-delivery recovery through identity.token_create@3.
  • Bind sessions and derived credentials to their original identity credential and authorization version; source revocation/recovery invalidates downstream access. Bearer requests still use the existing executor and sensitive operations still require signatures.
  • Include OAuth state in the strict complete-recovery schema and typed legacy identity-reference inventory. New regressions reject unaccounted OAuth state and active identity/capability references.
  • Add OAuth coverage to the dual-locale integration workflow and document activation, client registration, CLI use, and hosting-role migration in docs/OAUTH.md.
  • Provide English and Chinese READMEs focused on ChatGPT Dots and Grok Bot, including verified public-page curl and Exa access examples.

OAuth is disabled by default. Activation requires [oauth] enabled = true and explicitly registered browser callback clients. Existing hosting read roles need SELECT on the new oauth_states table. Cross-origin browser token exchange currently uses the application backend; CORS and external identity-provider login are outside this change.

Validation on head 6ef1908f14b4858b058b39412d8f3a00b998273e, tested merge commit 16fa35075daf3d0c56c02db2500b374942e38e49, tree 682820848f6b5b0b30c4917ccd51c198821505e8:

  • Full suite: 2,597 core tests across eight disjoint shards, plus eight conformance cases, all pass. All eight artifact ZIP digests, manifests and actual JUnit node IDs were independently checked: no failures, errors, skips, duplicates or omissions.
  • All 14 other applicable PR workflows pass, including Python quality, dual-locale regressions, migration/storage, and complete recovery.
  • Installed deployment rehearsal: startup/restart, locked server and client installs, real isolated OpenSSH/Git, all 42 official service self-tests and all 50 configuration-field vectors pass. Its wheel and sdist are byte-identical to the full-suite build.
  • Public homepage access was verified on 2026-09-30: direct HTTPS curl returned HTTP 200 and text/plain; Exa also retrieved the page.

Verified package SHA-256:

  • Wheel: cd14afc3ef4c6c1a25d6afd784d66f2aa8fed9cdfe2a860e75f9aeedfb31a21e
  • Sdist: ef635f95fb74e7080ae8ef6b6957c645d5f50a72bdc012b2240c30c106f05cc0

The tested merge includes main c8ed2610ab774dba3085972683c1d2c8a9232222. No production deployment is included.

Copy link
Copy Markdown
Contributor Author

已读取旧头95616ff8的云端失败:ledger JSON reference classification 缺 oauth_states,以及 recovery-state-schema 缺新表导致 recovery_schema_unsupported。新头6ef1908已补这两项和拒绝回归,继续等该头完整门槛。

本轮继续审查发现三个当前边界需要真实PG回归:require_source 只核源凭据撤销/期限/auth_version,未核同一源凭据当前 ceiling 收缩;OAuth HTTP 直接事务入口未核 runtime_config.accept_writes,可能在写暂停时继续签发/refresh;GET /oauth/userinfo 经过统一 rate() 会写 oauth_states,需证明读取无业务事实写入。准备独立窄分支补失败回归和复用现有 scope/constraints 规则的修复,不覆盖你正在推进的分支。最终合并按最新 head 和组合 tree 重验。

Copilot AI 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.

Copilot was unable to review this pull request because the user who requested the review has reached their quota limit.

@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Sep 30, 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
🔒 Security Review ✅ Completed 2026-09-30T10:05:09.987970Z 6ef1908 Draft marked ready
ℹ️ 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.

Copy link
Copy Markdown
Contributor Author

集成顺序补充:当前 ready head 仍为 6ef1908,尚未包含 #192。compare 显示 #192 的 c92135b 在此基础上领先 4 个提交;最终修复和验证记录见 #192 (comment) 。该头双 locale 各 120 项通过,完整 contracts 覆盖 2,590 个独立测试节点,包含托管登录与实际 API binding 数据形状的回归。

建议先将 #192 集成到本特性分支,再针对当前 main 重跑组合树检查后推进 #189。此 PR 现有全绿证据来自 merge 16fa350 / tree 68282084,父提交为 main c8ed261;当前 main 已到 487c9d8(#190)。因此现有检查未覆盖 #192 修复与当前 main 的最终组合。这里不重复实现或合并代码。

@LIghtJUNction
LIghtJUNction merged commit 9f4806d into main Sep 30, 2026
25 of 26 checks passed
@LIghtJUNction
LIghtJUNction deleted the feat/oauth-agent-login-20260930 branch September 30, 2026 10:07
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.

2 participants