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.
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
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
validatesns-0.1.1.tar.gz
(3.7 kB
view details)
File details
Details for the file validatesns-0.1.1.tar.gz.
File metadata
- Download URL: validatesns-0.1.1.tar.gz
- Upload date:
- Size: 3.7 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
8596c0d0df88e9ba01da657b784262381ac0ff87097808d408bd883c36710493
|
|
| MD5 |
a3bdbbd36aaed2a56f7c30a78a4c028d
|
|
| BLAKE2b-256 |
370b853d508150da9f568fdb6b2a510da1c869c7efb9643af363d8ddf1090b0b
|