Short, well documented utilities for interacting with webhooks.
Project description
Webhook Utils
A set of utilities for interacting with webhooks.
Installation
pip install webhook-utils
Usage
Crypto
Available hash algorithms for all methods are:
md5
(not recommended)sha1
sha256
(recommended)
Learn more about HMAC signatures here.
Generating HMAC signatures
Bare usage:
from webhook_utils.crypto import generate_sha256_signature
print(generate_sha256_signature(b'secret-key', b'some-message'))
Comparing HMAC signatures
Bare usage:
from webhook_utils.crypto import compare_sha256_signature
is_valid_signature = compare_sha256_signature(
b'secret-key',
b'some-message',
'expected-signature',
)
if not is_valid_signature:
raise ValueError('Invalid signature')
Publishing to PYPI
poetry build
# Verify that everything looks correct on test.pypi.org
poetry publish -r testpypi
poetry publish
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
webhook-utils-0.1.0.tar.gz
(3.0 kB
view hashes)
Built Distribution
Close
Hashes for webhook_utils-0.1.0-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 99727551904cafe507d4fddcb053b2be5ae7ae1c6a1bf84baebee260d8afab28 |
|
MD5 | b1c70d9e6d0eb970a414586a7a302129 |
|
BLAKE2b-256 | 6511cb425116566256c9a96d814354352f3932759dc1a0c9367a78f9a020f3c1 |