惯性聚合 高效追踪和阅读你感兴趣的博客、新闻、科技资讯
阅读原文 在惯性聚合中打开

推荐订阅源

M
MIT News - Artificial intelligence
罗磊的独立博客
Hugging Face - Blog
Hugging Face - Blog
J
Java Code Geeks
G
Google Developers Blog
美团技术团队
让小产品的独立变现更简单 - ezindie.com
让小产品的独立变现更简单 - ezindie.com
腾讯CDC
奇客Solidot–传递最新科技情报
奇客Solidot–传递最新科技情报
T
The Blog of Author Tim Ferriss
月光博客
月光博客
B
Blog
WordPress大学
WordPress大学
云风的 BLOG
云风的 BLOG
博客园_首页
人人都是产品经理
人人都是产品经理
aimingoo的专栏
aimingoo的专栏
Y
Y Combinator Blog
Jina AI
Jina AI
S
SegmentFault 最新的问题
H
Help Net Security
博客园 - 聂微东
Microsoft Azure Blog
Microsoft Azure Blog
Google DeepMind News
Google DeepMind News

Recent Commits to openclaw:main

test: merge chat side-result checks · openclaw/openclaw@ddd2c2a test: merge cron history checks · openclaw/openclaw@f7eb746 test: merge responsive navigation shell checks · openclaw/openclaw@c2e4b47 docs(changelog): add codex oauth fixes · openclaw/openclaw@628e6cd test: merge navigation routing cases · openclaw/openclaw@5d8cecb Tests: mock channel registry bundled fallback · openclaw/openclaw@2b08233 Secrets: avoid broad web search discovery for single plugin config · openclaw/openclaw@a464f59 test: merge config view browser checks · openclaw/openclaw@20cf511 fix(status): align oauth health with runtime · openclaw/openclaw@eed7116 feat: add macOS screen snapshots for monitor preview (#67954) thanks … · openclaw/openclaw@f377db1 fix: report shared auth scopes in hello-ok (#67810) thanks @BunsDev · openclaw/openclaw@0b6c39b Auto-reply: avoid eager bundled route fallback · openclaw/openclaw@3ea1bf4 Tests: narrow session binding contract setup · openclaw/openclaw@54e4e16 fix(macOS): enable undo/redo in webchat composer text input (#34962) · openclaw/openclaw@00951dc Tests: speed up channel setup promotion · openclaw/openclaw@82b529a Docs: refresh agent instructions · openclaw/openclaw@5775fe2 fix(auth): serialize OAuth refresh across agents to fix #26322 (#67876) · openclaw/openclaw@8e79080 test: allow ollama public surface boundary test · openclaw/openclaw@7d4f1a6 Docs: add test performance guardrails · openclaw/openclaw@89706d3 Tests: restore context-engine usage proof · openclaw/openclaw@e4c4f95 Tests: slim context engine runtime coverage · openclaw/openclaw@74c198f ci: retry failed custom checkouts · openclaw/openclaw@0ee5baf test: trim duplicate provider auth onboarding cases · openclaw/openclaw@1ffc02e matrix: fix sessions_spawn --thread subagent session spawning (#67643) · openclaw/openclaw@1ce2596 test: reduce auth choice fixture churn · openclaw/openclaw@857b9cd test: mock health status config boundaries · openclaw/openclaw@9d5ab4a test: mock onboard config io boundary · openclaw/openclaw@299694d test: mock legacy state plugin boundaries · openclaw/openclaw@2713089 test: mock channel install boundaries · openclaw/openclaw@b945248 test: mock doctor preview channel boundaries · openclaw/openclaw@b1a3ad4
perf: trim control ui auth tests · openclaw/openclaw@e94c0bf
steipete · 2026-04-24 · via Recent Commits to openclaw:main

@@ -3,7 +3,6 @@ import path from "node:path";

33

import { expect, test, vi } from "vitest";

44

import { WebSocket } from "ws";

55

import {

6-

approvePendingPairingIfNeeded,

76

BACKEND_GATEWAY_CLIENT,

87

connectReq,

98

configureTrustedProxyControlUiAuth,

@@ -136,14 +135,6 @@ export function registerControlUiAndPairingSuite(): void {

136135

};

137136

};

138137139-

const startServerWithOperatorIdentity = async (identityPrefix = "openclaw-device-scope-") => {

140-

const { server, ws, port, prevToken } = await startServerWithClient("secret", {

141-

controlUiEnabled: true,

142-

});

143-

const { identityPath, identity, client } = await createOperatorIdentityFixture(identityPrefix);

144-

return { server, ws, port, prevToken, identityPath, identity, client };

145-

};

146-147138

const startControlUiServerWithOperatorIdentity = async (

148139

identityPrefix = "openclaw-device-scope-",

149140

) => {

@@ -219,17 +210,19 @@ export function registerControlUiAndPairingSuite(): void {

219210

clientMode: string;

220211

displayName: string;

221212

platform: string;

213+

scopes?: string[];

222214

}): Promise<{ identityPath: string; identity: { deviceId: string } }> => {

223215

const { publicKeyRawBase64UrlFromPem } = await import("../infra/device-identity.js");

224216

const { approveDevicePairing, requestDevicePairing } =

225217

await import("../infra/device-pairing.js");

226218

const { identityPath, identity } = await createOperatorIdentityFixture(params.identityPrefix);

219+

const scopes = params.scopes ?? ["operator.read"];

227220

const devicePublicKey = publicKeyRawBase64UrlFromPem(identity.publicKeyPem);

228221

const seeded = await requestDevicePairing({

229222

deviceId: identity.deviceId,

230223

publicKey: devicePublicKey,

231224

role: "operator",

232-

scopes: ["operator.read"],

225+

scopes,

233226

clientId: params.clientId,

234227

clientMode: params.clientMode,

235228

displayName: params.displayName,

@@ -491,9 +484,6 @@ export function registerControlUiAndPairingSuite(): void {

491484492485

const scopedHealth = await rpcReq(scopedWs, "health");

493486

expect(scopedHealth.ok).toBe(true);

494-495-

const talk = await rpcReq(scopedWs, "chat.history", { sessionKey: "main", limit: 1 });

496-

expect(talk.ok).toBe(true);

497487

scopedWs.close();

498488

});

499489

} finally {

@@ -1269,36 +1259,26 @@ export function registerControlUiAndPairingSuite(): void {

1269125912701260

test("allows operator.read connect when device is paired with operator.admin", async () => {

12711261

const { listDevicePairing } = await import("../infra/device-pairing.js");

1272-

const { server, ws, port, prevToken, identityPath, identity, client } =

1273-

await startServerWithOperatorIdentity();

1274-1275-

const initialNonce = await readConnectChallengeNonce(ws);

1276-

const initial = await connectReq(ws, {

1277-

token: "secret",

1262+

const { identityPath, identity } = await seedApprovedOperatorReadPairing({

1263+

identityPrefix: "openclaw-device-admin-superset-",

1264+

clientId: TEST_OPERATOR_CLIENT.id,

1265+

clientMode: TEST_OPERATOR_CLIENT.mode,

1266+

displayName: "operator-admin-superset",

1267+

platform: TEST_OPERATOR_CLIENT.platform,

12781268

scopes: ["operator.admin"],

1279-

client,

1280-

device: await buildSignedDeviceForIdentity({

1281-

identityPath,

1282-

client,

1283-

scopes: ["operator.admin"],

1284-

nonce: initialNonce,

1285-

}),

12861269

});

1287-

if (!initial.ok) {

1288-

await approvePendingPairingIfNeeded();

1289-

}

129012701291-

ws.close();

1271+

const { server, port, prevToken } = await startControlUiServer("secret");

1292127212931273

const ws2 = await openWs(port);

12941274

const nonce2 = await readConnectChallengeNonce(ws2);

12951275

const res = await connectReq(ws2, {

12961276

token: "secret",

12971277

scopes: ["operator.read"],

1298-

client,

1278+

client: TEST_OPERATOR_CLIENT,

12991279

device: await buildSignedDeviceForIdentity({

13001280

identityPath,

1301-

client,

1281+

client: TEST_OPERATOR_CLIENT,

13021282

scopes: ["operator.read"],

13031283

nonce: nonce2,

13041284

}),

@@ -1562,38 +1542,6 @@ export function registerControlUiAndPairingSuite(): void {

15621542

}

15631543

});

156415441565-

test("allows gateway backend clients on loopback even with a remote-looking host header", async () => {

1566-

const { server, port, prevToken } = await startControlUiServer("secret");

1567-

const wsRemoteLike = await openWs(port, { host: "gateway.example" });

1568-

try {

1569-

const remoteLikeBackend = await connectReq(wsRemoteLike, {

1570-

token: "secret",

1571-

client: BACKEND_GATEWAY_CLIENT,

1572-

});

1573-

expect(remoteLikeBackend.ok).toBe(true);

1574-

} finally {

1575-

wsRemoteLike.close();

1576-

await server.close();

1577-

restoreGatewayToken(prevToken);

1578-

}

1579-

});

1580-1581-

test("allows gateway backend clients on loopback with a private host header", async () => {

1582-

const { server, port, prevToken } = await startControlUiServer("secret");

1583-

const wsPrivateHost = await openWs(port, { host: "172.17.0.2:18789" });

1584-

try {

1585-

const remoteLikeBackend = await connectReq(wsPrivateHost, {

1586-

token: "secret",

1587-

client: BACKEND_GATEWAY_CLIENT,

1588-

});

1589-

expect(remoteLikeBackend.ok).toBe(true);

1590-

} finally {

1591-

wsPrivateHost.close();

1592-

await server.close();

1593-

restoreGatewayToken(prevToken);

1594-

}

1595-

});

1596-15971545

test("allows CLI clients on loopback even when the host header is not private-or-loopback", async () => {

15981546

const { server, port, prevToken } = await startControlUiServer("secret");

15991547

const wsRemoteLike = await openWs(port, { host: "gateway.example" });