wip: apply auth-hardening (interrupted by session end)

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
2026-11-17 16:22:11 +03:00
co-authored by Claude Opus 5.5
parent f014f7bc0d
commit cf0f6256d3
26 changed files with 1728 additions and 64 deletions
+19
View File
@@ -93,6 +93,25 @@ class FakeUserRepository(_FakeRepository, AbstractUserRepository):
) -> dataclasses.UserCredentialsDTO | None:
return self._db.credentials.get(username)
async def update_password_hash(
self,
*,
user_id: UUID,
old_hash: str,
new_hash: str,
) -> bool:
user = self._db.users.get(user_id)
if user is None:
return False
stored = self._db.credentials[user.username]
if stored.password_hash != old_hash:
return False
self._db.credentials[user.username] = dataclasses.UserCredentialsDTO(
user=user,
password_hash=new_hash,
)
return True
async def get_existing_user_ids(
self,
*,