github-webhooks-0.17.0: Aeson instances for GitHub Webhook payloads.
Copyright(c) Cuedo Control Engineering 2017-2022
LicenseMIT
MaintainerKyle Van Berendonck <foss@cuedo.com.au>
Safe HaskellTrustworthy
LanguageHaskell2010

GitHub.Data.Webhooks.Secure

Description

Synopsis

Documentation

data PayloadNotSecure Source #

An exception indicating that the given payload is not secure.

Constructors

PayloadNotSecure 

isSecurePayload :: Text -> Maybe Text -> ByteString -> Bool Source #

Returns True if the given HMAC digest (passed in the X-Hub-Signature header) agrees with the provided secret and request body. If not, this request may be forged.

assertSecurePayload :: Text -> Maybe Text -> ByteString -> IO () Source #

Like isSecurePayload, but throws PayloadNotSecure if the payload is not secure.