AuthTuna — современный асинхронный фреймворк безопасности для Python.
pip install authtuna fastapi uvicorn[standard] asyncpg aiosqlite python-dotenv
from fastapi import FastAPI, Depends
from authtuna.middlewares.session import DatabaseSessionMiddleware
from authtuna.integrations.fastapi_integration import get_current_user
app = FastAPI()
app.add_middleware(DatabaseSessionMiddleware)
@app.get("/me")
async def me(user=Depends(get_current_user)):
return {"id": user.id, "username": user.username}
#Python #FastAPI #Security #Auth #RBAC #SSO #MFA #Async #DevTools #OpenSource
https://github.com/shashstormer/authtuna
Please open Telegram to view this post
VIEW IN TELEGRAM
GitHub
GitHub - shashstormer/AuthTuna: This is a plug and play auth library with features enough for all purposes from simple auth to…
This is a plug and play auth library with features enough for all purposes from simple auth to SSO, RBAC and passkeys while the core is framework agnostic it is specialized for fastapi. - shashsto...
1⚡3🔥2 2