homepage: https://github.com/freckle/aws-sns-verify#readme
changelog-type: markdown
hash: 0bd6abb228cb0699259dbb5984f6adb4b7474c6b6e2b72784f69a6f283615383
test-bench-deps:
  warp: '>=3.2.25'
  aws-sns-verify: -any
  wai: '>=3.2.1.2'
  x509-validation: '>=1.6.11'
  base: '>=4.7 && <5'
  hspec: '>=2.5.5'
  text: '>=1.2.3.1'
  async: '>=2.2.1'
  aeson-qq: '>=0.8.2'
  http-types: '>=0.12.2'
maintainer: engineering@freckle.com
synopsis: ''
changelog: |
  ## [_Unreleased_](https://github.com/freckle/aws-sns-verify/compare/v0.0.0.0...main)

  ## [v0.0.0.0](https://github.com/freckle/aws-sns-verify/releases/tag/v0.0.0.0)

  - Initial release.
  - Handle JSON parsing.
  - Handle validation of payload signatures via X509.
  - Handle response to subscription messages.
basic-deps:
  bytestring: '>=0.10.8.2'
  x509-validation: '>=1.6.11'
  base: '>=4.7 && <5'
  text: '>=1.2.3.1'
  pem: '>=0.2.4'
  memory: '>=0.14.18'
  x509: '>=1.7.5'
  errors: '>=2.3.0'
  http-conduit: '>=2.3.2'
  aeson: '>=1.3.1.1'
all-versions:
- 0.0.0.0
author: Freckle
latest: 0.0.0.0
description-type: markdown
description: |
  # aws-sns-verify

  Consumers utilizing SNS need to do 3 tasks:

  1. Parse the message JSON
  2. Validate signed signatures
  3. Handle subscriptions

  This 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
  ```
license-name: MIT

Update from Hackage at 2022-06-02T17:55:37Z
Update from Hackage at 2022-06-02T17:55:37Z
