2024-11-02 23:15:51 +00:00
|
|
|
from enum import Enum
|
|
|
|
from pydantic import BaseModel
|
2024-11-11 17:37:17 +00:00
|
|
|
from typing import Optional
|
2024-11-02 23:15:51 +00:00
|
|
|
|
|
|
|
|
|
|
|
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
|
|
|
origin: UserDataUserOrigin
|
|
|
|
|
2024-11-14 23:30:24 +00:00
|
|
|
displayname: Optional[
|
|
|
|
str
|
|
|
|
] # in logic graphql will return "username" if "displayname" None
|
|
|
|
uuid: Optional[str]
|
|
|
|
email: Optional[str]
|
|
|
|
ssh_keys: Optional[list[str]]
|
|
|
|
directmemberof: Optional[list[str]]
|
|
|
|
memberof: Optional[list[str]]
|