I agree with this opinion as well.
I think all password validators, except for UserAttributeSimilarityValidator
, can be used as general purpose validators.
In particular, MinimumLengthValidator
is functionally identical to MinLengthValidator
and MaxLengthValidator
in the standard validators (it’s closer to a customized version of MinLengthValidator
for passwords).
Also, I believe that NumericPasswordValidator
can be effectively used in scenarios beyond just password validation.
I consider my skills to be lacking and think Django’s password validation logic is excellently and beautifully designed. However, I struggle to understand the decision to design password validation using AUTH_PASSWORD_VALIDATORS
in settings.py
. I believe this could have been sufficiently handled using general Field
and Validator
functionality.
Of course, compared to the developers of Django, my perspective might seem like that of a beginner, which could explain my impression.