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-12-09 08:37:57 +00:00
|
|
|
user_type: UserDataUserOrigin
|
|
|
|
ssh_keys: list[str] = []
|
|
|
|
directmemberof: Optional[list[str]] = []
|
|
|
|
memberof: Optional[list[str]] = []
|
2024-12-04 15:15:03 +00:00
|
|
|
displayname: Optional[str] = (
|
|
|
|
None # in logic graphql will return "username" if "displayname" None
|
|
|
|
)
|
|
|
|
email: Optional[str] = None
|