feat(admin-http-rpc): allow web QR login methods (#83259) · openclaw/openclaw@81f20d8
liorb-mounta
·
2026-05-18
·
via Recent Commits to openclaw:main
File tree
extensions/admin-http-rpc/src
test/fixtures/agents/prompt-snapshots/codex-runtime-happy-path
| Original file line number | Diff line number | Diff line change |
|---|
@@ -12,6 +12,7 @@ Docs: https://docs.openclaw.ai
|
12 | 12 | - Docker/Podman: add `OPENCLAW_IMAGE_APT_PACKAGES` as the runtime-neutral image build arg for extra apt packages while keeping `OPENCLAW_DOCKER_APT_PACKAGES` as a legacy fallback. (#62431) Thanks @urtabajev. |
13 | 13 | - Gateway/ACPX: attribute startup probe, config, runtime, and resource-count costs in restart traces without changing readiness behavior. (#83300) Thanks @samzong. |
14 | 14 | - Gateway: overlap startup logging and plugin-service startup with channel sidecars to reduce restart ready latency while preserving `/readyz` sidecar gating. (#83301) Thanks @samzong. |
| 15 | +- Plugins/admin-http-rpc: allow trusted admin HTTP RPC clients to start and wait for web QR login flows. (#83259) Thanks @liorb-mountapps. |
15 | 16 | - Mac app: redesign Settings pages with consistent card layouts, cached navigation, cleaner permissions/voice/skills/cron/exec/debug panes, and steadier spacing around the native sidebar. |
16 | 17 | - Skills: rename the repo-local Codex closeout review skill and helper to `autoreview` while preserving the Codex-first fallback behavior. |
17 | 18 | - Skills: add a meme-maker skill for curated template search, local SVG/PNG rendering, Imgflip hosted rendering, and Know Your Meme provenance links. |
|
| Original file line number | Diff line number | Diff line change |
|---|
@@ -171,6 +171,7 @@ HTTP status follows the Gateway error when possible. For example, `INVALID_REQUE
|
171 | 171 | - gateway: `health`, `status`, `logs.tail`, `usage.status`, `usage.cost`, `gateway.restart.request` |
172 | 172 | - config: `config.get`, `config.schema`, `config.schema.lookup`, `config.set`, `config.patch`, `config.apply` |
173 | 173 | - channels: `channels.status`, `channels.start`, `channels.stop`, `channels.logout` |
| 174 | +- web: `web.login.start`, `web.login.wait` |
174 | 175 | - models: `models.list`, `models.authStatus` |
175 | 176 | - agents: `agents.list`, `agents.create`, `agents.update`, `agents.delete` |
176 | 177 | - approvals: `exec.approvals.get`, `exec.approvals.set`, `exec.approvals.node.get`, `exec.approvals.node.set` |
|
| Original file line number | Diff line number | Diff line change |
|---|
@@ -105,6 +105,33 @@ describe("admin-http-rpc plugin handler", () => {
|
105 | 105 | }); |
106 | 106 | }); |
107 | 107 | |
| 108 | +it.each([ |
| 109 | +["web.login.start", { force: true, timeoutMs: 1000 }], |
| 110 | +["web.login.wait", { timeoutMs: 1000 }], |
| 111 | +] as const)( |
| 112 | +"allows web QR login method %s through the authenticated plugin request scope", |
| 113 | +async (method, params) => { |
| 114 | +dispatchGatewayMethod.mockResolvedValueOnce({ |
| 115 | +ok: true, |
| 116 | +payload: { status: "ok" }, |
| 117 | +}); |
| 118 | + |
| 119 | +const result = await invoke({ |
| 120 | +id: "web-login", |
| 121 | + method, |
| 122 | + params, |
| 123 | +}); |
| 124 | + |
| 125 | +expect(dispatchGatewayMethod).toHaveBeenCalledWith(method, params); |
| 126 | +expect(result.captured.statusCode).toBe(200); |
| 127 | +expect(result.json).toEqual({ |
| 128 | +id: "web-login", |
| 129 | +ok: true, |
| 130 | +payload: { status: "ok" }, |
| 131 | +}); |
| 132 | +}, |
| 133 | +); |
| 134 | + |
108 | 135 | it("rejects methods outside the admin HTTP RPC allowlist", async () => { |
109 | 136 | const result = await invoke({ id: "bad", method: "sessions.send" }); |
110 | 137 | |
|
| Original file line number | Diff line number | Diff line change |
|---|
@@ -17,6 +17,7 @@ const ADMIN_HTTP_RPC_ALLOWED_METHOD_GROUPS = {
|
17 | 17 | "config.apply", |
18 | 18 | ], |
19 | 19 | channels: ["channels.status", "channels.start", "channels.stop", "channels.logout"], |
| 20 | +web: ["web.login.start", "web.login.wait"], |
20 | 21 | models: ["models.list", "models.authStatus"], |
21 | 22 | agents: ["agents.list", "agents.create", "agents.update", "agents.delete"], |
22 | 23 | approvals: [ |
|
| Original file line number | Diff line number | Diff line change |
|---|
@@ -77,7 +77,7 @@
|
77 | 77 | "approvalsReviewer": "user", |
78 | 78 | "config": { |
79 | 79 | "features.code_mode": true, |
80 | | -"features.code_mode_only": true, |
| 80 | +"features.code_mode_only": false, |
81 | 81 | "instructions": "OpenClaw loaded these user-editable workspace files. Treat them as project/user context. Codex loads AGENTS.md natively, so AGENTS.md is not repeated here.\n\n# Project Context\n\nThe following project context files have been loaded:\nSOUL.md: persona/tone. Follow it unless higher-priority instructions override.\n\n## /tmp/openclaw-happy-path/workspace/SOUL.md\n\n<SOUL.md contents will be here>\n\n## /tmp/openclaw-happy-path/workspace/TOOLS.md\n\n<TOOLS.md contents will be here>\n\n## /tmp/openclaw-happy-path/workspace/HEARTBEAT.md\n\n<HEARTBEAT.md contents will be here>" |
82 | 82 | }, |
83 | 83 | "cwd": "/tmp/openclaw-happy-path/workspace", |
|
115 | 115 | "approvalsReviewer": "user", |
116 | 116 | "config": { |
117 | 117 | "features.code_mode": true, |
118 | | -"features.code_mode_only": true, |
| 118 | +"features.code_mode_only": false, |
119 | 119 | "instructions": "OpenClaw loaded these user-editable workspace files. Treat them as project/user context. Codex loads AGENTS.md natively, so AGENTS.md is not repeated here.\n\n# Project Context\n\nThe following project context files have been loaded:\nSOUL.md: persona/tone. Follow it unless higher-priority instructions override.\n\n## /tmp/openclaw-happy-path/workspace/SOUL.md\n\n<SOUL.md contents will be here>\n\n## /tmp/openclaw-happy-path/workspace/TOOLS.md\n\n<TOOLS.md contents will be here>\n\n## /tmp/openclaw-happy-path/workspace/HEARTBEAT.md\n\n<HEARTBEAT.md contents will be here>" |
120 | 120 | }, |
121 | 121 | "developerInstructions": "<see Reconstructed Model-Bound Prompt Layers>", |
|
| Original file line number | Diff line number | Diff line change |
|---|
@@ -77,7 +77,7 @@
|
77 | 77 | "approvalsReviewer": "user", |
78 | 78 | "config": { |
79 | 79 | "features.code_mode": true, |
80 | | -"features.code_mode_only": true, |
| 80 | +"features.code_mode_only": false, |
81 | 81 | "instructions": "OpenClaw loaded these user-editable workspace files. Treat them as project/user context. Codex loads AGENTS.md natively, so AGENTS.md is not repeated here.\n\n# Project Context\n\nThe following project context files have been loaded:\nSOUL.md: persona/tone. Follow it unless higher-priority instructions override.\n\n## /tmp/openclaw-happy-path/workspace/SOUL.md\n\n<SOUL.md contents will be here>\n\n## /tmp/openclaw-happy-path/workspace/TOOLS.md\n\n<TOOLS.md contents will be here>\n\n## /tmp/openclaw-happy-path/workspace/HEARTBEAT.md\n\n<HEARTBEAT.md contents will be here>" |
82 | 82 | }, |
83 | 83 | "cwd": "/tmp/openclaw-happy-path/workspace", |
|
115 | 115 | "approvalsReviewer": "user", |
116 | 116 | "config": { |
117 | 117 | "features.code_mode": true, |
118 | | -"features.code_mode_only": true, |
| 118 | +"features.code_mode_only": false, |
119 | 119 | "instructions": "OpenClaw loaded these user-editable workspace files. Treat them as project/user context. Codex loads AGENTS.md natively, so AGENTS.md is not repeated here.\n\n# Project Context\n\nThe following project context files have been loaded:\nSOUL.md: persona/tone. Follow it unless higher-priority instructions override.\n\n## /tmp/openclaw-happy-path/workspace/SOUL.md\n\n<SOUL.md contents will be here>\n\n## /tmp/openclaw-happy-path/workspace/TOOLS.md\n\n<TOOLS.md contents will be here>\n\n## /tmp/openclaw-happy-path/workspace/HEARTBEAT.md\n\n<HEARTBEAT.md contents will be here>" |
120 | 120 | }, |
121 | 121 | "developerInstructions": "<see Reconstructed Model-Bound Prompt Layers>", |
|
| Original file line number | Diff line number | Diff line change |
|---|
@@ -77,7 +77,7 @@
|
77 | 77 | "approvalsReviewer": "user", |
78 | 78 | "config": { |
79 | 79 | "features.code_mode": true, |
80 | | -"features.code_mode_only": true, |
| 80 | +"features.code_mode_only": false, |
81 | 81 | "instructions": "OpenClaw loaded these user-editable workspace files. Treat them as project/user context. Codex loads AGENTS.md natively, so AGENTS.md is not repeated here.\n\n# Project Context\n\nThe following project context files have been loaded:\nSOUL.md: persona/tone. Follow it unless higher-priority instructions override.\n\n## /tmp/openclaw-happy-path/workspace/SOUL.md\n\n<SOUL.md contents will be here>\n\n## /tmp/openclaw-happy-path/workspace/TOOLS.md\n\n<TOOLS.md contents will be here>\n\n## /tmp/openclaw-happy-path/workspace/HEARTBEAT.md\n\n<HEARTBEAT.md contents will be here>" |
82 | 82 | }, |
83 | 83 | "cwd": "/tmp/openclaw-happy-path/workspace", |
|
116 | 116 | "approvalsReviewer": "user", |
117 | 117 | "config": { |
118 | 118 | "features.code_mode": true, |
119 | | -"features.code_mode_only": true, |
| 119 | +"features.code_mode_only": false, |
120 | 120 | "instructions": "OpenClaw loaded these user-editable workspace files. Treat them as project/user context. Codex loads AGENTS.md natively, so AGENTS.md is not repeated here.\n\n# Project Context\n\nThe following project context files have been loaded:\nSOUL.md: persona/tone. Follow it unless higher-priority instructions override.\n\n## /tmp/openclaw-happy-path/workspace/SOUL.md\n\n<SOUL.md contents will be here>\n\n## /tmp/openclaw-happy-path/workspace/TOOLS.md\n\n<TOOLS.md contents will be here>\n\n## /tmp/openclaw-happy-path/workspace/HEARTBEAT.md\n\n<HEARTBEAT.md contents will be here>" |
121 | 121 | }, |
122 | 122 | "developerInstructions": "<see Reconstructed Model-Bound Prompt Layers>", |
|
此内容由惯性聚合(RSS阅读器)自动聚合整理,仅供阅读参考。 原文来自 — 版权归原作者所有。