signedHeaders static method

Map<String, String> signedHeaders({
  1. required String secret,
  2. required String id,
  3. required DateTime timestamp,
  4. required String body,
})

Builds the webhook-id, webhook-timestamp and webhook-signature headers of a signed delivery, for testing webhook handlers.

Implementation

static Map<String, String> signedHeaders({
  required String secret,
  required String id,
  required DateTime timestamp,
  required String body,
}) => {
  idHeader: id,
  timestampHeader: _unixSeconds(timestamp),
  signatureHeader: sign(
    secret: secret,
    id: id,
    timestamp: timestamp,
    body: body,
  ),
};