tools

Additional tools used in pyramid_fullauth.

pyramid_fullauth.tools.password_generator(length, chars='abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789!"#$%&\'()*+,-./:;<=>?@[\\]^_`{|}~')[source]

Generate random password.

Warning

TODO: tests!

Parameters:
  • length (int) – length of a password to Generates

  • chars (list) – list of characters from which to choose

Returns:

password

Return type:

str

pyramid_fullauth.tools.validate_passsword(request, password, user=None)[source]

Validate password properly.

Note

If no user provided, password is just validated

Parameters:
Raises:

pyramid_fullauth.exceptions.ValidateError