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.2.0.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.2.0-py3-none-any.whl (17.2 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: authweave_webhooks-7.2.0.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.2.0.tar.gz
Algorithm Hash digest
SHA256 11f51a8bd52ce53a5afcd894e0cd73354a159f39293f5b3192462d0fa8d2ad35
MD5 f81930e517235a3a00d26ca3455287be
BLAKE2b-256 20d8cff1b0159df5d944220797d501efc21bf3e3ce84e4564febbb14909e516a

See more details on using hashes here.

Provenance

The following attestation bundles were made for authweave_webhooks-7.2.0.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.2.0-py3-none-any.whl.

File metadata

File hashes

Hashes for authweave_webhooks-7.2.0-py3-none-any.whl
Algorithm Hash digest
SHA256 e8ecded8e1e1c635eb7a534d846adf89a4bfa86c9fe1a23238df9ce5836e6fc8
MD5 8edf7319fee9ee65511780812342451f
BLAKE2b-256 c311cde8d93b4e5c4d2e2fda342b42e45276feb0156e06a385f2ef51f288bd62

See more details on using hashes here.

Provenance

The following attestation bundles were made for authweave_webhooks-7.2.0-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

7.3.4

2 files

7.3.3

2 files

7.3.2

2 files

7.3.1

2 files

7.3.0

2 files

This release

7.2.0 This release

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