fix: types UserDataUser

This commit is contained in:
dettlaff 2024-11-11 21:47:31 +04:00
parent 6fcb47348f
commit e16f538c30
2 changed files with 6 additions and 4 deletions

View file

@ -14,8 +14,10 @@ class UserDataUserOrigin(Enum):
class UserDataUser(BaseModel): class UserDataUser(BaseModel):
"""The user model from the userdata file""" """The user model from the userdata file"""
username: str uuid: Optional[str]
displayname: Optional[str] displayname: Optional[str]
ssh_keys: list[str]
origin: UserDataUserOrigin
email: Optional[str] email: Optional[str]
username: str
ssh_keys: list[str] # TODO WHY NOT OPTIONAL?
origin: UserDataUserOrigin

View file

@ -71,7 +71,7 @@ class KanidmUserRepository(AbstractUserRepository):
user_type = UserDataUser( user_type = UserDataUser(
uuid=attrs.get("uuid", [None])[0], uuid=attrs.get("uuid", [None])[0],
name=attrs.get("name", [None])[0], name=attrs.get("name", [None])[0],
ssh_keys="test", # TODO ssh_keys=["test"], # TODO
displayname=attrs.get("displayname", [None])[0], displayname=attrs.get("displayname", [None])[0],
email=attrs.get("mail", [None])[0], email=attrs.get("mail", [None])[0],
origin=UserDataUserOrigin.NORMAL, # TODO origin=UserDataUserOrigin.NORMAL, # TODO