MIT licensed by Freckle
This version can be pinned in stack with:aws-sns-verify-0.0.0.3@sha256:f95fd9b417d25925afff7f16f59362d015bbd8ecb6f64df73cae4e85b428ecab,4366
Module documentation for 0.0.0.3
- Amazon
- Amazon.SNS
- Amazon.SNS.Verify
- Amazon.SNS.Verify.Payload
- Amazon.SNS.Verify.ValidURI
- Amazon.SNS.Verify.Validate
Depends on 12 packages
(full list with versions):
aeson,
base,
bytestring,
crypton-x509,
crypton-x509-validation,
errors,
http-conduit,
memory,
network-uri,
pem,
regex-tdfa,
text aws-sns-verify
Consumers utilizing SNS need to do 3 tasks:
- Parse the message JSON
- Validate signed signatures
- Handle subscriptions
This library encapsulates those actions.
myEchoWebhook :: MonadHandler m => m ()
myEchoWebhook = do
message <- verifySNSMessage =<< requireInsecureJsonBody
logDebugN message
Sign For Test
Signatures for testing are produced with the self signed certificate in this
repository.
cat unsigned.txt | openssl dgst -sha1 -sign tests/key.pem | openssl base64
The certificate was produced with
openssl req -newkey rsa:2048 -new -nodes -x509 -days 3650 -keyout tests/key.pem -out tests/cert.pem
- Migrate to
crypton-x509*
- Remove CI for GHC’s 8.6 and 8.8
- Validate PEM has come from AWS before checking signature.
- Fix typo in subscribe signature
- Initial release.
- Handle JSON parsing.
- Handle validation of payload signatures via X509.
- Handle response to subscription messages.