Implents WebSub X-Hub-Signature authentication for the Python Requests library
Project description
requests-websub-auth
A micro-library providing WebSub HMAC Signature authentication for webhooks.
The HMAC signature is generated using a secret and the webhook body. It is placed
in the X-Hub-Signature
header in the format <algorithm>=<hmac_signature>
, where the
hmac_signature
is a hexdigest.
Supports all of the algorithms detailed in the WebSub specification.
Installation
pip install requests-websub-auth
Usage
import requests
from requests_websub_auth import WebSubAuth, WebSubAlgorithm
auth = WebSubAuth("secret", WebSubAlgorithm.SHA256)
payload = {
"foo": 1,
"bar": 2
}
response = requests.post("https://foobar.com/", auth=auth, json=payload)
response.raise_for_status()
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 requests-websub-auth-0.0.4.tar.gz
Algorithm | Hash digest | |
---|---|---|
SHA256 | 6073178ce4979dbf1b7bb72b68ed4a1361839047b48cd9861fae1d5c50db9b64 |
|
MD5 | ce6795d8c71442b73799060f757b4d40 |
|
BLAKE2b-256 | 20fa92237b12a0225ec1d6ff79541dcaba3bc1a53d2d4be5b42701806db51931 |
Close
Hashes for requests_websub_auth-0.0.4-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 83451ebe67f2c85942f8af1db095b707f871d3e8333702060c90113f8148d1d8 |
|
MD5 | 7ff71b9fac6f31c15d482cead7ecc667 |
|
BLAKE2b-256 | f6124822d0489398a05b324b991d5a062a51984c35b8a0d112dea92991747825 |