SanityWebhookPlug.Signature (sanity_webhook_plug v0.1.0)
Compute and verify signatures from Sanity webhooks
Link to this section Summary
Functions
Compute the signature for Sanity webhooks
Verify a payload, timestamp, and secret against a computed signature
Link to this section Types
Link to this type
secret()
Link to this section Functions
Link to this function
base64url_decode(payload)
Link to this function
base64url_encode(payload)
Link to this function
compute(ts, payload, secret)
@spec compute(pos_integer(), binary(), String.t()) :: {:ok, String.t()} | {:error, String.t(), nil}
Compute the signature for Sanity webhooks
Link to this function
verify(hash, ts, payload, secret)
@spec verify(String.t(), pos_integer(), binary(), secret()) :: :ok | {:error, String.t(), String.t()}
Verify a payload, timestamp, and secret against a computed signature