From e16f538c30c6aaffd9b9efec26ab89e04ef6e04b Mon Sep 17 00:00:00 2001 From: dettlaff Date: Mon, 11 Nov 2024 21:47:31 +0400 Subject: [PATCH] fix: types UserDataUser --- selfprivacy_api/models/user.py | 8 +++++--- .../repositories/users/kanidm_user_repository.py | 2 +- 2 files changed, 6 insertions(+), 4 deletions(-) diff --git a/selfprivacy_api/models/user.py b/selfprivacy_api/models/user.py index 84e246e..d35d172 100644 --- a/selfprivacy_api/models/user.py +++ b/selfprivacy_api/models/user.py @@ -14,8 +14,10 @@ class UserDataUserOrigin(Enum): class UserDataUser(BaseModel): """The user model from the userdata file""" - username: str + uuid: Optional[str] displayname: Optional[str] - ssh_keys: list[str] - origin: UserDataUserOrigin email: Optional[str] + + username: str + ssh_keys: list[str] # TODO WHY NOT OPTIONAL? + origin: UserDataUserOrigin diff --git a/selfprivacy_api/repositories/users/kanidm_user_repository.py b/selfprivacy_api/repositories/users/kanidm_user_repository.py index 1cbea39..e137af2 100644 --- a/selfprivacy_api/repositories/users/kanidm_user_repository.py +++ b/selfprivacy_api/repositories/users/kanidm_user_repository.py @@ -71,7 +71,7 @@ class KanidmUserRepository(AbstractUserRepository): user_type = UserDataUser( uuid=attrs.get("uuid", [None])[0], name=attrs.get("name", [None])[0], - ssh_keys="test", # TODO + ssh_keys=["test"], # TODO displayname=attrs.get("displayname", [None])[0], email=attrs.get("mail", [None])[0], origin=UserDataUserOrigin.NORMAL, # TODO