https://github.com/freckle/aws-sns-verify
Parse and verify AWS SNS messages
https://github.com/freckle/aws-sns-verify
aws haskell sns terraform-managed x509
Last synced: about 1 month ago
JSON representation
Parse and verify AWS SNS messages
- Host: GitHub
- URL: https://github.com/freckle/aws-sns-verify
- Owner: freckle
- License: mit
- Created: 2022-05-31T23:10:24.000Z (almost 3 years ago)
- Default Branch: main
- Last Pushed: 2024-05-31T14:34:00.000Z (12 months ago)
- Last Synced: 2024-10-06T01:47:02.568Z (8 months ago)
- Topics: aws, haskell, sns, terraform-managed, x509
- Language: Haskell
- Homepage: https://hackage.haskell.org/package/aws-sns-verify
- Size: 47.9 KB
- Stars: 1
- Watchers: 12
- Forks: 2
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
- Changelog: CHANGELOG.md
- License: LICENSE
Awesome Lists containing this project
README
# aws-sns-verify
Consumers utilizing SNS need to do 3 tasks:
1. Parse the message JSON
2. Validate signed signatures
3. Handle subscriptionsThis library encapsulates those actions.
```hs
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.```sh
cat unsigned.txt | openssl dgst -sha1 -sign tests/key.pem | openssl base64
```The certificate was produced with
```sh
openssl req -newkey rsa:2048 -new -nodes -x509 -days 3650 -keyout tests/key.pem -out tests/cert.pem
```