Skip to content

Commit 6f0482f

Browse files
Dan Lavudanlavu
authored andcommitted
added kwargs to abstracted method password_change_at_logon()
* ldap requires the user password to be reset, it is now included into the function
1 parent 690d006 commit 6f0482f

File tree

5 files changed

+12
-5
lines changed

5 files changed

+12
-5
lines changed

sssd_test_framework/roles/ad.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -934,7 +934,7 @@ def expire(self, expiration: str = "19700101000000") -> ADUser:
934934

935935
return self
936936

937-
def password_change_at_logon(self) -> ADUser:
937+
def password_change_at_logon(self, **kwargs) -> ADUser:
938938
"""
939939
Force user to change password next logon.
940940

sssd_test_framework/roles/generic.py

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -559,10 +559,13 @@ def expire(self, expiration: str | None = "19700101000000") -> GenericUser:
559559
pass
560560

561561
@abstractmethod
562-
def password_change_at_logon(self) -> GenericUser:
562+
def password_change_at_logon(self, **kwargs) -> GenericUser:
563563
"""
564564
Force user to change password next logon.
565565
566+
The LDAP provider needs to administratively reset the user password to trigger the password
567+
change. Making the key word argument 'password' required by LDAP but will be ignored by others..
568+
566569
:return: Self.
567570
:rtype: GenericUser
568571
"""

sssd_test_framework/roles/ipa.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -610,7 +610,7 @@ def expire(self, expiration: str | None = "19700101000000Z") -> IPAUser:
610610

611611
return self
612612

613-
def password_change_at_logon(self) -> IPAUser:
613+
def password_change_at_logon(self, **kwargs) -> IPAUser:
614614
"""
615615
Force user to change password next logon.
616616

sssd_test_framework/roles/ldap.py

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -874,14 +874,18 @@ def expire(self, expiration: str = "19700101000000") -> LDAPUser:
874874

875875
return self
876876

877-
def password_change_at_logon(self) -> LDAPUser:
877+
def password_change_at_logon(self, **kwargs) -> LDAPUser:
878878
"""
879879
Force user to change password next logon.
880880
881881
:return: Self.
882882
:rtype: LDAPUser
883883
"""
884+
if "password" not in kwargs.keys():
885+
raise TypeError("Missing argument 'password'!")
886+
884887
self.role.ldap.modify("cn=config", replace={"passwordMustChange": "on"})
888+
self.modify(password=kwargs["password"])
885889

886890
return self
887891

sssd_test_framework/roles/samba.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -698,7 +698,7 @@ def modify(
698698
self._modify(attrs)
699699
return self
700700

701-
def password_change_at_logon(self) -> SambaUser:
701+
def password_change_at_logon(self, **kwargs) -> SambaUser:
702702
"""
703703
Force user to change password next logon.
704704

0 commit comments

Comments
 (0)