Skip to main content

validatesns

Validate integrity of Amazon SNS messages.

  • 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.

CILink

Licence: MIT.

Quick start

$ pip install validatesns
import validatesns

# Raise validatesns.ValidationError if message is invalid.
validatesns.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/nathforge/validatesns

Metadata

Release files for validatesns 0.1.1

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for validatesns 0.1.1
File Size Uploaded Provenance Actions
validatesns-0.1.1.tar.gz 3.7 kB Without provenance Details for validatesns-0.1.1.tar.gz

Release files / validatesns-0.1.1.tar.gz

Download URL validatesns-0.1.1.tar.gz
Size 3.7 kB
Tags Source
SHA-256 checksum
How to use checksums
8596c0d0df88e9ba01da657b784262381ac0ff87097808d408bd883c36710493
BLAKE2b-256 checksum
How to use checksums
370b853d508150da9f568fdb6b2a510da1c869c7efb9643af363d8ddf1090b0b
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No

Security for validatesns 0.1.1

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Release history Release notifications | RSS feed

This release

0.1.1 This release

1 release file No provenance

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page