Safe Haskell | None |
---|---|
Language | Haskell2010 |
Signet.Unstable
Synopsis
- verifyWebhookText :: (MonadIO m, MonadThrow m) => Text -> Text -> Text -> Text -> Text -> m Signature
- verifyWebhookByteString :: (MonadIO m, MonadThrow m) => ByteString -> ByteString -> ByteString -> ByteString -> ByteString -> m Signature
- verifyWebhook :: (MonadIO m, MonadThrow m) => Verifier -> Message -> Signatures -> m Signature
- verifyWebhookWith :: Tolerance -> UTCTime -> Verifier -> Message -> Signatures -> Either SignetException Signature
- typicalTolerance :: Tolerance
- parseVerifier :: ByteString -> Either InvalidVerifier Verifier
- parseId :: ByteString -> Either InvalidId Id
- parseTimestamp :: ByteString -> Either InvalidTimestamp Timestamp
- parseMessage :: ByteString -> Either InvalidMessage Message
- parseSignatures :: ByteString -> Either InvalidSignature ([UnknownSignature], Signatures)
- pattern AsymmetricVerifier :: PublicKey -> Verifier
- pattern SymmetricVerifier :: Secret -> Verifier
- signWebhook :: Signer -> Message -> Signature
- parseSigner :: ByteString -> Either InvalidSigner Signer
- pattern AsymmetricSigner :: SecretKey -> Signer
- pattern SymmetricSigner :: Secret -> Signer
- pattern AsymmetricSignature :: AsymmetricSignature -> Signature
- pattern SymmetricSignature :: SymmetricSignature -> Signature
Documentation
Arguments
:: (MonadIO m, MonadThrow m) | |
=> Text | A |
-> Text | The webhook's unique |
-> Text | The webhook's |
-> Text | The webhook's raw |
-> Text | The webhook's |
-> 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 #
Arguments
:: (MonadIO m, MonadThrow m) | |
=> ByteString | |
-> ByteString | |
-> ByteString | |
-> ByteString | |
-> ByteString | |
-> m Signature |
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.
Arguments
:: Tolerance | Often |
-> UTCTime | Usually |
-> Verifier | See |
-> Message | See |
-> Signatures | See |
-> Either SignetException Signature |
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
.
typicalTolerance :: Tolerance Source #
Alias for typical
.
parseVerifier :: ByteString -> Either InvalidVerifier Verifier Source #
Alias for parse
.
parseTimestamp :: ByteString -> Either InvalidTimestamp Timestamp Source #
Alias for parse
.
parseMessage :: ByteString -> Either InvalidMessage Message Source #
Alias for parse
.
parseSignatures :: ByteString -> Either InvalidSignature ([UnknownSignature], Signatures) Source #
Alias for parse
.
pattern AsymmetricVerifier :: PublicKey -> Verifier Source #
Alias for Asymmetric
.
parseSigner :: ByteString -> Either InvalidSigner Signer Source #
Alias for parse
.
pattern AsymmetricSigner :: SecretKey -> Signer Source #
Alias for Asymmetric
.
pattern AsymmetricSignature :: AsymmetricSignature -> Signature Source #
Alias for Asymmetric
.
pattern SymmetricSignature :: SymmetricSignature -> Signature Source #
Alias for Symmetric
.