Verify bolthub gateway signatures on your origin — Flask, Django, FastAPI middleware
Project description
bolthub-verify
Verify bolthub gateway signatures on your origin server. Supports Flask, Django, and FastAPI out of the box.
Install
pip install bolthub-verify
Quick start (Flask)
from bolthub_verify import flask_hmac_middleware
app.before_request(flask_hmac_middleware("your-hmac-secret-from-dashboard"))
Quick start (FastAPI)
from fastapi import Depends
from bolthub_verify import fastapi_hmac_middleware
verify = fastapi_hmac_middleware("your-hmac-secret-from-dashboard")
@app.get("/protected")
async def protected(_=Depends(verify)):
return {"ok": True}
Quick start (Django)
# settings.py
MIDDLEWARE = [
"bolthub_verify.django_hmac_middleware",
# ...
]
BOLTHUB_HMAC_SECRETS = ["current-secret", "previous-secret"]
Secret rotation
Pass an array of secrets (current + previous) to support zero-downtime rotation:
flask_hmac_middleware(["new-secret", "old-secret"])
Low-level API
from bolthub_verify import verify_gateway_signature
result = verify_gateway_signature(
method="GET",
path="/v1/data",
signature=request.headers["X-Gateway-Signature"],
timestamp=request.headers["X-Gateway-Timestamp"],
nonce=request.headers["X-Gateway-Nonce"],
body="",
secrets="your-secret",
)
if not result.valid:
print(result.error)
Project details
Release history Release notifications | RSS feed
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 bolthub_verify-0.1.1.tar.gz.
File metadata
- Download URL: bolthub_verify-0.1.1.tar.gz
- Upload date:
- Size: 3.8 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
f9678b5fd29d63e7ddc009609cc3b971e527a6e0f8d092b8afa76780f08f555a
|
|
| MD5 |
80c36366bbf46872dd1cad398638f23e
|
|
| BLAKE2b-256 |
46682be0e1e6fa29db04a0a9041f54e9b15afead2589e461b285ad6184ddfc58
|
Provenance
The following attestation bundles were made for bolthub_verify-0.1.1.tar.gz:
Publisher:
publish.yml on signaltech-org/bolthub-sdk
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
bolthub_verify-0.1.1.tar.gz -
Subject digest:
f9678b5fd29d63e7ddc009609cc3b971e527a6e0f8d092b8afa76780f08f555a - Sigstore transparency entry: 1776305411
- Sigstore integration time:
-
Permalink:
signaltech-org/bolthub-sdk@2c200f6319c2f8b7c3a3379e6c525a9eb9ab7534 -
Branch / Tag:
refs/tags/v0.1.3 - Owner: https://github.com/signaltech-org
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish.yml@2c200f6319c2f8b7c3a3379e6c525a9eb9ab7534 -
Trigger Event:
push
-
Statement type:
File details
Details for the file bolthub_verify-0.1.1-py3-none-any.whl.
File metadata
- Download URL: bolthub_verify-0.1.1-py3-none-any.whl
- Upload date:
- Size: 3.5 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
67144b89b14433778c405504ae7ec2e65b73d9bd44eb02438adbd6a5653560fc
|
|
| MD5 |
c38c347573d00c12267ef9d07d90dcf0
|
|
| BLAKE2b-256 |
7e4b71ab09de17496b48970f53bce76a9f90a396e917a205ec8913520de52219
|
Provenance
The following attestation bundles were made for bolthub_verify-0.1.1-py3-none-any.whl:
Publisher:
publish.yml on signaltech-org/bolthub-sdk
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
bolthub_verify-0.1.1-py3-none-any.whl -
Subject digest:
67144b89b14433778c405504ae7ec2e65b73d9bd44eb02438adbd6a5653560fc - Sigstore transparency entry: 1776305470
- Sigstore integration time:
-
Permalink:
signaltech-org/bolthub-sdk@2c200f6319c2f8b7c3a3379e6c525a9eb9ab7534 -
Branch / Tag:
refs/tags/v0.1.3 - Owner: https://github.com/signaltech-org
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish.yml@2c200f6319c2f8b7c3a3379e6c525a9eb9ab7534 -
Trigger Event:
push
-
Statement type: