ЛР 7: безопасность, mTLS и OpenBao на оценку 3
Skeleton contracts / contracts (pull_request) Blocked by required conditions

This commit is contained in:
2026-12-06 15:19:24 +03:00
parent 20afc2c790
commit 280c5a3300
101 changed files with 5950 additions and 63 deletions
+34
View File
@@ -0,0 +1,34 @@
from fastapi import APIRouter
from fastapi import HTTPException
from sqlalchemy import text
from app.database import async_session_maker
from app.redis_client import redis_client
router = APIRouter(tags=["health"])
@router.get("/health/live")
def live():
return {"status": "ok"}
@router.get("/health/ready")
async def ready():
try:
async with async_session_maker() as session:
await session.execute(text("SELECT 1"))
await redis_client.ping()
return {"status": "ok"}
except Exception:
raise HTTPException(status_code=503, detail="unavailable")
@router.get("/")
def home():
return {
"service": "MTUSI Messenger",
"version": "1.1.0",
"docs": "/docs",
}