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

推荐订阅源

让小产品的独立变现更简单 - ezindie.com
让小产品的独立变现更简单 - ezindie.com
月光博客
月光博客
freeCodeCamp Programming Tutorials: Python, JavaScript, Git & More
T
Tailwind CSS Blog
大猫的无限游戏
大猫的无限游戏
The Cloudflare Blog
博客园_首页
Jina AI
Jina AI
WordPress大学
WordPress大学
小众软件
小众软件
阮一峰的网络日志
阮一峰的网络日志
Apple Machine Learning Research
Apple Machine Learning Research
博客园 - 三生石上(FineUI控件)
酷 壳 – CoolShell
酷 壳 – CoolShell
博客园 - 叶小钗
美团技术团队
IT之家
IT之家
爱范儿
爱范儿
有赞技术团队
有赞技术团队
OSCHINA 社区最新新闻
OSCHINA 社区最新新闻
量子位
博客园 - 聂微东
人人都是产品经理
人人都是产品经理
博客园 - 【当耐特】

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(gateway): preserve config SecretRef env for services ...
steipete · 2026-04-28 · via Recent Commits to openclaw:main

@@ -4,6 +4,7 @@ import type { AuthProfileStore } from "../agents/auth-profiles/types.js";

44

import { formatCliCommand } from "../cli/command-format.js";

55

import { collectDurableServiceEnvVars } from "../config/state-dir-dotenv.js";

66

import type { OpenClawConfig } from "../config/types.js";

7+

import { resolveSecretInputRef } from "../config/types.secrets.js";

78

import { resolveGatewayLaunchAgentLabel } from "../daemon/constants.js";

89

import { resolveGatewayStateDir } from "../daemon/paths.js";

910

import {

@@ -22,6 +23,7 @@ import {

2223

isDangerousHostEnvVarName,

2324

normalizeEnvVarKey,

2425

} from "../infra/host-env-security.js";

26+

import { discoverConfigSecretTargets } from "../secrets/target-registry.js";

2527

import {

2628

emitDaemonInstallRuntimeWarning,

2729

resolveDaemonInstallRuntimeInputs,

@@ -45,6 +47,11 @@ let daemonInstallAuthProfileStoreRuntimePromise:

4547

| Promise<typeof import("./daemon-install-auth-profiles-store.runtime.js")>

4648

| undefined;

474950+

const NON_PERSISTED_CONFIG_SECRET_ENV_TARGET_IDS = new Set([

51+

"gateway.auth.password",

52+

"gateway.auth.token",

53+

]);

54+4855

function loadDaemonInstallAuthProfileSourceRuntime() {

4956

daemonInstallAuthProfileSourceRuntimePromise ??=

5057

import("./daemon-install-auth-profiles-source.runtime.js");

@@ -109,6 +116,58 @@ async function collectAuthProfileServiceEnvVars(params: {

109116

return entries;

110117

}

111118119+

function collectConfigSecretRefServiceEnvVars(params: {

120+

env: Record<string, string | undefined>;

121+

config?: OpenClawConfig;

122+

durableEnvironment: Record<string, string | undefined>;

123+

warn?: DaemonInstallWarnFn;

124+

}): Record<string, string> {

125+

if (!params.config) {

126+

return {};

127+

}

128+

const entries: Record<string, string> = {};

129+

for (const target of discoverConfigSecretTargets(params.config)) {

130+

if (!target.entry.includeInPlan) {

131+

continue;

132+

}

133+

if (NON_PERSISTED_CONFIG_SECRET_ENV_TARGET_IDS.has(target.entry.id)) {

134+

continue;

135+

}

136+

const { ref } = resolveSecretInputRef({

137+

value: target.value,

138+

refValue: target.refValue,

139+

defaults: params.config.secrets?.defaults,

140+

});

141+

if (!ref || ref.source !== "env") {

142+

continue;

143+

}

144+

const key = normalizeEnvVarKey(ref.id, { portable: true });

145+

if (!key) {

146+

params.warn?.(

147+

`Config SecretRef env id "${ref.id}" is not portable and was not added to the service environment`,

148+

"Config SecretRef",

149+

);

150+

continue;

151+

}

152+

if (isDangerousHostEnvVarName(key) || isDangerousHostEnvOverrideVarName(key)) {

153+

params.warn?.(

154+

`Config SecretRef env ref "${key}" blocked by host-env security policy`,

155+

"Config SecretRef",

156+

);

157+

continue;

158+

}

159+

if (Object.hasOwn(params.durableEnvironment, key)) {

160+

continue;

161+

}

162+

const value = params.env[key]?.trim();

163+

if (!value) {

164+

continue;

165+

}

166+

entries[key] = value;

167+

}

168+

return entries;

169+

}

170+112171

function mergeServicePath(

113172

nextPath: string | undefined,

114173

existingPath: string | undefined,

@@ -213,6 +272,12 @@ async function buildGatewayInstallEnvironment(params: {

213272

env: params.env,

214273

config: params.config,

215274

});

275+

const configSecretRefEnvironment = collectConfigSecretRefServiceEnvVars({

276+

env: params.env,

277+

config: params.config,

278+

durableEnvironment,

279+

warn: params.warn,

280+

});

216281

const authProfileEnvironment = await collectAuthProfileServiceEnvVars({

217282

env: params.env,

218283

authStore: params.authStore,

@@ -224,6 +289,7 @@ async function buildGatewayInstallEnvironment(params: {

224289

readManagedServiceEnvKeysFromEnvironment(params.existingEnvironment),

225290

),

226291

...durableEnvironment,

292+

...configSecretRefEnvironment,

227293

...authProfileEnvironment,

228294

};

229295

const managedServiceEnvKeys = formatManagedServiceEnvKeys(durableEnvironment, {