File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -206,3 +206,16 @@ search.
206206
207207.. autoclass :: ldap.controls.readentry.PostReadControl
208208 :members:
209+
210+
211+ :py:mod: `ldap.controls.ppolicy ` Password Policy Control
212+ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
213+
214+ .. seealso ::
215+ `draft-behera-ldap-password-policy <https://tools.ietf.org/html/draft-behera-ldap-password-policy >`_
216+
217+ .. py :module :: ldap.controls.ppolicy
218+ :synopsis: passworld policies
219+
220+ .. autoclass :: ldap.controls.ppolicy.PasswordPolicyControl
221+ :members:
Original file line number Diff line number Diff line change @@ -62,17 +62,25 @@ class PasswordPolicyResponseValue(univ.Sequence):
6262
6363
6464class PasswordPolicyControl (ValueLessRequestControl ,ResponseControl ):
65+ """
66+ Indicates the errors and warnings about the password policy.
67+ """
6568 controlType = '1.3.6.1.4.1.42.2.27.8.5.1'
6669
6770 def __init__ (self ,criticality = False ):
6871 self .criticality = criticality
6972
70- def decodeControlValue (self ,encodedControlValue ):
71- ppolicyValue ,_ = decoder .decode (encodedControlValue ,asn1Spec = PasswordPolicyResponseValue ())
7273 self .timeBeforeExpiration = None
74+ """The time before the password expires."""
75+
7376 self .graceAuthNsRemaining = None
77+ """The number of grace authentications remaining."""
78+
7479 self .error = None
80+ """The password and authentication errors."""
7581
82+ def decodeControlValue (self ,encodedControlValue ):
83+ ppolicyValue ,_ = decoder .decode (encodedControlValue ,asn1Spec = PasswordPolicyResponseValue ())
7684 warning = ppolicyValue .getComponentByName ('warning' )
7785 if warning .hasValue ():
7886 if 'timeBeforeExpiration' in warning :
You can’t perform that action at this time.
0 commit comments