fix: add new params from kanidm repo to JsonUserRepository

This commit is contained in:
dettlaff 2024-12-20 00:50:21 +04:00
parent 0a77ac2230
commit 635c5a10e9

View file

@ -64,7 +64,12 @@ class JsonUserRepository(AbstractUserRepository):
return users return users
@staticmethod @staticmethod
def create_user(username: str, password: str) -> None: def create_user(
username: str,
password: str,
directmemberof: Optional[list[str]] = None,
displayname: Optional[str] = None,
) -> None:
"""Creates a new user""" """Creates a new user"""
hashed_password = JsonUserRepository._check_and_hash_password(password) hashed_password = JsonUserRepository._check_and_hash_password(password)
@ -104,7 +109,11 @@ class JsonUserRepository(AbstractUserRepository):
raise UserNotFound("User did not exist") raise UserNotFound("User did not exist")
@staticmethod @staticmethod
def update_user(username: str, password: str) -> None: def update_user(
username: str,
password: str,
displayname: Optional[str] = None,
) -> None:
"""Updates the password of an existing user""" """Updates the password of an existing user"""
hashed_password = JsonUserRepository._check_and_hash_password(password) hashed_password = JsonUserRepository._check_and_hash_password(password)