mirror of
https://github.com/openclaw/openclaw.git
synced 2026-05-08 06:11:24 +00:00
test (security/line): cover missing webhook auth startup paths
This commit is contained in:
28
src/line/monitor.fail-closed.test.ts
Normal file
28
src/line/monitor.fail-closed.test.ts
Normal file
@@ -0,0 +1,28 @@
|
||||
import type { OpenClawConfig } from "../config/config.js";
|
||||
import type { RuntimeEnv } from "../runtime.js";
|
||||
import { describe, expect, it } from "vitest";
|
||||
import { monitorLineProvider } from "./monitor.js";
|
||||
|
||||
describe("monitorLineProvider fail-closed webhook auth", () => {
|
||||
it("rejects startup when channel secret is missing", async () => {
|
||||
await expect(
|
||||
monitorLineProvider({
|
||||
channelAccessToken: "token",
|
||||
channelSecret: " ",
|
||||
config: {} as OpenClawConfig,
|
||||
runtime: {} as RuntimeEnv,
|
||||
}),
|
||||
).rejects.toThrow("LINE webhook mode requires a non-empty channel secret.");
|
||||
});
|
||||
|
||||
it("rejects startup when channel access token is missing", async () => {
|
||||
await expect(
|
||||
monitorLineProvider({
|
||||
channelAccessToken: " ",
|
||||
channelSecret: "secret",
|
||||
config: {} as OpenClawConfig,
|
||||
runtime: {} as RuntimeEnv,
|
||||
}),
|
||||
).rejects.toThrow("LINE webhook mode requires a non-empty channel access token.");
|
||||
});
|
||||
});
|
||||
Reference in New Issue
Block a user