Skip to main content

validate_password

Validate that the password meets all validator requirements.

If the password is valid, return None. If the password is invalid, raise ValidationError with all error messages.

def validate_password(
password: string,
user: object,
password_validators: list
) - > null

Validate that the password meets all validator requirements.

Parameters

NameTypeDescription
passwordstringThe raw password string to be checked for complexity and security requirements.
userobjectThe user instance to provide context for validation, such as preventing passwords similar to user attributes.
password_validatorslistA collection of validator instances to execute; defaults to the system's configured password validators if not provided.

Returns

TypeDescription
nullReturns None if the password passes all validation checks.