Skip to main content

Validate integrity of Amazon SNS messages (Refined)

Project description

validate_aws_sns_message

Validate integrity of Amazon SNS messages.

Refined from validatesns.

  • Verifies cryptographic signature.
  • Checks signing certificate is hosted on an Amazon-controlled URL.
  • Requires message be no older than one hour, the maximum lifetime of an SNS message.

Licence: MIT

Quick start

pip install validate_aws_sns_message
import validate_aws_sns_message

# Raise validate_aws_sns_message.ValidationError if message is invalid.
validate_aws_sns_message.validate(decoded_json_message_from_sns)

Gotchas

The validate function downloads the signing certificate on every call. For performance reasons, it's worth caching certificates - you can do this by passing in a get_certificate function.

This takes a url, and returns the certificate content. Your function could cache to the filesystem, a database, or wherever makes sense.

Contribute

Github: https://github.com/kenichi-ogawa-1988/validate_aws_sns_message

Special thanks

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

validate_aws_sns_message-0.9.0.tar.gz (3.8 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

validate_aws_sns_message-0.9.0-py3-none-any.whl (4.9 kB view details)

Uploaded Python 3

File details

Details for the file validate_aws_sns_message-0.9.0.tar.gz.

File metadata

  • Download URL: validate_aws_sns_message-0.9.0.tar.gz
  • Upload date:
  • Size: 3.8 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/1.13.0 pkginfo/1.5.0.1 requests/2.20.0 setuptools/41.0.1 requests-toolbelt/0.9.1 tqdm/4.32.2 CPython/3.6.6

File hashes

Hashes for validate_aws_sns_message-0.9.0.tar.gz
Algorithm Hash digest
SHA256 099e073c0aaf66a5e294ff71c91dbdbc32583addb1b761ee42ea8ea2de1339cc
MD5 a1963c672755613eb38a93c01b88a581
BLAKE2b-256 d40612cdd3d0d573941a21dc1eccd621ce372eb377246720d78fc428f29d70d9

See more details on using hashes here.

File details

Details for the file validate_aws_sns_message-0.9.0-py3-none-any.whl.

File metadata

  • Download URL: validate_aws_sns_message-0.9.0-py3-none-any.whl
  • Upload date:
  • Size: 4.9 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/1.13.0 pkginfo/1.5.0.1 requests/2.20.0 setuptools/41.0.1 requests-toolbelt/0.9.1 tqdm/4.32.2 CPython/3.6.6

File hashes

Hashes for validate_aws_sns_message-0.9.0-py3-none-any.whl
Algorithm Hash digest
SHA256 3da7364c18ae54014b741e8d0ea854fb9a6966212ea96f6676a380df2d6fa98f
MD5 4be1257821481d8cdfc16cd18f70116d
BLAKE2b-256 d0203178770574bddf46262dfaa3142cc7d527a55a79cb3ae985dd2c2db6c689

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page