zoom.auth package

Module contents

zoom.auth

TODO: add scrypt support when introduced into passlib (v1.7)

zoom.auth.validate_password(password, stored_password_hash)

validate a password and return the best hash

>>> hash = '$bcrypt-sha256$2a,14$q4iT8GFWNrwfYDIMKaYI0e$KVxn8PWpzKbOgE/qfwG.IVhRIx.Pma6'
>>> validate_password('admin', hash)
(True, None)
>>> validate_password('admin1', hash)
(False, None)
>>> new_hash = hash_password('adminpw')
>>> validate_password('adminpw', new_hash)
(True, None)

Validates the supplied password to see if it matches the stored password based one of the accepted algorythms and also returns a hash based on the best algorythm that is currently supported. This allows passwords stored with older algorythms to be accepted while providing the ability to contantly upgrade algorythms as they improve.

zoom.auth.hash_password(password)

hash a password