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]— sharedRedisReplayStorefor 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/.
Site docs: webhooks how-to.
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
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file authweave_webhooks-8.0.2.tar.gz.
File metadata
- Download URL: authweave_webhooks-8.0.2.tar.gz
- Upload date:
- Size: 12.6 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via:
twine/7.0.0 CPython/3.13.14
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
64f4911abe7522ca367fb54f328d3aa089a23b71671263dd72ad910c97542d05
|
|
| MD5 |
cbefe151b3c119a5a76f7eeb24436c62
|
|
| BLAKE2b-256 |
fb023956ac30b6660e1635f2ec5feec14448e4a54a76e9eb63623211ef33a286
|
Provenance
The following attestation bundles were made for authweave_webhooks-8.0.2.tar.gz:
Publisher:
3_release.yml on ZYLVEXT/litestar-auth
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
authweave_webhooks-8.0.2.tar.gz -
Subject digest:
64f4911abe7522ca367fb54f328d3aa089a23b71671263dd72ad910c97542d05 - Sigstore transparency entry: 2585615606
- Sigstore integration time:
-
Permalink:
ZYLVEXT/litestar-auth@4f1fb16c3bfd3cd278e3cb733c9c62b7299611cd -
Branch / Tag:
refs/tags/8.0.2 - Owner: https://github.com/ZYLVEXT
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
3_release.yml@4f1fb16c3bfd3cd278e3cb733c9c62b7299611cd -
Trigger Event:
workflow_dispatch
-
Statement type:
File details
Details for the file authweave_webhooks-8.0.2-py3-none-any.whl.
File metadata
- Download URL: authweave_webhooks-8.0.2-py3-none-any.whl
- Upload date:
- Size: 17.6 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via:
twine/7.0.0 CPython/3.13.14
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
86cdf3c249efb06a41c611214a64357f249711c090c1b5027b311d5c9b6001a0
|
|
| MD5 |
29450f62b687f48677d3eb4c2eb9a1ec
|
|
| BLAKE2b-256 |
afba95982537643e8141a57def1eac10a3a883f8b0f4f546bac91d4106a799ea
|
Provenance
The following attestation bundles were made for authweave_webhooks-8.0.2-py3-none-any.whl:
Publisher:
3_release.yml on ZYLVEXT/litestar-auth
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
authweave_webhooks-8.0.2-py3-none-any.whl -
Subject digest:
86cdf3c249efb06a41c611214a64357f249711c090c1b5027b311d5c9b6001a0 - Sigstore transparency entry: 2585615994
- Sigstore integration time:
-
Permalink:
ZYLVEXT/litestar-auth@4f1fb16c3bfd3cd278e3cb733c9c62b7299611cd -
Branch / Tag:
refs/tags/8.0.2 - Owner: https://github.com/ZYLVEXT
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
3_release.yml@4f1fb16c3bfd3cd278e3cb733c9c62b7299611cd -
Trigger Event:
workflow_dispatch
-
Statement type: