MCPcopy Index your code
hub / github.com/simstudioai/sim / validateSentrySignature

Function validateSentrySignature

apps/sim/lib/webhooks/providers/sentry.ts:21–32  ·  view source on GitHub ↗

* Sentry signs webhooks with the Internal Integration's Client Secret using * HMAC-SHA256 over the raw request body, delivered in the * `sentry-hook-signature` header as a hex digest. * * @see https://docs.sentry.io/organization/integrations/integration-platform/webhooks/

(secret: string, signature: string, body: string)

Source from the content-addressed store, hash-verified

19 * @see https://docs.sentry.io/organization/integrations/integration-platform/webhooks/
20 */
21function validateSentrySignature(secret: string, signature: string, body: string): boolean {
22 try {
23 if (!secret || !signature || !body) {
24 return false
25 }
26 const computedHash = hmacSha256Hex(body, secret)
27 return safeCompare(computedHash, signature)
28 } catch (error) {
29 logger.error('Error validating Sentry signature:', error)
30 return false
31 }
32}
33
34/** Header carrying the resource type that triggered the webhook. */
35const SENTRY_RESOURCE_HEADER = 'sentry-hook-resource'

Callers

nothing calls this directly

Calls 3

hmacSha256HexFunction · 0.90
safeCompareFunction · 0.90
errorMethod · 0.80

Tested by

no test coverage detected