Webhoox.Authentication.StandardWebhook (Webhoox v0.3.1)

View Source

Standard Webhook Authentication (verify and sign) Read more here: https://standardwebhooks.com

Summary

Functions

Sign a Standard Webhook given an id, timestamp, payload and secret

Verify a Standard Webhook given a Plug.Conn, payload and secret

Functions

sign(id, timestamp, payload, secret)

@spec sign(
  id :: String.t(),
  timestamp :: integer(),
  payload :: map(),
  secret :: binary()
) :: String.t()

Sign a Standard Webhook given an id, timestamp, payload and secret

validate_timestamp(timestamp)

verify(conn, payload, secret)

@spec verify(Plug.Conn.t(), map(), binary()) :: boolean()

Verify a Standard Webhook given a Plug.Conn, payload and secret