fix(exec-approvals): coerce bare string allowlist entries (#9903) (thanks @mcaxtr)

This commit is contained in:
George Pickett
2026-02-05 15:51:27 -08:00
parent 6ff209e932
commit 141f551a4c
7 changed files with 82 additions and 22 deletions

View File

@@ -53,10 +53,17 @@ async function withEnvOverride<T>(
}
}
vi.mock("../gateway/call.js", () => ({
callGateway: (opts: unknown) => callGateway(opts),
randomIdempotencyKey: () => "rk_test",
}));
vi.mock(
new URL("../../gateway/call.ts", new URL("./gateway-cli/call.ts", import.meta.url)).href,
async (importOriginal) => {
const mod = await importOriginal();
return {
...mod,
callGateway: (opts: unknown) => callGateway(opts),
randomIdempotencyKey: () => "rk_test",
};
},
);
vi.mock("../gateway/server.js", () => ({
startGatewayServer: (port: number, opts?: unknown) => startGatewayServer(port, opts),
@@ -122,7 +129,7 @@ describe("gateway-cli coverage", () => {
expect(callGateway).toHaveBeenCalledTimes(1);
expect(runtimeLogs.join("\n")).toContain('"ok": true');
}, 30_000);
}, 60_000);
it("registers gateway probe and routes to gatewayStatusCommand", async () => {
runtimeLogs.length = 0;
@@ -137,7 +144,7 @@ describe("gateway-cli coverage", () => {
await program.parseAsync(["gateway", "probe", "--json"], { from: "user" });
expect(gatewayStatusCommand).toHaveBeenCalledTimes(1);
}, 30_000);
}, 60_000);
it("registers gateway discover and prints JSON", async () => {
runtimeLogs.length = 0;