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 hashes)

Uploaded Source

Built Distribution

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

Uploaded Python 3

Supported by

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