mirror of
https://github.com/openclaw/openclaw.git
synced 2026-04-19 08:48:37 +00:00
test(perf): use shell resolver fixture in secrets audit
This commit is contained in:
@@ -139,16 +139,14 @@ describe("secrets audit", () => {
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
const execLogPath = path.join(fixture.rootDir, "exec-calls.log");
|
const execLogPath = path.join(fixture.rootDir, "exec-calls.log");
|
||||||
const execScriptPath = path.join(fixture.rootDir, "resolver.mjs");
|
const execScriptPath = path.join(fixture.rootDir, "resolver.sh");
|
||||||
await fs.writeFile(
|
await fs.writeFile(
|
||||||
execScriptPath,
|
execScriptPath,
|
||||||
[
|
[
|
||||||
`#!${process.execPath}`,
|
"#!/bin/sh",
|
||||||
"import fs from 'node:fs';",
|
`printf 'x\\n' >> ${JSON.stringify(execLogPath)}`,
|
||||||
"const req = JSON.parse(fs.readFileSync(0, 'utf8'));",
|
"cat >/dev/null",
|
||||||
`fs.appendFileSync(${JSON.stringify(execLogPath)}, 'x\\n');`,
|
'printf \'{"protocolVersion":1,"values":{"providers/openai/apiKey":"value:providers/openai/apiKey","providers/moonshot/apiKey":"value:providers/moonshot/apiKey"}}\'',
|
||||||
"const values = Object.fromEntries((req.ids ?? []).map((id) => [id, `value:${id}`]));",
|
|
||||||
"process.stdout.write(JSON.stringify({ protocolVersion: 1, values }));",
|
|
||||||
].join("\n"),
|
].join("\n"),
|
||||||
{ encoding: "utf8", mode: 0o700 },
|
{ encoding: "utf8", mode: 0o700 },
|
||||||
);
|
);
|
||||||
|
|||||||
Reference in New Issue
Block a user