clavex-webhooks (Python)
Webhook signature verification for the Clavex Identity Platform.
Installation
pip install clavex-webhooks
Usage
from clavex_webhooks import Webhook, WebhookVerificationError
wh = Webhook("whsec_your_signing_secret")
# In your HTTP handler:
try:
payload = wh.verify(
body=request.body, # raw bytes or str
signature=request.headers["X-Clavex-Signature"], # sha256=<hex>
)
except WebhookVerificationError as exc:
return Response(str(exc), status=400)
import json
event = json.loads(payload)
print(event["type"]) # e.g. "user.created"
Django / Flask example
# Django
@csrf_exempt
def webhook(request):
wh = Webhook(settings.CLAVEX_WEBHOOK_SECRET)
try:
payload = wh.verify(request.body, request.headers.get("X-Clavex-Signature", ""))
except WebhookVerificationError:
return HttpResponse(status=400)
handle_event(json.loads(payload))
return HttpResponse(status=200)
API
Webhook(secret)
Create a verifier. secret may include the whsec_ prefix — it is stripped automatically.
webhook.verify(body, signature) → bytes
Verify and return the raw body. Raises WebhookVerificationError on failure.
verify(secret, signature, body) → bytes
Convenience one-shot function.
Signature format
Clavex sends X-Clavex-Signature: sha256=<HMAC-SHA256-hex> computed over the raw request body using your webhook secret.
Metadata
Release files for clavex-webhooks 1.0.0
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | |
|---|---|---|---|---|
| clavex_webhooks-1.0.0.tar.gz | 3.0 kB | With provenance | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| clavex_webhooks-1.0.0-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 5.8 kB
Release files / clavex_webhooks-1.0.0.tar.gz
| Download URL | clavex_webhooks-1.0.0.tar.gz |
|---|---|
| Size | 3.0 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
e621123c57aa6a681c43513130583ecbbea74ff797439279204a62f2d810f20f
|
|
BLAKE2b-256 checksum How to use checksums |
23edcf89bb6360ff7064477590e1a41dae603575343081c492216a7db1b395e8
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/6.1.0 CPython/3.13.12
|
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Jun 29, 2026.
Transparency logRelease files / clavex_webhooks-1.0.0-py3-none-any.whl
| Download URL | clavex_webhooks-1.0.0-py3-none-any.whl |
|---|---|
| Size | 2.8 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
73d173ac5429a212bd4055891041974881eb6d32a691c8198554ca30ef11dacd
|
|
BLAKE2b-256 checksum How to use checksums |
c51f60f5f0e5d85f895b839fdb73664d53194db3643fbf77b339962a01438760
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/6.1.0 CPython/3.13.12
|
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Jun 29, 2026.
Transparency logSecurity for clavex-webhooks 1.0.0
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
Full provenance
All 2 files in this release have been uploaded with provenance metadata.
Attestation for clavex_webhooks-1.0.0.tar.gz
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Jun 29, 2026.
Transparency logA note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.