forked from mtusi2026/mtusi2026lab7
Перевести пароли на Argon2id и читать секреты через AppRole.
Лимит входа общий для реплик, размер тела ограничен, исходящие клиенты проверяют TLS, если задан CA. Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
@@ -91,6 +91,18 @@ async def get_user(user_id: str) -> Optional[dict]:
|
||||
return user_dict(row) if row else None
|
||||
|
||||
|
||||
async def update_password_hash(user_id, password_hash: str) -> None:
|
||||
try:
|
||||
async with db.require().acquire() as conn:
|
||||
await conn.execute(
|
||||
"UPDATE users SET password_hash = $2 WHERE id = $1",
|
||||
user_id,
|
||||
password_hash,
|
||||
)
|
||||
except Exception:
|
||||
raise AppError(503, "service unavailable") from None
|
||||
|
||||
|
||||
async def get_user_by_username(username: str):
|
||||
return await _run(
|
||||
_fetchrow(
|
||||
|
||||
Reference in New Issue
Block a user