selfprivacy-rest-api/selfprivacy_api/models/user.py

28 lines
657 B
Python
Raw Normal View History

from enum import Enum
from pydantic import BaseModel
2024-11-11 17:37:17 +00:00
from typing import Optional
class UserDataUserOrigin(Enum):
"""Origin of the user in the user data"""
NORMAL = "NORMAL"
PRIMARY = "PRIMARY"
ROOT = "ROOT"
class UserDataUser(BaseModel):
"""The user model from the userdata file"""
2024-11-11 17:47:31 +00:00
username: str
2024-11-15 00:19:24 +00:00
2024-12-04 15:15:03 +00:00
ssh_keys: Optional[list[str]] = []
user_type: Optional[UserDataUserOrigin] = None
displayname: Optional[str] = (
None # in logic graphql will return "username" if "displayname" None
)
email: Optional[str] = None
directmemberof: Optional[list[str]] = None
memberof: Optional[list[str]] = None