From what I checked, by changing the AUTH_PASSWORD_VALIDATORS to fit in
under 80 cols, the entire default file should now pass validation, so I
suggest the following comprehension for the validators (Pull Request -
https://github.com/django/django/pull/8452):
{{{#!python
AUTH_PASSWORD_VALIDATORS = [
{'NAME': 'django.contrib.auth.password_validation.%s' % validator}
for validator in [
'UserAttributeSimilarityValidator',
'MinimumLengthValidator',
'CommonPasswordValidator',
'NumericPasswordValidator',
]
]
}}}
--
Ticket URL: <https://code.djangoproject.com/ticket/28163>
Django <https://code.djangoproject.com/>
The Web framework for perfectionists with deadlines.
Comment (by Arne de Laat):
This change makes it a bit more difficult to add `OPTIONS` to one of the
validators, as shown in the example:
https://docs.djangoproject.com/en/dev/topics/auth/passwords/#enabling-
password-validation
Or to add a validator not in `django.contrib.auth.password_validation`.
--
Ticket URL: <https://code.djangoproject.com/ticket/28163#comment:1>
* component: Uncategorized => Core (Other)
Comment:
Agreed, I'm not so happy to obfuscate the settings merely to limit line
length.
--
Ticket URL: <https://code.djangoproject.com/ticket/28163#comment:2>
* status: new => closed
* resolution: => wontfix
Comment:
The 80-chars limit of pep8 is controversial. Many projects customize it to
a greater length. Readability and usability come first.
--
Ticket URL: <https://code.djangoproject.com/ticket/28163#comment:3>
* status: closed => new
* resolution: wontfix =>
Comment:
Hi folks,
I'm sorry to rehash this, but the current validator verbosity keeps
bugging me on my own projects and I'm sure I'm not the only one. So I just
wanted to ask if you would be open to a more flexible approach such as
using this sort of utility function (to be included in django.utils?):
{{{#!python
def basic_password_validator(class_name, **kwargs):
MODULE_PATH = 'django.contrib.auth.password_validation.'
validator = {'NAME': '.'.join(MODULE_PATH, class_name)}
validator.update(kwargs)
return validator
AUTH_PASSWORD_VALIDATORS = [
basic_password_validator('UserAttributeSimilarityValidator'),
basic_password_validator('MinimumLengthValidator',
OPTIONS={'min_length': 9}),
basic_password_validator('CommonPasswordValidator'),
basic_password_validator('NumericPasswordValidator'),
]
}}}
So I'm just looking for feedback about whether this sort of approach might
be deemed acceptable, and if so whether you have advice about the specific
implementation. If not, I promise to stop spamming this ticket :)
--
Ticket URL: <https://code.djangoproject.com/ticket/28163#comment:4>
* status: new => closed
* resolution: => wontfix
Comment:
I don't see much difference between that suggestion and the original
proposal. To reconsider a "wontfix" ticket, write to the
DevelopersMailingList rather than reopening the ticket.
--
Ticket URL: <https://code.djangoproject.com/ticket/28163#comment:5>