Systemd: allowlist environment file fixtures

This commit is contained in:
Vincent Koc
2026-03-07 16:42:34 -08:00
parent a56841b98c
commit 60441c8ced

View File

@@ -496,10 +496,10 @@ describe("readSystemdServiceExecStart", () => {
].join("\n");
}
if (pathValue === "/home/test/.openclaw/first.env") {
return "OPENCLAW_GATEWAY_TOKEN=first-token\n";
return "OPENCLAW_GATEWAY_TOKEN=first-token\n"; // pragma: allowlist secret
}
if (pathValue === "/home/test/.openclaw/second env.env") {
return 'OPENCLAW_GATEWAY_PASSWORD="second password"\n';
return 'OPENCLAW_GATEWAY_PASSWORD="second password"\n'; // pragma: allowlist secret
}
throw new Error(`unexpected readFile path: ${pathValue}`);
});
@@ -523,12 +523,12 @@ describe("readSystemdServiceExecStart", () => {
}
if (pathValue.endsWith("/.config/systemd/user/gateway.env")) {
return [
"OPENCLAW_GATEWAY_TOKEN=relative-token",
"OPENCLAW_GATEWAY_PASSWORD=relative-password",
"OPENCLAW_GATEWAY_TOKEN=relative-token", // pragma: allowlist secret
"OPENCLAW_GATEWAY_PASSWORD=relative-password", // pragma: allowlist secret
].join("\n");
}
if (pathValue.endsWith("/.config/systemd/user/override.env")) {
return "OPENCLAW_GATEWAY_TOKEN=override-token\n";
return "OPENCLAW_GATEWAY_TOKEN=override-token\n"; // pragma: allowlist secret
}
throw new Error(`unexpected readFile path: ${pathValue}`);
});
@@ -554,8 +554,8 @@ describe("readSystemdServiceExecStart", () => {
return [
"# comment",
"; another comment",
'OPENCLAW_GATEWAY_TOKEN="quoted token"',
"OPENCLAW_GATEWAY_PASSWORD=quoted-password",
'OPENCLAW_GATEWAY_TOKEN="quoted token"', // pragma: allowlist secret
"OPENCLAW_GATEWAY_PASSWORD=quoted-password", // pragma: allowlist secret
].join("\n");
}
throw new Error(`unexpected readFile path: ${pathValue}`);