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

推荐订阅源

小众软件
小众软件
C
Check Point Blog
Vercel News
Vercel News
Y
Y Combinator Blog
G
Google Developers Blog
P
Proofpoint News Feed
WordPress大学
WordPress大学
MongoDB | Blog
MongoDB | Blog
博客园 - 司徒正美
Last Week in AI
Last Week in AI
博客园 - 【当耐特】
N
Netflix TechBlog - Medium
L
LangChain Blog
V
V2EX
钛媒体:引领未来商业与生活新知
钛媒体:引领未来商业与生活新知
Cyber Security Advisories - MS-ISAC
Cyber Security Advisories - MS-ISAC
大猫的无限游戏
大猫的无限游戏
D
DataBreaches.Net
博客园_首页
B
Blog RSS Feed
The Cloudflare Blog
MyScale Blog
MyScale Blog
freeCodeCamp Programming Tutorials: Python, JavaScript, Git & More
Microsoft Security Blog
Microsoft Security Blog

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
test: tighten external cli auth assertions · openclaw/ope...
steipete · 2026-05-10 · via Recent Commits to openclaw:main

@@ -43,6 +43,36 @@ function makeStore(profileId?: string, credential?: OAuthCredential): AuthProfil

4343

};

4444

}

454546+

function expectSingleProfileCredential(

47+

profiles: ReturnType<typeof resolveExternalCliAuthProfiles>,

48+

profileId: string,

49+

) {

50+

expect(profiles).toHaveLength(1);

51+

expect(profiles[0]?.profileId).toBe(profileId);

52+

expect(profiles[0]?.credential).toBeTruthy();

53+

return profiles[0]?.credential as Record<string, unknown>;

54+

}

55+56+

function expectCredentialFields(

57+

credential: Record<string, unknown> | undefined,

58+

expected: Record<string, unknown>,

59+

) {

60+

expect(credential).toBeTruthy();

61+

for (const [key, value] of Object.entries(expected)) {

62+

expect(credential?.[key]).toBe(value);

63+

}

64+

}

65+66+

function expectReaderPolicyCall(mock: { mock: { calls: unknown[][] } }) {

67+

expect(mock.mock.calls).toHaveLength(1);

68+

const [arg] = mock.mock.calls[0] ?? [];

69+

expect(arg).toBeTruthy();

70+

if (!arg || typeof arg !== "object") {

71+

throw new Error("Expected CLI reader options");

72+

}

73+

expect((arg as { allowKeychainPrompt?: unknown }).allowKeychainPrompt).toBe(false);

74+

}

75+4676

describe("external cli oauth resolution", () => {

4777

beforeEach(async () => {

4878

vi.resetModules();

@@ -258,17 +288,15 @@ describe("external cli oauth resolution", () => {

258288

providerIds: ["openai-codex"],

259289

});

260290261-

expect(profiles).toEqual([

291+

expectCredentialFields(

292+

expectSingleProfileCredential(profiles, OPENAI_CODEX_DEFAULT_PROFILE_ID),

262293

{

263-

profileId: OPENAI_CODEX_DEFAULT_PROFILE_ID,

264-

credential: expect.objectContaining({

265-

provider: "openai-codex",

266-

access: "codex-cli-access",

267-

refresh: "codex-cli-refresh",

268-

accountId: "acct-codex",

269-

}),

294+

provider: "openai-codex",

295+

access: "codex-cli-access",

296+

refresh: "codex-cli-refresh",

297+

accountId: "acct-codex",

270298

},

271-

]);

299+

);

272300

});

273301274302

it("keeps any existing default codex oauth over Codex CLI bootstrap credentials", () => {

@@ -324,17 +352,12 @@ describe("external cli oauth resolution", () => {

324352

providerIds: ["claude-cli"],

325353

});

326354327-

expect(profiles).toEqual([

328-

{

329-

profileId: CLAUDE_CLI_PROFILE_ID,

330-

credential: expect.objectContaining({

331-

type: "oauth",

332-

provider: "claude-cli",

333-

access: "claude-cli-access",

334-

refresh: "claude-cli-refresh",

335-

}),

336-

},

337-

]);

355+

expectCredentialFields(expectSingleProfileCredential(profiles, CLAUDE_CLI_PROFILE_ID), {

356+

type: "oauth",

357+

provider: "claude-cli",

358+

access: "claude-cli-access",

359+

refresh: "claude-cli-refresh",

360+

});

338361

});

339362340363

it("skips external cli readers outside the scoped provider set", () => {

@@ -382,15 +405,10 @@ describe("external cli oauth resolution", () => {

382405

}),

383406

);

384407385-

expect(profiles).toEqual([

386-

{

387-

profileId: CLAUDE_CLI_PROFILE_ID,

388-

credential: expect.objectContaining({

389-

provider: "claude-cli",

390-

access: "claude-cli-fresh-access",

391-

}),

392-

},

393-

]);

408+

expectCredentialFields(expectSingleProfileCredential(profiles, CLAUDE_CLI_PROFILE_ID), {

409+

provider: "claude-cli",

410+

access: "claude-cli-fresh-access",

411+

});

394412

});

395413396414

it("passes non-prompting keychain policy to scoped Claude CLI credential reads", () => {

@@ -407,18 +425,11 @@ describe("external cli oauth resolution", () => {

407425

allowKeychainPrompt: false,

408426

});

409427410-

expect(profiles).toEqual([

411-

{

412-

profileId: CLAUDE_CLI_PROFILE_ID,

413-

credential: expect.objectContaining({

414-

type: "oauth",

415-

provider: "claude-cli",

416-

}),

417-

},

418-

]);

419-

expect(mocks.readClaudeCliCredentialsCached).toHaveBeenCalledWith(

420-

expect.objectContaining({ allowKeychainPrompt: false }),

421-

);

428+

expectCredentialFields(expectSingleProfileCredential(profiles, CLAUDE_CLI_PROFILE_ID), {

429+

type: "oauth",

430+

provider: "claude-cli",

431+

});

432+

expectReaderPolicyCall(mocks.readClaudeCliCredentialsCached);

422433

expect(mocks.readCodexCliCredentialsCached).not.toHaveBeenCalled();

423434

expect(mocks.readMiniMaxCliCredentialsCached).not.toHaveBeenCalled();

424435

});

@@ -437,18 +448,14 @@ describe("external cli oauth resolution", () => {

437448

allowKeychainPrompt: false,

438449

});

439450440-

expect(profiles).toEqual([

451+

expectCredentialFields(

452+

expectSingleProfileCredential(profiles, OPENAI_CODEX_DEFAULT_PROFILE_ID),

441453

{

442-

profileId: OPENAI_CODEX_DEFAULT_PROFILE_ID,

443-

credential: expect.objectContaining({

444-

type: "oauth",

445-

provider: "openai-codex",

446-

}),

454+

type: "oauth",

455+

provider: "openai-codex",

447456

},

448-

]);

449-

expect(mocks.readCodexCliCredentialsCached).toHaveBeenCalledWith(

450-

expect.objectContaining({ allowKeychainPrompt: false }),

451457

);

458+

expectReaderPolicyCall(mocks.readCodexCliCredentialsCached);

452459

expect(mocks.readClaudeCliCredentialsCached).not.toHaveBeenCalled();

453460

expect(mocks.readMiniMaxCliCredentialsCached).not.toHaveBeenCalled();

454461

});

@@ -495,7 +502,7 @@ describe("external cli oauth resolution", () => {

495502

const profilesById = new Map(

496503

profiles.map((profile) => [profile.profileId, profile.credential]),

497504

);

498-

expect(profilesById.get(MINIMAX_CLI_PROFILE_ID)).toMatchObject({

505+

expectCredentialFields(profilesById.get(MINIMAX_CLI_PROFILE_ID) as Record<string, unknown>, {

499506

access: "minimax-fresh-access",

500507

refresh: "minimax-fresh-refresh",

501508

});