@@ -60,7 +60,8 @@ class CustomStrengthOptionsServerConfig:
60
60
def __init__ (self , data ):
61
61
if not isinstance (data , dict ):
62
62
raise ValueError (
63
- 'Invalid data argument in CustomStrengthOptionsServerConfig constructor: {0}' .format (data ))
63
+ 'Invalid data argument in CustomStrengthOptionsServerConfig'
64
+ ' constructor: {0}' .format (data ))
64
65
self ._data = data
65
66
66
67
@property
@@ -100,13 +101,13 @@ class CustomStrengthOptionsConfig:
100
101
"""Represents the strength attributes for the password policy"""
101
102
102
103
def __init__ (
103
- self ,
104
- min_length : int = 6 ,
105
- max_length : int = 4096 ,
106
- require_uppercase : bool = False ,
107
- require_lowercase : bool = False ,
108
- require_non_alphanumeric : bool = False ,
109
- require_numeric : bool = False ,
104
+ self ,
105
+ min_length : int = 6 ,
106
+ max_length : int = 4096 ,
107
+ require_uppercase : bool = False ,
108
+ require_lowercase : bool = False ,
109
+ require_non_alphanumeric : bool = False ,
110
+ require_numeric : bool = False ,
110
111
):
111
112
self .min_length : int = min_length
112
113
self .max_length : int = max_length
@@ -139,14 +140,16 @@ def validate(self):
139
140
Raises:
140
141
ValueError: In case of an unsuccessful validation.
141
142
"""
142
- validate_keys (keys = vars (self ).keys (),
143
- valid_keys = {
144
- 'require_numeric' ,
145
- 'require_uppercase' ,
146
- 'require_lowercase' ,
147
- 'require_non_alphanumeric' ,
148
- 'min_length' ,
149
- 'max_length' },
143
+ validate_keys (
144
+ keys = vars (self ).keys (),
145
+ valid_keys = {
146
+ 'require_numeric' ,
147
+ 'require_uppercase' ,
148
+ 'require_lowercase' ,
149
+ 'require_non_alphanumeric' ,
150
+ 'min_length' ,
151
+ 'max_length'
152
+ },
150
153
config_name = 'CustomStrengthOptionsConfig' )
151
154
if not isinstance (self .require_lowercase , bool ):
152
155
raise ValueError ('constraints.require_lowercase must be a boolean' )
@@ -182,10 +185,10 @@ class EnforcementState(Enum):
182
185
OFF = 'OFF'
183
186
184
187
def __init__ (
185
- self ,
186
- enforcement_state : EnforcementState = None ,
187
- force_upgrade_on_signin : bool = False ,
188
- constraints : CustomStrengthOptionsConfig = None ,
188
+ self ,
189
+ enforcement_state : EnforcementState = None ,
190
+ force_upgrade_on_signin : bool = False ,
191
+ constraints : CustomStrengthOptionsConfig = None ,
189
192
):
190
193
self .enforcement_state : self .EnforcementState = enforcement_state
191
194
self .force_upgrade_on_signin : bool = force_upgrade_on_signin
@@ -219,7 +222,8 @@ def validate(self):
219
222
'password_policy_config.enforcement_state must be defined.' )
220
223
if not isinstance (self .enforcement_state , PasswordPolicyConfig .EnforcementState ):
221
224
raise ValueError (
222
- 'password_policy_config.enforcement_state must be of type PasswordPolicyConfig.EnforcementState' )
225
+ 'password_policy_config.enforcement_state must be of type'
226
+ ' PasswordPolicyConfig.EnforcementState' )
223
227
if not isinstance (self .force_upgrade_on_signin , bool ):
224
228
raise ValueError (
225
229
'password_policy_config.force_upgrade_on_signin must be a valid boolean' )
0 commit comments