agios-auth-verify
FastAPI dependency that checks an RBAC permission straight off the access-token JWT — decode the token, read the caller's permissions from its claims, allow the request only if the required permission is present. No configuration.
Install
pip install agios-auth-verify
Requires fastapi.
Usage
from fastapi import Depends, FastAPI
from auth_verify import authorize
app = FastAPI()
@app.delete("/users/{user_id}", dependencies=[Depends(authorize("users:delete"))])
async def delete_user(user_id: str):
return {"ok": True}
The token is read from the access_token cookie or an Authorization: Bearer <token> header. The JWT payload is base64-decoded (signature not verified);
its permissions come from the permissions claim (also accepts scope /
scopes, space-delimited).
On success the dependency returns
{"success": true, "userId": ..., "email": ..., "permissionKey": ...}, so it can
also be injected as a value:
@app.delete("/users/{user_id}")
async def delete_user(user_id: str, auth=Depends(authorize("users:delete"))):
return {"ok": True, "actor": auth["userId"]}
Responses
Raises fastapi.HTTPException with body {"success": false, "message": ...}:
| Status | When |
|---|---|
401 |
No token, or the token payload is unreadable |
403 |
The permission is not in the token's claims |
Build
python -m build
Metadata
Release files for agios-auth-verify 0.0.2
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 | |
|---|---|---|---|---|
| agios_auth_verify-0.0.2.tar.gz | 3.5 kB | Without provenance | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| agios_auth_verify-0.0.2-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 6.6 kB
Release files / agios_auth_verify-0.0.2.tar.gz
| Download URL | agios_auth_verify-0.0.2.tar.gz |
|---|---|
| Size | 3.5 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
3dddebc31a9e004008f267a8887732a4883c088fe14854deb999fab15b6558a9
|
|
BLAKE2b-256 checksum How to use checksums |
d57544ed4aae3dd034ab96e59d4d5c728b7da592e46349d960ec40d5ea49a2eb
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/7.0.0 CPython/3.14.7
|
Release files / agios_auth_verify-0.0.2-py3-none-any.whl
| Download URL | agios_auth_verify-0.0.2-py3-none-any.whl |
|---|---|
| Size | 3.1 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
c6fd42737981ef07c304e5e5780757230ab698d8ddbbac33edf88a6bb9c2087f
|
|
BLAKE2b-256 checksum How to use checksums |
810c7096d084650e9be6ca9bc5aaff91e837d0620982715841295e77b5a54b47
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/7.0.0 CPython/3.14.7
|
Security for agios-auth-verify 0.0.2
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.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A 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.
To learn more about protecting yourself from malicious actors, visit our package security documentation.