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

推荐订阅源

G
Google Developers Blog
D
Docker
Stack Overflow Blog
Stack Overflow Blog
GbyAI
GbyAI
OSCHINA 社区最新新闻
OSCHINA 社区最新新闻
Google DeepMind News
Google DeepMind News
M
MIT News - Artificial intelligence
H
Help Net Security
T
Tailwind CSS Blog
Engineering at Meta
Engineering at Meta
L
LangChain Blog
MongoDB | Blog
MongoDB | Blog
腾讯CDC
H
Hackread – Cybersecurity News, Data Breaches, AI and More
S
SegmentFault 最新的问题
博客园 - 司徒正美
C
Check Point Blog
B
Blog
Y
Y Combinator Blog
Microsoft Azure Blog
Microsoft Azure Blog
P
Proofpoint News Feed
F
Fortinet All Blogs
美团技术团队
D
DataBreaches.Net

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(config): reject legacy secretref env markers · opencl...
steipete · 2026-04-25 · via Recent Commits to openclaw:main

@@ -47,6 +47,64 @@ vi.mock("./doctor/shared/channel-legacy-config-migrate.js", () => ({

4747

}),

4848

}));

494950+

vi.mock("../secrets/target-registry.js", () => {

51+

const entry = {

52+

id: "channels.discord.token",

53+

targetType: "channels.discord.token",

54+

configFile: "openclaw.json",

55+

pathPattern: "channels.discord.token",

56+

secretShape: "secret_input",

57+

expectedResolvedValue: "string",

58+

includeInPlan: true,

59+

includeInConfigure: true,

60+

includeInAudit: true,

61+

};

62+63+

const readRecord = (value: unknown): Record<string, unknown> | null =>

64+

value && typeof value === "object" && !Array.isArray(value)

65+

? (value as Record<string, unknown>)

66+

: null;

67+68+

return {

69+

discoverConfigSecretTargets: (cfg: OpenClawConfig) => {

70+

const targets: Array<{

71+

entry: typeof entry;

72+

path: string;

73+

pathSegments: string[];

74+

value: unknown;

75+

accountId?: string;

76+

}> = [];

77+

const channels = readRecord(cfg.channels);

78+

const discord = readRecord(channels?.discord);

79+

if (!discord) {

80+

return targets;

81+

}

82+

targets.push({

83+

entry,

84+

path: "channels.discord.token",

85+

pathSegments: ["channels", "discord", "token"],

86+

value: discord.token,

87+

});

88+89+

const accounts = readRecord(discord.accounts);

90+

for (const [accountId, accountConfig] of Object.entries(accounts ?? {})) {

91+

const account = readRecord(accountConfig);

92+

if (!account) {

93+

continue;

94+

}

95+

targets.push({

96+

entry,

97+

path: `channels.discord.accounts.${accountId}.token`,

98+

pathSegments: ["channels", "discord", "accounts", accountId, "token"],

99+

value: account.token,

100+

accountId,

101+

});

102+

}

103+

return targets;

104+

},

105+

};

106+

});

107+50108

describe("normalizeCompatibilityConfigValues", () => {

51109

let previousOauthDir: string | undefined;

52110

let tempOauthDir = "";

@@ -115,6 +173,57 @@ describe("normalizeCompatibilityConfigValues", () => {

115173

});

116174

});

117175176+

it("migrates legacy secretref-env markers on SecretRef credential paths", () => {

177+

const res = normalizeCompatibilityConfigValues({

178+

secrets: {

179+

defaults: {

180+

env: "gateway-env",

181+

},

182+

},

183+

channels: {

184+

discord: {

185+

token: "secretref-env:DISCORD_BOT_TOKEN",

186+

accounts: {

187+

work: {

188+

token: "secretref-env:DISCORD_WORK_TOKEN",

189+

},

190+

},

191+

},

192+

},

193+

} as unknown as OpenClawConfig);

194+195+

expect(res.config.channels?.discord?.token).toBeUndefined();

196+

expect(res.config.channels?.discord?.accounts?.default?.token).toEqual({

197+

source: "env",

198+

provider: "gateway-env",

199+

id: "DISCORD_BOT_TOKEN",

200+

});

201+

expect(res.config.channels?.discord?.accounts?.work?.token).toEqual({

202+

source: "env",

203+

provider: "gateway-env",

204+

id: "DISCORD_WORK_TOKEN",

205+

});

206+

expect(res.changes).toContain(

207+

"Moved channels.discord.accounts.default.token secretref-env:DISCORD_BOT_TOKEN marker → structured env SecretRef.",

208+

);

209+

expect(res.changes).toContain(

210+

"Moved channels.discord.accounts.work.token secretref-env:DISCORD_WORK_TOKEN marker → structured env SecretRef.",

211+

);

212+

});

213+214+

it("leaves invalid legacy secretref-env markers for validation to reject", () => {

215+

const res = normalizeCompatibilityConfigValues({

216+

channels: {

217+

discord: {

218+

token: "secretref-env:not-valid",

219+

},

220+

},

221+

} as unknown as OpenClawConfig);

222+223+

expect(res.config.channels?.discord?.token).toBe("secretref-env:not-valid");

224+

expect(res.changes).toEqual([]);

225+

});

226+118227

it("moves WhatsApp access defaults into accounts.default for named accounts", () => {

119228

const res = normalizeCompatibilityConfigValues({

120229

channels: {