cloud-api/src/user/schemas.py
2026-05-28 14:55:44 +01:00

58 lines
No EOL
915 B
Python

"""
Pydantic models for the user module
"""
from typing import Optional
from src.schemas import CustomBaseModel
class UserIDMixin(CustomBaseModel):
user_id: int
class OIDCClaims(CustomBaseModel):
exp: int
iat: int
auth_time: int
jti: str
iss: str
aud: str
sub: str
typ: str
azp: str
sid: str
acr: str
allowed_origins: list[str]
realm_access: dict[str, list[str]]
resource_access: dict[str, dict[str, list[str]]]
scope: str
email_verified: bool
name: str
preferred_username: str
given_name: str
family_name: str
email: str
db_id: int
class OIDCUser(CustomBaseModel):
first_name: str
last_name: str
email: str
oidc_id: str
class UserResponse(CustomBaseModel):
first_name: str
last_name: str
email: str
organisations: list[Optional[str]]
groups: dict[str, list[str]]
class OrgResponse(CustomBaseModel):
org_id: int
name: str
class UserDeleteUserRequest(UserIDMixin):
pass