fix: close OC-02 gaps in ACP permission + gateway HTTP deny config (#15390) (thanks @aether-ai-agent)

This commit is contained in:
Peter Steinberger
2026-02-13 14:28:50 +01:00
parent 749e28dec7
commit ee31cd47b4
9 changed files with 308 additions and 95 deletions

View File

@@ -0,0 +1,33 @@
import { describe, expect, it, vi } from "vitest";
describe("gateway.tools config", () => {
it("accepts gateway.tools allow and deny lists", async () => {
vi.resetModules();
const { validateConfigObject } = await import("./config.js");
const res = validateConfigObject({
gateway: {
tools: {
allow: ["gateway"],
deny: ["sessions_spawn", "sessions_send"],
},
},
});
expect(res.ok).toBe(true);
});
it("rejects invalid gateway.tools values", async () => {
vi.resetModules();
const { validateConfigObject } = await import("./config.js");
const res = validateConfigObject({
gateway: {
tools: {
allow: "gateway",
},
},
});
expect(res.ok).toBe(false);
if (!res.ok) {
expect(res.issues[0]?.path).toBe("gateway.tools.allow");
}
});
});