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

推荐订阅源

freeCodeCamp Programming Tutorials: Python, JavaScript, Git & More
爱范儿
爱范儿
WordPress大学
WordPress大学
博客园 - 三生石上(FineUI控件)
J
Java Code Geeks
Vercel News
Vercel News
aimingoo的专栏
aimingoo的专栏
T
Tailwind CSS Blog
罗磊的独立博客
B
Blog
博客园_首页
A
About on SuperTechFans
有赞技术团队
有赞技术团队
V
V2EX
U
Unit 42
I
InfoQ
IT之家
IT之家
博客园 - 司徒正美
阮一峰的网络日志
阮一峰的网络日志
博客园 - 叶小钗
Cyber Security Advisories - MS-ISAC
Cyber Security Advisories - MS-ISAC
Stack Overflow Blog
Stack Overflow Blog
The Cloudflare Blog
H
Help Net Security

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
fix(models): mask paste-token input in CLI auth prompt · ...
anurag-bg-ne · 2026-06-16 · via Recent Commits to openclaw:main

@@ -1288,7 +1288,7 @@ describe("modelsAuthLoginCommand", () => {

12881288

}) as typeof process.exit);

12891289

try {

12901290

const cancelSymbol = Symbol.for("clack:cancel");

1291-

mocks.clackText.mockResolvedValue(cancelSymbol);

1291+

mocks.clackPassword.mockResolvedValue(cancelSymbol);

12921292

mocks.clackIsCancel.mockImplementation((value: unknown) => value === cancelSymbol);

1293129312941294

await expect(modelsAuthPasteTokenCommand({ provider: "openai" }, runtime)).rejects.toThrow(

@@ -1303,9 +1303,24 @@ describe("modelsAuthLoginCommand", () => {

13031303

}

13041304

});

130513051306+

it("reads the pasted token through the masked password prompt", async () => {

1307+

const runtime = createRuntime();

1308+

mocks.clackPassword.mockResolvedValue("openai-token");

1309+1310+

await modelsAuthPasteTokenCommand({ provider: "openai" }, runtime);

1311+1312+

expect(mocks.clackPassword).toHaveBeenCalledTimes(1);

1313+

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

1314+

expect(mocks.upsertAuthProfileWithLock).toHaveBeenCalledWith(

1315+

expect.objectContaining({

1316+

credential: expect.objectContaining({ type: "token", token: "openai-token" }),

1317+

}),

1318+

);

1319+

});

1320+13061321

it("writes pasted Anthropic setup-tokens and logs the preference note", async () => {

13071322

const runtime = createRuntime();

1308-

mocks.clackText.mockResolvedValue(`sk-ant-oat01-${"a".repeat(80)}`);

1323+

mocks.clackPassword.mockResolvedValue(`sk-ant-oat01-${"a".repeat(80)}`);

1309132413101325

await modelsAuthPasteTokenCommand({ provider: "anthropic" }, runtime);

13111326

@@ -1332,7 +1347,7 @@ describe("modelsAuthLoginCommand", () => {

13321347

it("writes pasted tokens to the requested agent store", async () => {

13331348

const runtime = createRuntime();

13341349

useCoderAgentConfig();

1335-

mocks.clackText.mockResolvedValue("openai-token");

1350+

mocks.clackPassword.mockResolvedValue("openai-token");

1336135113371352

await modelsAuthPasteTokenCommand({ provider: "openai", agent: "coder" }, runtime);

13381353

@@ -1351,7 +1366,7 @@ describe("modelsAuthLoginCommand", () => {

13511366

it("rejects pasted token expiries that cannot fit in the Date timestamp range", async () => {

13521367

const runtime = createRuntime();

13531368

const nowSpy = vi.spyOn(Date, "now").mockReturnValue(MAX_DATE_TIMESTAMP_MS);

1354-

mocks.clackText.mockResolvedValue("openai-token");

1369+

mocks.clackPassword.mockResolvedValue("openai-token");

13551370

try {

13561371

await expect(

13571372

modelsAuthPasteTokenCommand({ provider: "openai", expiresIn: "1ms" }, runtime),

@@ -1367,7 +1382,7 @@ describe("modelsAuthLoginCommand", () => {

13671382

it("rejects OpenAI API keys pasted as OpenAI Codex token material", async () => {

13681383

const runtime = createRuntime();

13691384

const validateMessages: string[] = [];

1370-

mocks.clackText.mockImplementation(

1385+

mocks.clackPassword.mockImplementation(

13711386

async (params: { validate?: (value: string) => string | undefined }) => {

13721387

const message = params.validate?.("sk-openai-chatgpt-api-key-value");

13731388

if (message) {

@@ -1398,7 +1413,7 @@ describe("modelsAuthLoginCommand", () => {

13981413

"paste-api-key --provider openai",

13991414

);

140014151401-

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

1416+

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

14021417

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

14031418

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

14041419

});

@@ -1412,7 +1427,7 @@ describe("modelsAuthLoginCommand", () => {

14121427

"paste-api-key --provider openai",

14131428

);

141414291415-

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

1430+

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

14161431

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

14171432

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

14181433

});

@@ -1523,7 +1538,7 @@ describe("modelsAuthLoginCommand", () => {

15231538

'Unknown agent id "missing". Use "openclaw agents list" to see configured agents.',

15241539

);

152515401526-

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

1541+

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

15271542

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

15281543

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

15291544

});

@@ -1659,10 +1674,8 @@ describe("modelsAuthLoginCommand", () => {

16591674

useCoderAgentConfig();

16601675

mocks.resolvePluginProviders.mockReturnValue([]);

16611676

mocks.clackSelect.mockResolvedValue("custom");

1662-

mocks.clackText

1663-

.mockResolvedValueOnce("openai")

1664-

.mockResolvedValueOnce("openai:manual")

1665-

.mockResolvedValueOnce("openai-token");

1677+

mocks.clackText.mockResolvedValueOnce("openai").mockResolvedValueOnce("openai:manual");

1678+

mocks.clackPassword.mockResolvedValue("openai-token");

16661679

mocks.clackConfirm.mockResolvedValue(false);

1667168016681681

await modelsAuthAddCommand({ agent: "coder" }, runtime);