Skip to content

Commit 75a0f14

Browse files
xinxin
authored andcommitted
fix: regenerate SecretRef credential surface Markdown against current main
Regenerate docs/reference/secretref-credential-surface.md so it includes all entries present in the JSON credential matrix. The previous generated copy omitted plugins.entries.parallel.config.webSearch.apiKey and talk.realtime.providers.*.apiKey, which would have caused the new check:secretref-docs preflight to fail after merge. Generated by: pnpm gen:secretref-docs (--check confirms in-sync)
1 parent 9210d8f commit 75a0f14

10 files changed

Lines changed: 515 additions & 116 deletions

‎config/knip.config.ts‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -128,6 +128,7 @@ const config = {
128128
"**/*.test-utils.ts",
129129
"test/helpers/live-image-probe.ts",
130130
"src/secrets/credential-matrix.ts",
131+
"src/secrets/credential-matrix-docs.ts",
131132
"src/agents/claude-cli-runner.ts",
132133
"src/agents/agent-auth-json.ts",
133134
"src/agents/tool-policy.conformance.ts",

‎docs/reference/secretref-credential-surface.md‎

Lines changed: 68 additions & 68 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,64 @@ Scope intent:
2020

2121
[//]: # "secretref-supported-list-start"
2222

23+
- `agents.defaults.memorySearch.remote.apiKey`
24+
- `agents.list[].memorySearch.remote.apiKey`
25+
- `agents.list[].tts.providers.*.apiKey`
26+
- `channels.discord.accounts.*.pluralkit.token`
27+
- `channels.discord.accounts.*.token`
28+
- `channels.discord.accounts.*.voice.tts.providers.*.apiKey`
29+
- `channels.discord.pluralkit.token`
30+
- `channels.discord.token`
31+
- `channels.discord.voice.tts.providers.*.apiKey`
32+
- `channels.feishu.accounts.*.appSecret`
33+
- `channels.feishu.accounts.*.encryptKey`
34+
- `channels.feishu.accounts.*.verificationToken`
35+
- `channels.feishu.appSecret`
36+
- `channels.feishu.encryptKey`
37+
- `channels.feishu.verificationToken`
38+
- `channels.googlechat.accounts.*.serviceAccount` via sibling `serviceAccountRef` (compatibility exception)
39+
- `channels.googlechat.serviceAccount` via sibling `serviceAccountRef` (compatibility exception)
40+
- `channels.irc.accounts.*.nickserv.password`
41+
- `channels.irc.accounts.*.password`
42+
- `channels.irc.nickserv.password`
43+
- `channels.irc.password`
44+
- `channels.matrix.accessToken`
45+
- `channels.matrix.accounts.*.accessToken`
46+
- `channels.matrix.accounts.*.password`
47+
- `channels.matrix.password`
48+
- `channels.mattermost.accounts.*.botToken`
49+
- `channels.mattermost.botToken`
50+
- `channels.msteams.appPassword`
51+
- `channels.nextcloud-talk.accounts.*.apiPassword`
52+
- `channels.nextcloud-talk.accounts.*.botSecret`
53+
- `channels.nextcloud-talk.apiPassword`
54+
- `channels.nextcloud-talk.botSecret`
55+
- `channels.qqbot.accounts.*.clientSecret`
56+
- `channels.qqbot.clientSecret`
57+
- `channels.slack.accounts.*.appToken`
58+
- `channels.slack.accounts.*.botToken`
59+
- `channels.slack.accounts.*.signingSecret`
60+
- `channels.slack.accounts.*.userToken`
61+
- `channels.slack.appToken`
62+
- `channels.slack.botToken`
63+
- `channels.slack.signingSecret`
64+
- `channels.slack.userToken`
65+
- `channels.sms.accounts.*.authToken`
66+
- `channels.sms.authToken`
67+
- `channels.telegram.accounts.*.botToken`
68+
- `channels.telegram.accounts.*.webhookSecret`
69+
- `channels.telegram.botToken`
70+
- `channels.telegram.webhookSecret`
71+
- `channels.zalo.accounts.*.botToken`
72+
- `channels.zalo.accounts.*.webhookSecret`
73+
- `channels.zalo.botToken`
74+
- `channels.zalo.webhookSecret`
75+
- `cron.webhookToken`
76+
- `gateway.auth.password`
77+
- `gateway.auth.token`
78+
- `gateway.remote.password`
79+
- `gateway.remote.token`
80+
- `messages.tts.providers.*.apiKey`
2381
- `models.providers.*.apiKey`
2482
- `models.providers.*.headers.*`
2583
- `models.providers.*.request.auth.token`
@@ -33,85 +91,27 @@ Scope intent:
3391
- `models.providers.*.request.tls.cert`
3492
- `models.providers.*.request.tls.key`
3593
- `models.providers.*.request.tls.passphrase`
36-
- `skills.entries.*.apiKey`
37-
- `agents.defaults.memorySearch.remote.apiKey`
38-
- `agents.list[].tts.providers.*.apiKey`
39-
- `agents.list[].memorySearch.remote.apiKey`
40-
- `talk.providers.*.apiKey`
41-
- `talk.realtime.providers.*.apiKey`
42-
- `messages.tts.providers.*.apiKey`
43-
- `tools.web.fetch.firecrawl.apiKey`
4494
- `plugins.entries.acpx.config.mcpServers.*.env.*`
4595
- `plugins.entries.brave.config.webSearch.apiKey`
4696
- `plugins.entries.exa.config.webSearch.apiKey`
97+
- `plugins.entries.firecrawl.config.webSearch.apiKey`
4798
- `plugins.entries.google.config.webSearch.apiKey`
48-
- `plugins.entries.xai.config.webSearch.apiKey`
99+
- `plugins.entries.minimax.config.webSearch.apiKey`
49100
- `plugins.entries.moonshot.config.webSearch.apiKey`
101+
- `plugins.entries.parallel.config.webSearch.apiKey`
50102
- `plugins.entries.perplexity.config.webSearch.apiKey`
51-
- `plugins.entries.firecrawl.config.webSearch.apiKey`
52-
- `plugins.entries.minimax.config.webSearch.apiKey`
53103
- `plugins.entries.tavily.config.webSearch.apiKey`
54-
- `plugins.entries.parallel.config.webSearch.apiKey`
55104
- `plugins.entries.voice-call.config.realtime.providers.*.apiKey`
56105
- `plugins.entries.voice-call.config.streaming.providers.*.apiKey`
57106
- `plugins.entries.voice-call.config.tts.providers.*.apiKey`
58107
- `plugins.entries.voice-call.config.twilio.authToken`
108+
- `plugins.entries.xai.config.webSearch.apiKey`
109+
- `skills.entries.*.apiKey`
110+
- `talk.providers.*.apiKey`
111+
- `talk.realtime.providers.*.apiKey`
112+
- `tools.web.fetch.firecrawl.apiKey`
59113
- `tools.web.search.*.apiKey`
60114
- `tools.web.search.apiKey`
61-
- `gateway.auth.password`
62-
- `gateway.auth.token`
63-
- `gateway.remote.token`
64-
- `gateway.remote.password`
65-
- `cron.webhookToken`
66-
- `channels.telegram.botToken`
67-
- `channels.telegram.webhookSecret`
68-
- `channels.telegram.accounts.*.botToken`
69-
- `channels.telegram.accounts.*.webhookSecret`
70-
- `channels.slack.botToken`
71-
- `channels.slack.appToken`
72-
- `channels.slack.userToken`
73-
- `channels.slack.signingSecret`
74-
- `channels.slack.accounts.*.botToken`
75-
- `channels.slack.accounts.*.appToken`
76-
- `channels.slack.accounts.*.userToken`
77-
- `channels.slack.accounts.*.signingSecret`
78-
- `channels.sms.authToken`
79-
- `channels.sms.accounts.*.authToken`
80-
- `channels.discord.token`
81-
- `channels.discord.pluralkit.token`
82-
- `channels.discord.voice.tts.providers.*.apiKey`
83-
- `channels.discord.accounts.*.token`
84-
- `channels.discord.accounts.*.pluralkit.token`
85-
- `channels.discord.accounts.*.voice.tts.providers.*.apiKey`
86-
- `channels.irc.password`
87-
- `channels.irc.nickserv.password`
88-
- `channels.irc.accounts.*.password`
89-
- `channels.irc.accounts.*.nickserv.password`
90-
- `channels.feishu.appSecret`
91-
- `channels.feishu.encryptKey`
92-
- `channels.feishu.verificationToken`
93-
- `channels.feishu.accounts.*.appSecret`
94-
- `channels.feishu.accounts.*.encryptKey`
95-
- `channels.feishu.accounts.*.verificationToken`
96-
- `channels.qqbot.clientSecret`
97-
- `channels.qqbot.accounts.*.clientSecret`
98-
- `channels.msteams.appPassword`
99-
- `channels.mattermost.botToken`
100-
- `channels.mattermost.accounts.*.botToken`
101-
- `channels.matrix.accessToken`
102-
- `channels.matrix.password`
103-
- `channels.matrix.accounts.*.accessToken`
104-
- `channels.matrix.accounts.*.password`
105-
- `channels.nextcloud-talk.botSecret`
106-
- `channels.nextcloud-talk.apiPassword`
107-
- `channels.nextcloud-talk.accounts.*.botSecret`
108-
- `channels.nextcloud-talk.accounts.*.apiPassword`
109-
- `channels.zalo.botToken`
110-
- `channels.zalo.webhookSecret`
111-
- `channels.zalo.accounts.*.botToken`
112-
- `channels.zalo.accounts.*.webhookSecret`
113-
- `channels.googlechat.serviceAccount` via sibling `serviceAccountRef` (compatibility exception)
114-
- `channels.googlechat.accounts.*.serviceAccount` via sibling `serviceAccountRef` (compatibility exception)
115115

116116
### `auth-profiles.json` targets (`secrets configure` + `secrets apply` + `secrets audit`)
117117

@@ -146,10 +146,10 @@ Out-of-scope credentials include:
146146
- `hooks.gmail.pushToken`
147147
- `hooks.mappings[].sessionKey`
148148
- `auth-profiles.oauth.*`
149-
- `channels.discord.threadBindings.webhookToken`
150149
- `channels.discord.accounts.*.threadBindings.webhookToken`
151-
- `channels.whatsapp.creds.json`
150+
- `channels.discord.threadBindings.webhookToken`
152151
- `channels.whatsapp.accounts.*.creds.json`
152+
- `channels.whatsapp.creds.json`
153153

154154
[//]: # "secretref-unsupported-list-end"
155155

‎package.json‎

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1461,6 +1461,7 @@
14611461
"check:no-runtime-action-load-config": "node scripts/check-no-runtime-action-load-config.mjs",
14621462
"check:opengrep-rule-metadata": "node security/opengrep/check-rule-metadata.mjs",
14631463
"check:runtime-sidecar-loaders": "node --import tsx scripts/check-runtime-sidecar-loaders.mjs",
1464+
"check:secretref-docs": "node scripts/run-with-env.mjs OPENCLAW_BUNDLED_PLUGINS_DIR=extensions OPENCLAW_TEST_TRUST_BUNDLED_PLUGINS_DIR=1 -- node --import tsx scripts/generate-secretref-credential-matrix.ts --check",
14641465
"check:static-import-sccs": "pnpm check:madge-import-cycles",
14651466
"check:temp-path-guardrails": "node --import tsx scripts/check-temp-path-guardrails.ts",
14661467
"check:test-types": "pnpm tsgo:test",
@@ -1539,6 +1540,7 @@
15391540
"gateway:watch": "node scripts/gateway-watch-tmux.mjs gateway --force",
15401541
"gateway:watch:raw": "node scripts/watch-node.mjs gateway --force",
15411542
"gen:host-env-policy:swift": "node scripts/generate-host-env-security-policy-swift.mjs --write",
1543+
"gen:secretref-docs": "node scripts/run-with-env.mjs OPENCLAW_BUNDLED_PLUGINS_DIR=extensions OPENCLAW_TEST_TRUST_BUNDLED_PLUGINS_DIR=1 -- node --import tsx scripts/generate-secretref-credential-matrix.ts",
15421544
"ghsa:patch": "node scripts/ghsa-patch.mjs",
15431545
"ios:beta": "bash scripts/ios-beta-release.sh",
15441546
"ios:beta:archive": "bash scripts/ios-beta-archive.sh",

‎scripts/check.mjs‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -105,6 +105,7 @@ export async function main(argv = process.argv.slice(2)) {
105105
{ name: "tool display", args: ["tool-display:check"] },
106106
{ name: "host env policy", args: ["check:host-env-policy:swift"] },
107107
{ name: "opengrep rule metadata", args: ["check:opengrep-rule-metadata"] },
108+
{ name: "secretref reference docs", args: ["check:secretref-docs"] },
108109
{ name: "duplicate scan target coverage", args: ["dup:check:coverage"] },
109110
{ name: "npm shrinkwrap guard", args: ["deps:shrinkwrap:check"] },
110111
{ name: "package patch guard", args: ["deps:patches:check"] },
Lines changed: 62 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,73 @@
11
// Generate Secretref Credential Matrix script supports OpenClaw repository automation.
22
import fs from "node:fs";
33
import path from "node:path";
4+
import {
5+
formatSecretRefSupportedListMarkdown,
6+
formatSecretRefUnsupportedListMarkdown,
7+
replaceMarkedBlock,
8+
} from "../src/secrets/credential-matrix-docs.js";
49
import { buildSecretRefCredentialMatrix } from "../src/secrets/credential-matrix.js";
510

6-
const outputPath = path.join(
7-
process.cwd(),
11+
const repoRoot = process.cwd();
12+
const matrixPath = path.join(
13+
repoRoot,
814
"docs",
915
"reference",
1016
"secretref-user-supplied-credentials-matrix.json",
1117
);
18+
const surfacePath = path.join(repoRoot, "docs", "reference", "secretref-credential-surface.md");
1219

1320
const matrix = buildSecretRefCredentialMatrix();
14-
fs.writeFileSync(outputPath, `${JSON.stringify(matrix, null, 2)}\n`, "utf8");
15-
console.log(`Wrote ${outputPath}`);
21+
const expectedMatrixJson = `${JSON.stringify(matrix, null, 2)}\n`;
22+
23+
const expectedSupportedBlock = formatSecretRefSupportedListMarkdown(matrix);
24+
const expectedUnsupportedBlock = formatSecretRefUnsupportedListMarkdown(matrix);
25+
26+
function rebuildSurface(currentSurface: string): string {
27+
let next = replaceMarkedBlock(currentSurface, {
28+
startMarker: '[//]: # "secretref-supported-list-start"',
29+
endMarker: '[//]: # "secretref-supported-list-end"',
30+
body: expectedSupportedBlock,
31+
});
32+
next = replaceMarkedBlock(next, {
33+
startMarker: '[//]: # "secretref-unsupported-list-start"',
34+
endMarker: '[//]: # "secretref-unsupported-list-end"',
35+
body: expectedUnsupportedBlock,
36+
});
37+
return next;
38+
}
39+
40+
const checkMode = process.argv.includes("--check");
41+
42+
const currentSurface = fs.readFileSync(surfacePath, "utf8");
43+
const expectedSurface = rebuildSurface(currentSurface);
44+
45+
if (checkMode) {
46+
const failures: string[] = [];
47+
const currentMatrixJson = fs.readFileSync(matrixPath, "utf8");
48+
if (currentMatrixJson !== expectedMatrixJson) {
49+
failures.push(`docs/reference/secretref-user-supplied-credentials-matrix.json is out of sync.`);
50+
}
51+
if (currentSurface !== expectedSurface) {
52+
failures.push(`docs/reference/secretref-credential-surface.md marker blocks are out of sync.`);
53+
}
54+
if (failures.length > 0) {
55+
for (const failure of failures) {
56+
console.error(`error: ${failure}`);
57+
}
58+
console.error(`Run \`pnpm gen:secretref-docs\` to regenerate.`);
59+
process.exit(1);
60+
}
61+
console.log(`secretref reference docs are in sync.`);
62+
process.exit(0);
63+
}
64+
65+
fs.writeFileSync(matrixPath, expectedMatrixJson, "utf8");
66+
console.log(`Wrote ${path.relative(repoRoot, matrixPath)}`);
67+
68+
if (currentSurface !== expectedSurface) {
69+
fs.writeFileSync(surfacePath, expectedSurface, "utf8");
70+
console.log(`Updated marker blocks in ${path.relative(repoRoot, surfacePath)}`);
71+
} else {
72+
console.log(`${path.relative(repoRoot, surfacePath)} already in sync`);
73+
}

0 commit comments

Comments
 (0)