mirror of
https://github.com/kakwa/ldapcherry
synced 2024-11-25 10:44:30 +01:00
very small improvements on ppolicy.simple
This commit is contained in:
parent
55cd8529c3
commit
a74346f7a7
@ -19,14 +19,14 @@ class PPolicy(ldapcherry.ppolicy.PPolicy):
|
|||||||
|
|
||||||
def check(self, password):
|
def check(self, password):
|
||||||
if len(password) < self.min_length:
|
if len(password) < self.min_length:
|
||||||
return {'match': False, 'reason': 'password too short'}
|
return {'match': False, 'reason': 'Password too short'}
|
||||||
if len(re.findall(r'[A-Z]', password)) < self.min_upper:
|
if len(re.findall(r'[A-Z]', password)) < self.min_upper:
|
||||||
return {
|
return {
|
||||||
'match': False,
|
'match': False,
|
||||||
'reason': 'not enough upper case characters'
|
'reason': 'Not enough upper case characters'
|
||||||
}
|
}
|
||||||
if len(re.findall(r'[0-9]', password)) < self.min_digit:
|
if len(re.findall(r'[0-9]', password)) < self.min_digit:
|
||||||
return {'match': False, 'reason': 'not enough digits'}
|
return {'match': False, 'reason': 'Not enough digits'}
|
||||||
return {'match': True, 'reason': 'password ok'}
|
return {'match': True, 'reason': 'password ok'}
|
||||||
|
|
||||||
def info(self):
|
def info(self):
|
||||||
|
Loading…
Reference in New Issue
Block a user