mirror of
https://git.selfprivacy.org/SelfPrivacy/selfprivacy-rest-api.git
synced 2025-01-30 20:56:39 +00:00
26 lines
624 B
Python
26 lines
624 B
Python
from enum import Enum
|
|
from pydantic import BaseModel
|
|
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"""
|
|
|
|
username: str
|
|
user_type: UserDataUserOrigin
|
|
ssh_keys: list[str] = []
|
|
directmemberof: Optional[list[str]] = []
|
|
memberof: Optional[list[str]] = []
|
|
displayname: Optional[str] = (
|
|
None # in logic graphql will return "username" if "displayname" None
|
|
)
|
|
email: Optional[str] = None
|