Skip to main content

Implements 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


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

requests-websub-auth-0.0.5.tar.gz (6.4 kB view details)

Uploaded Source

Built Distribution

requests_websub_auth-0.0.5-py3-none-any.whl (6.8 kB view details)

Uploaded Python 3

File details

Details for the file requests-websub-auth-0.0.5.tar.gz.

File metadata

  • Download URL: requests-websub-auth-0.0.5.tar.gz
  • Upload date:
  • Size: 6.4 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.1 CPython/3.9.13

File hashes

Hashes for requests-websub-auth-0.0.5.tar.gz
Algorithm Hash digest
SHA256 674ee08183092ffdc9637827ca5e6ebf6d13147eb59eee1320b5f1edb6117bf6
MD5 0182be32fddb598f37e7142d4387f072
BLAKE2b-256 08042953b6009b3d78e7f29db0e70f93906322d9e03eed42849de8eb10d6bace

See more details on using hashes here.

File details

Details for the file requests_websub_auth-0.0.5-py3-none-any.whl.

File metadata

File hashes

Hashes for requests_websub_auth-0.0.5-py3-none-any.whl
Algorithm Hash digest
SHA256 66702189071836088a4fe0455786b2a5675bec5f92512c3b9b6e511b857f396a
MD5 8e1f92a67b0c8283597098e9cda8e941
BLAKE2b-256 484a27de401fb4d3d63b2f85995ea8b34ed5903af222698ceccac85ac2fa1bc3

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page