FastAPI SDK adapter for saastore HMAC-signed identity headers
Project description
saastore-fastapi
FastAPI dependency that authenticates incoming requests via HMAC-signed identity headers issued by the saastore edge proxy.
Install
pip install saastore-fastapi
Use
from fastapi import Depends, FastAPI
from saastore_fastapi import SaastoreUser, saastore_user
app = FastAPI()
@app.get("/dashboard")
def dashboard(user: SaastoreUser = Depends(saastore_user)):
return {"email": user.email, "plan": user.plan}
Environment
| Variable | Required | Description |
|---|---|---|
SAASTORE_HMAC_SECRET |
Yes | Provided by saastore at container provision time. 64-character hex string. |
What this rejects
- Missing identity headers — 401
- Bad signature — 401
- Timestamp more than 5 minutes off the container's clock — 401 (configurable freshness window in
verify.py) SAASTORE_HMAC_SECRETenv var unset — 500 (config error, not auth)
Wire format
See docs/superpowers/specs/2026-05-22-hosted-apps-poc-design.md section 5 in the saastore monorepo. The canonical signature string is user_id|email|plan|timestamp, signed with HMAC-SHA256 and hex-encoded.
Development
From the monorepo root:
cd sdks/saastore-fastapi
uv run --with fastapi --with httpx --with pytest pytest -v
License
MIT
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 saastore_fastapi-0.1.0.tar.gz.
File metadata
- Download URL: saastore_fastapi-0.1.0.tar.gz
- Upload date:
- Size: 25.8 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.12.11
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
7df91c57dc6e809a30fb7b67aa1a92b1e6d230caa8e8a793700f9de585bfbfcc
|
|
| MD5 |
6282c549ebabbc0b52c55540f770e211
|
|
| BLAKE2b-256 |
5f216e57b85ab8d558cfc78696b95d09752197baf6129a07ccf2646673903f8f
|
File details
Details for the file saastore_fastapi-0.1.0-py3-none-any.whl.
File metadata
- Download URL: saastore_fastapi-0.1.0-py3-none-any.whl
- Upload date:
- Size: 4.5 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.12.11
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
1c16335cfafb5538e5e7bd03416bf16fd4136b1ca7f2466f894d174882485511
|
|
| MD5 |
b9fa5604ed1667b0cd72a2ac955ccee5
|
|
| BLAKE2b-256 |
b12acdff08f88592a9be4e34acafad606fb6161ebb43cd0fd5ef704d26f89d41
|