Renaming of users in registration, profile and admin app.

This commit is contained in:
Leo Vasanko
2025-09-01 18:13:01 -06:00
parent bc87f76d11
commit 37eaffff3f
9 changed files with 232 additions and 21 deletions

View File

@@ -100,6 +100,10 @@ class DatabaseInterface(ABC):
async def create_user(self, user: User) -> None:
"""Create a new user."""
@abstractmethod
async def update_user_display_name(self, user_uuid: UUID, display_name: str) -> None:
"""Update a user's display name."""
# Role operations
@abstractmethod
async def create_role(self, role: Role) -> None:
@@ -312,6 +316,27 @@ class DatabaseInterface(ABC):
async def get_session_context(self, session_key: bytes) -> SessionContext | None:
"""Get complete session context including user, organization, role, and permissions."""
# Combined atomic operations
@abstractmethod
async def create_credential_session(
self,
user_uuid: UUID,
credential: Credential,
reset_key: bytes | None,
session_key: bytes,
session_expires: datetime,
session_info: dict,
display_name: str | None = None,
) -> None:
"""Atomically add a credential and create a session.
Steps (single transaction):
1. Insert credential
2. Optionally delete old session (e.g. reset token) if provided
3. Optionally update user's display name
4. Insert new session referencing the credential
"""
__all__ = [
"User",