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

推荐订阅源

IT之家
IT之家
H
Help Net Security
GbyAI
GbyAI
博客园_首页
G
Google Developers Blog
Microsoft Security Blog
Microsoft Security Blog
博客园 - 【当耐特】
月光博客
月光博客
美团技术团队
B
Blog RSS Feed
博客园 - 三生石上(FineUI控件)
WordPress大学
WordPress大学
博客园 - 叶小钗
有赞技术团队
有赞技术团队
T
The Blog of Author Tim Ferriss
Engineering at Meta
Engineering at Meta
Google DeepMind News
Google DeepMind News
Y
Y Combinator Blog
宝玉的分享
宝玉的分享
Microsoft Azure Blog
Microsoft Azure Blog
罗磊的独立博客
云风的 BLOG
云风的 BLOG
Cyber Security Advisories - MS-ISAC
Cyber Security Advisories - MS-ISAC
P
Proofpoint News Feed

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(configure): mask gateway token prompts · openclaw/ope...
anurag-bg-ne · 2026-06-14 · via Recent Commits to openclaw:main
Original file line numberDiff line numberDiff line change

@@ -5,6 +5,7 @@ import type { RuntimeEnv } from "../runtime.js";

55
66

const mocks = vi.hoisted(() => ({

77

text: vi.fn(),

8+

password: vi.fn(),

89

select: vi.fn(),

910

confirm: vi.fn(),

1011

resolveGatewayPort: vi.fn(),

@@ -24,6 +25,7 @@ vi.mock("../config/config.js", async (importActual) => {

2425
2526

vi.mock("./configure.shared.js", () => ({

2627

text: mocks.text,

28+

password: mocks.password,

2729

select: mocks.select,

2830

confirm: mocks.confirm,

2931

}));

@@ -77,6 +79,7 @@ async function runGatewayPrompt(params: {

7779

return input.initialValue ?? input.options[0]?.value;

7880

});

7981

mocks.text.mockImplementation(async () => params.textQueue.shift());

82+

mocks.password.mockImplementation(async () => params.textQueue.shift());

8083

mocks.randomToken.mockReturnValue(params.randomToken ?? "generated-token");

8184

mocks.confirm.mockResolvedValue(params.confirmResult ?? true);

8285

mocks.buildGatewayAuthConfig.mockImplementation((input) =>

@@ -115,6 +118,9 @@ describe("promptGatewayConfig", () => {

115118

authConfigFactory: ({ mode, token, password }) => ({ mode, token, password }),

116119

});

117120

expect(result.token).toBe("generated-token");

121+

expect(mocks.password).toHaveBeenCalledWith(

122+

expect.objectContaining({ message: "Gateway token (blank to generate)" }),

123+

);

118124

});

119125
120126

it("does not set password to literal 'undefined' when prompt returns undefined", async () => {

@@ -126,6 +132,12 @@ describe("promptGatewayConfig", () => {

126132

});

127133

expect(call.password).not.toBe("undefined");

128134

expect(call.password).toBe("");

135+

expect(mocks.password).toHaveBeenCalledWith(

136+

expect.objectContaining({

137+

message: "Gateway password",

138+

validate: expect.any(Function),

139+

}),

140+

);

129141

});

130142
131143

it("prompts for trusted-proxy configuration when trusted-proxy mode selected", async () => {

Original file line numberDiff line numberDiff line change

@@ -21,7 +21,7 @@ import { findTailscaleBinary } from "../infra/tailscale.js";

2121

import type { RuntimeEnv } from "../runtime.js";

2222

import { resolveDefaultSecretProviderAlias } from "../secrets/ref-contract.js";

2323

import { buildGatewayAuthConfig } from "./configure.gateway-auth.js";

24-

import { confirm, select, text } from "./configure.shared.js";

24+

import { confirm, password, select, text } from "./configure.shared.js";

2525

import {

2626

guardCancel,

2727

normalizeGatewayTokenInput,

@@ -233,9 +233,8 @@ export async function promptGatewayConfig(

233233

note(`Validated ${envVarName}. OpenClaw will store a token SecretRef.`, "Gateway token");

234234

} else {

235235

const tokenInput = guardCancel(

236-

await text({

236+

await password({

237237

message: "Gateway token (blank to generate)",

238-

initialValue: randomToken(),

239238

}),

240239

runtime,

241240

);

@@ -245,14 +244,14 @@ export async function promptGatewayConfig(

245244

}

246245
247246

if (authMode === "password") {

248-

const password = guardCancel(

249-

await text({

247+

const passwordInput = guardCancel(

248+

await password({

250249

message: "Gateway password",

251250

validate: validateGatewayPasswordInput,

252251

}),

253252

runtime,

254253

);

255-

gatewayPassword = normalizeOptionalString(password) ?? "";

254+

gatewayPassword = normalizeOptionalString(passwordInput) ?? "";

256255

}

257256
258257

if (authMode === "trusted-proxy") {

Original file line numberDiff line numberDiff line change

@@ -3,6 +3,7 @@ import {

33

confirm as clackConfirm,

44

intro as clackIntro,

55

outro as clackOutro,

6+

password as clackPassword,

67

select as clackSelect,

78

text as clackText,

89

} from "@clack/prompts";

@@ -104,3 +105,9 @@ export const select = <T>(params: Parameters<typeof clackSelect<T>>[0]) =>

104105

opt.hint === undefined ? opt : { ...opt, hint: stylePromptHint(opt.hint) },

105106

),

106107

});

108+

/** Styled password prompt wrapper. */

109+

export const password = (params: Parameters<typeof clackPassword>[0]) =>

110+

clackPassword({

111+

...params,

112+

message: stylePromptMessage(params.message),

113+

});

Original file line numberDiff line numberDiff line change

@@ -10,6 +10,7 @@ const mocks = vi.hoisted(() => {

1010

clackSelect: vi.fn(),

1111

clackText: vi.fn(),

1212

clackConfirm: vi.fn(),

13+

clackPassword: vi.fn(),

1314

resolveSearchProviderOptions: vi.fn(),

1415

resolvePluginContributionOwners: vi.fn(),

1516

setupSearch: vi.fn(),

@@ -46,6 +47,7 @@ vi.mock("@clack/prompts", () => ({

4647

select: mocks.clackSelect,

4748

text: mocks.clackText,

4849

confirm: mocks.clackConfirm,

50+

password: mocks.clackPassword,

4951

}));

5052
5153

vi.mock("../config/config.js", () => ({