Реализовать ЛР 7 на оценку 4
Skeleton contracts / contracts (pull_request) Blocked by required conditions

This commit is contained in:
2026-12-04 16:15:18 +03:00
parent 7996ebbb48
commit 94a8a5c1da
29 changed files with 918 additions and 85 deletions
+9 -1
View File
@@ -60,7 +60,15 @@ async def create_session(
headers={'Retry-After': str(retry_after)},
)
username, password = _parse_basic(authorization)
user = await users.authenticate(username, password)
slots = request.app.state.login_slots
if slots.locked():
raise HTTPException(
status_code=429,
detail='все слоты проверки пароля заняты',
headers={'Retry-After': '1'},
)
async with slots:
user = await users.authenticate(username, password)
if user is None:
raise _unauthorized_basic()
token = create_token()