MCPcopy
hub / github.com/callumalpass/tasknotes / verifySignature

Function verifySignature

test-webhook.js:50–59  ·  view source on GitHub ↗

* Verify webhook signature

(payload, signature, secret)

Source from the content-addressed store, hash-verified

48 * Verify webhook signature
49 */
50function verifySignature(payload, signature, secret) {
51 if (!signature) return false;
52
53 const expectedSignature = crypto
54 .createHmac('sha256', secret)
55 .update(JSON.stringify(payload))
56 .digest('hex');
57
58 return signature === expectedSignature;
59}
60
61/**
62 * Main webhook endpoint

Callers 1

test-webhook.jsFile · 0.85

Calls 1

updateMethod · 0.65

Tested by

no test coverage detected