Skip to main content

authweave-webhooks

Asymmetric Standard Webhooks toolkit for AuthWeave integrations (authweave-standard-webhooks-v1a Ed25519 profile).

This package does not depend on litestar-auth and is not authentication middleware. It verifies or produces webhook deliveries before JSON parsing.

uv add 'authweave-webhooks[redis]'
from authweave_webhooks import (
    Ed25519PublicKey,
    PublicKeyDocument,
    StandardWebhooksVerifier,
    StaticPublicKeyResolver,
)
from authweave_webhooks.redis_store import RedisReplayStore

resolver = StaticPublicKeyResolver(
    PublicKeyDocument(
        version="1",
        environment="sandbox",
        owner="merchant-1",
        endpoint="https://merchant.example/hooks/payments",
        not_before=0,
        retire_after=None,
        keys=(Ed25519PublicKey(public_key),),
    )
)
verifier = StandardWebhooksVerifier(
    resolver,
    replay_store=RedisReplayStore(redis),
    expected_environment="sandbox",
    expected_owner="merchant-1",
    expected_endpoint="https://merchant.example/hooks/payments",
    time_source=lambda: 1_700_000_000,
)
verified = await verifier.verify(headers=headers, body=raw_body)

The replay store is mandatory. After a signature succeeds, verify() atomically claims the webhook-id in a namespace derived from environment, owner, endpoint, and id. The library derives a TTL that covers the complete inclusive timestamp acceptance window; replay-store outage or capacity pressure fails verification closed. A repeated valid delivery is returned with verified.replay_detected=True; the flag is telemetry, not business idempotency.

After every successful verification, atomically insert the complete raw body and verified metadata into a durable inbox with a unique key over environment, owner, endpoint, and webhook_id. Never overwrite an existing row, and acknowledge the HTTP delivery only after that transaction commits. A retry can then restore an inbox row missing after a crash, while a committed row absorbs concurrent or later retries. Use a shared replay store such as Redis in multi-worker deployments.

Pass an optional core SecurityObserver to the verifier or HTTP sender to emit bounded verification/replay/delivery telemetry. Retry and queue consumers may pass TraceCorrelation values through links=; trace context is correlation only and is never accepted as identity.

HttpxWebhookSender requires a non-empty exact endpoint allowlist, disables redirects, and streams at most 65,536 response bytes. The application must also place its HTTP client behind the controlled egress proxy/subnet described in the merchant sender threat model; DNS safety is not inferred from HTTPS syntax.

from authweave_webhooks.sender import HttpxWebhookSender

sender = HttpxWebhookSender(
    httpx_client,
    allowed_endpoints={"https://merchant.example/hooks/payments"},
)
result = await sender.send(endpoint=merchant_endpoint, delivery=delivery)

Extras

  • [redis] — shared RedisReplayStore for fail-closed verification
  • [httpx] — one-shot HTTPS sender without auto-retry
  • [litestar] — raw-body verification helper

Private keys stay inside AsyncMessageSigner implementations. The library never accepts private key bytes on verifier APIs and keeps secrets out of repr / error messages.

See docs/roadmap.md, docs/merchant/webhooks.md, the sender threat model, and ADR 0002 for key-tenancy and egress rules. Language-neutral vectors plus Python and dependency-free Node.js verifiers live in docs/vectors/webhooks/v1a/.

Download files

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

Source Distribution

authweave_webhooks-7.3.4.tar.gz (12.0 kB view details)

Uploaded Source

Built Distribution

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

authweave_webhooks-7.3.4-py3-none-any.whl (17.2 kB view details)

Uploaded Python 3

File details

Details for the file authweave_webhooks-7.3.4.tar.gz.

File metadata

  • Download URL: authweave_webhooks-7.3.4.tar.gz
  • Upload date:
  • Size: 12.0 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/7.0.0 CPython/3.13.14

File hashes

Hashes for authweave_webhooks-7.3.4.tar.gz
Algorithm Hash digest
SHA256 279baf60c6f63f8d83b6ea541e00d0302b6e9ddabd2917544e0c47ee6df55512
MD5 b67a6becd030b0ca3450f194c9aa45e4
BLAKE2b-256 c4ce16730176d65b3d4f418f221c5df2fcd350f750ccc49a17e0984c508466c4

See more details on using hashes here.

Provenance

The following attestation bundles were made for authweave_webhooks-7.3.4.tar.gz:

Publisher: 3_release.yml on ZYLVEXT/litestar-auth

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file authweave_webhooks-7.3.4-py3-none-any.whl.

File metadata

File hashes

Hashes for authweave_webhooks-7.3.4-py3-none-any.whl
Algorithm Hash digest
SHA256 7dfdd8e69367ee6e36d33989f68a0f409098f92672c2839293db951a51a2ae7c
MD5 87408367dd71800e3b1b3fc3ec4b9ffe
BLAKE2b-256 429c8fc269f931fda0ec8207e96a33c28f07ce3a0f53d837f960e99a98a114e0

See more details on using hashes here.

Provenance

The following attestation bundles were made for authweave_webhooks-7.3.4-py3-none-any.whl:

Publisher: 3_release.yml on ZYLVEXT/litestar-auth

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

Release history Release notifications | RSS feed

8.0.2

2 files

8.0.1

2 files

8.0.0

2 files

This release

7.3.4 This release

2 files

7.3.3

2 files

7.3.2

2 files

7.3.1

2 files

7.3.0

2 files

7.2.0

2 files

7.1.2

2 files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page