@hackage aws-sns-verify0.0.0.3
Parse and verify AWS SNS messages
Categories
License
MIT
Maintainer
engineering@freckle.com
Links
Versions
Installation
Dependencies (12)
- aeson
- base >=4.7 && <5
- bytestring >=0.10.8.2
- crypton-x509
- crypton-x509-validation
- errors Show all…
Dependents (0)
Package Flags
development
(off by default)
Configure of testing
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