mirror of
https://github.com/openclaw/openclaw.git
synced 2026-04-17 04:01:05 +00:00
25 lines
763 B
TypeScript
25 lines
763 B
TypeScript
import { describe, expect, it } from "vitest";
|
|
import { feishuApprovalAuth } from "./approval-auth.js";
|
|
|
|
describe("feishuApprovalAuth", () => {
|
|
it("authorizes open_id approvers and ignores user_id-only allowlists", () => {
|
|
expect(
|
|
feishuApprovalAuth.authorizeActorAction({
|
|
cfg: { channels: { feishu: { allowFrom: ["ou_owner"] } } },
|
|
senderId: "ou_owner",
|
|
action: "approve",
|
|
approvalKind: "exec",
|
|
}),
|
|
).toEqual({ authorized: true });
|
|
|
|
expect(
|
|
feishuApprovalAuth.authorizeActorAction({
|
|
cfg: { channels: { feishu: { allowFrom: ["user_123"] } } },
|
|
senderId: "ou_attacker",
|
|
action: "approve",
|
|
approvalKind: "exec",
|
|
}),
|
|
).toEqual({ authorized: true });
|
|
});
|
|
});
|