Skip to main content

A lightweight, resilient webhook sender and receiver.

Project description

LazyHooks

A lightweight, standalone Python package for sending and receiving webhooks with optional persistence.

Full Documentation & Examples on GitHub

Features

  • Simple API: Send webhooks with minimal boilerplate.
  • Async First: Built on asyncio and aiohttp for high performance.
  • Secure: HMAC-SHA256 signing with Timestamp Replay Protection.
  • Reliable: Optional SQLite storage to persist and retry failed webhooks.

Security

LazyHooks prioritizes security by design:

  • Replay Protection: All webhooks include a timestamp. Requests older than 5 minutes are rejected.
  • HMAC-SHA256: Signatures verify both the body and the timestamp (timestamp.body) to prevent tampering.
  • Constant-Time Verification: Prevents timing attacks.
  • SQL Injection Safe: Parameterized queries.

headers:

  • X-Lh-Timestamp: Unix timestamp of the request.
  • X-Lh-Signature: v1=... (HMAC of timestamp.body)

Documentation

Quick Example

Sending

import asyncio
from lazyhooks import WebhookSender

async def main():
    sender = WebhookSender(signing_secret="super-secret")
    await sender.send("https://example.com/webhook", {"event": "hello"})

asyncio.run(main())

Receiving

from lazyhooks import verify_signature

def handle_webhook(request):
    timestamp = request.headers.get("X-Lh-Timestamp")
    signature = request.headers.get("X-Lh-Signature")
    body = request.body
    
    if verify_signature(body, signature, "super-secret", timestamp):
        return "OK", 200
    else:
        return "Invalid Signature or Timestamp", 401

Links

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

lazyhooks-0.2.0.tar.gz (8.9 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

lazyhooks-0.2.0-py3-none-any.whl (9.5 kB view details)

Uploaded Python 3

File details

Details for the file lazyhooks-0.2.0.tar.gz.

File metadata

  • Download URL: lazyhooks-0.2.0.tar.gz
  • Upload date:
  • Size: 8.9 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.13.5

File hashes

Hashes for lazyhooks-0.2.0.tar.gz
Algorithm Hash digest
SHA256 26aa080956a16e6766fa8857855e59734f3421a8d1986a899b3bdfb878dcd894
MD5 1a4d96ceafd3a222fa9a153a1276a2a0
BLAKE2b-256 398ba858413406d882778069a2067cd0dc3d91718a59d25872e4d60dd695766d

See more details on using hashes here.

File details

Details for the file lazyhooks-0.2.0-py3-none-any.whl.

File metadata

  • Download URL: lazyhooks-0.2.0-py3-none-any.whl
  • Upload date:
  • Size: 9.5 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.13.5

File hashes

Hashes for lazyhooks-0.2.0-py3-none-any.whl
Algorithm Hash digest
SHA256 14aecd52788e7c5b337f1d3a8b935e2564a58e72789e69e007fc87806fd2c3e4
MD5 e0e36c3129e6ddffa7e733b0709439a3
BLAKE2b-256 2052d451e89190ecc6e3e153fcb4b487ee981fa62b9180a36cd7d26c4fc0563a

See more details on using hashes here.

Supported by

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