refactor(security): harden CommandAuthorized plumbing
This commit is contained in:
18
src/auto-reply/reply/test-ctx.ts
Normal file
18
src/auto-reply/reply/test-ctx.ts
Normal file
@@ -0,0 +1,18 @@
|
||||
import type { FinalizedMsgContext, MsgContext } from "../templating.js";
|
||||
import { finalizeInboundContext } from "./inbound-context.js";
|
||||
|
||||
export function buildTestCtx(overrides: Partial<MsgContext> = {}): FinalizedMsgContext {
|
||||
return finalizeInboundContext({
|
||||
Body: "",
|
||||
CommandBody: "",
|
||||
CommandSource: "text",
|
||||
From: "whatsapp:+1000",
|
||||
To: "whatsapp:+2000",
|
||||
ChatType: "direct",
|
||||
Provider: "whatsapp",
|
||||
Surface: "whatsapp",
|
||||
CommandAuthorized: false,
|
||||
...overrides,
|
||||
});
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user