hooksig

hooksig  /  MongoDB Atlas

HMAC-SHA1 · base64 · no timestamp

MongoDB Atlas

Atlas alert webhooks are a SHA-1 holdout: base64 over the raw body, in an X-MMS-Signature header.

Try it, live in your browser

HMAC-SHA1 · base64 · no timestamp
Request: edit anything
Verify this in code
import { verify } from "hooksig";

const result = await verify("atlas", {
  payload: rawBody,            // the RAW body, not parsed JSON
  headers: request.headers,
  secret: env.WEBHOOK_SECRET,
});

if (!result.verified) {
  return new Response(result.reason, { status: 400 });
}
no match: signature invalid
Signed string
HMAC-SHA1( secret, signed string ) = expected
Expected vs provided
expected
provided
How it's built

    The scheme

    Gotchas

    Official MongoDB Atlas docs →