mirror of
https://github.com/openclaw/openclaw.git
synced 2026-05-09 16:04:33 +00:00
fix: close OC-02 gaps in ACP permission + gateway HTTP deny config (#15390) (thanks @aether-ai-agent)
This commit is contained in:
33
src/config/config.gateway-tools-config.test.ts
Normal file
33
src/config/config.gateway-tools-config.test.ts
Normal 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");
|
||||
}
|
||||
});
|
||||
});
|
||||
Reference in New Issue
Block a user