signet
Safe HaskellNone
LanguageHaskell2010

Signet.Unstable

Synopsis

Documentation

verifyWebhookText Source #

Arguments

:: (MonadIO m, MonadThrow m) 
=> Text

A Verifier for the webhook. Typically this will be "whsec_..." or "whpk_...".

-> Text

The webhook's unique Id. Typically this will come from the hWebhookId header and look like "msg_...".

-> Text

The webhook's Timestamp. This is an integer number of seconds since the Unix epoch. Typically this will come from the hWebhookTimestamp header. For example "981173106" for 2001-02-03T04:05:06Z.

-> Text

The webhook's raw Payload. Typically this will be a JSON object like {"event_type":"ping",...}.

-> Text

The webhook's Signatures. Typically this will come from the hWebhookSignature header and look like "v1_..." or "v1a_...".

-> m Signature 

Verifies a webhook with Text values. This is a wrapper around verifyWebhookByteString that assumes all values are encoded as UTF-8.

verifyWebhookByteString Source #

Verifies a webhook with ByteString values. This is a wrapper around verifyWebhook. See verifyWebhookText for a description of the arguments.

verifyWebhook :: (MonadIO m, MonadThrow m) => Verifier -> Message -> Signatures -> m Signature Source #

Verifies a webhook. This is a wrapper around verifyWebhookWith that uses typicalTolerance and the current time.

Throws an exception if the webhook is invalid.

verifyWebhookWith Source #

Verifies a webhook. This is the lowest-level function that gives you the most control. If you're looking for something that's easier to use and assumes some reasonable defaults, consider verifyWebhook.

pattern SymmetricSigner :: Secret -> Signer Source #

Alias for Symmetric.