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
- Original
validatesns
: https://github.com/nathforge/validatesns
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Close
Hashes for validate_aws_sns_message-0.9.0.tar.gz
Algorithm | Hash digest | |
---|---|---|
SHA256 | 099e073c0aaf66a5e294ff71c91dbdbc32583addb1b761ee42ea8ea2de1339cc |
|
MD5 | a1963c672755613eb38a93c01b88a581 |
|
BLAKE2b-256 | d40612cdd3d0d573941a21dc1eccd621ce372eb377246720d78fc428f29d70d9 |
Close
Hashes for validate_aws_sns_message-0.9.0-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 3da7364c18ae54014b741e8d0ea854fb9a6966212ea96f6676a380df2d6fa98f |
|
MD5 | 4be1257821481d8cdfc16cd18f70116d |
|
BLAKE2b-256 | d0203178770574bddf46262dfaa3142cc7d527a55a79cb3ae985dd2c2db6c689 |