feat(monitor): add webhook challenge verification for WPS integration

This commit is contained in:
testmsr 2026-01-28 18:41:33 +08:00
parent b97cca2dad
commit 7c617ffca4

View File

@ -158,6 +158,14 @@ export async function monitorWpsProvider(opts: MonitorWpsOpts): Promise<MonitorW
app.post(path, async (req: Request, res: Response) => {
try {
// Handle challenge verification request (webhook URL validation)
const body = req.body as Record<string, unknown>;
if (typeof body.challenge === "string") {
log("WPS webhook challenge verification");
res.status(200).json({ challenge: body.challenge });
return;
}
let eventPayload: WpsEventPayload;
// Check if this is an encrypted event