mirror of
https://github.com/GSA/notifications-admin.git
synced 2026-08-14 23:08:07 -04:00
Merge pull request #950 from alphagov/8-char-password
Reduce minimum password length to 8 characters
This commit is contained in:
2100
app/main/_blacklisted_passwords.py
Normal file
2100
app/main/_blacklisted_passwords.py
Normal file
File diff suppressed because it is too large
Load Diff
@@ -72,8 +72,8 @@ def mobile_number():
|
||||
def password(label='Password'):
|
||||
return PasswordField(label,
|
||||
validators=[DataRequired(message='Can’t be empty'),
|
||||
Length(10, 255, message='Must be at least 10 characters'),
|
||||
Blacklist(message='That password is blacklisted, too common')])
|
||||
Length(8, 255, message='Must be at least 8 characters'),
|
||||
Blacklist(message='Choose a password that’s harder to guess')])
|
||||
|
||||
|
||||
def sms_code():
|
||||
|
||||
@@ -2,6 +2,7 @@ import re
|
||||
from wtforms import ValidationError
|
||||
from notifications_utils.template import Template
|
||||
from app.utils import Spreadsheet
|
||||
from ._blacklisted_passwords import blacklisted_passwords
|
||||
|
||||
|
||||
class Blacklist(object):
|
||||
@@ -11,7 +12,7 @@ class Blacklist(object):
|
||||
self.message = message
|
||||
|
||||
def __call__(self, form, field):
|
||||
if field.data in ['password1234', 'passw0rd1234']:
|
||||
if field.data in blacklisted_passwords:
|
||||
raise ValidationError(self.message)
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user