MCPcopy Index your code
hub / github.com/triggerdotdev/trigger.dev / verifyHmacSha256

Function verifyHmacSha256

packages/trigger-sdk/src/security.ts:54–64  ·  view source on GitHub ↗
(
  headerValue: string,
  headerEncoding: BinaryToTextEncoding,
  secret: BinaryLike | KeyObject,
  body: string
)

Source from the content-addressed store, hash-verified

52}
53
54export function verifyHmacSha256(
55 headerValue: string,
56 headerEncoding: BinaryToTextEncoding,
57 secret: BinaryLike | KeyObject,
58 body: string
59): boolean {
60 const bodyDigest = crypto.createHmac("sha256", secret).update(body).digest(headerEncoding);
61 const signature = headerValue?.replace("hmac-sha256=", "").replace("sha256=", "") ?? "";
62
63 return signature === bodyDigest;
64}

Callers 1

verifyRequestSignatureFunction · 0.85

Calls 2

replaceMethod · 0.80
updateMethod · 0.45

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…