попытка оптимизации и ДЖЛЫВОСШФРСЖДЛВОФЖДЛОВСМДЖЛФ ИНТЕРФЕЙС ФИКСЕСССС БЛЯЯЯ

This commit is contained in:
SashegDev
2026-05-10 01:24:47 +00:00
parent 389280f7f1
commit 2c670b1103
9 changed files with 605 additions and 244 deletions
+7 -14
View File
@@ -822,20 +822,13 @@ async def activate_pass_page():
# ====================== ЭНДПОИНТЫ ДЛЯ ПАКОВ ======================
@app.get("/packs")
async def list_packs(request: Request):
"""List all available packs - requires auth or master key for mirrors"""
# Check for master key
master_key = request.headers.get("X-Master-Key")
if master_key == MASTER_KEY:
# Master key - allow access
pass
else:
# Normal auth required
current_user = await get_current_user(request)
if not current_user:
raise HTTPException(401, "Authentication required")
if not has_permission(current_user["role"], Permissions.VIEW_PACKS):
raise HTTPException(403, "Requires active pass")
async def list_packs(
request: Request,
current_user: dict = Depends(get_current_user)
):
"""List all available packs - requires auth"""
if not has_permission(current_user["role"], Permissions.VIEW_PACKS):
raise HTTPException(403, "Requires active pass")
packs = []