def sign

bend-kit-webhooks@0.11.0.1 · webhooks.bend:340

import bend-kit-webhooks@0.11.0.1/webhooks.bend as Webhooks
import Base
import bend-kit-int@0.2.0.0/int.bend as Int
import bend-kit-bytes@0.3.3.0/bytes.bend as Bytes

340# The webhook-id, webhook-timestamp, and webhook-signature ("v1,<base64 MAC>") headers for body.
341# id: not empty, no '.'. ts: unix seconds, not negative. secret: whsec_<base64>; send the prefix.
342def sign(+id: String, +ts: Int.I64, body: Bytes.Bytes, +secret: String) ->
343    IO(Bytes.Bytes & Result<&1, &1, Err, Map<&2, List<&2, String>>>):
344  sign.go(sign.check(id, ts), secret, Bytes.slice(body, 0, 4294967295))

Uses (12)

Used by (1)