This module contains all the custom exceptions & warnings that may be raised by Passlib.
Error raised if multi-backend handler has no available backends; or if specifically requested backend is not available.
MissingBackendError derives from RuntimeError, since it usually indicates lack of an external library or OS feature. This is primarily raised by handlers which depend on external libraries (which is currently just bcrypt).
Error raised if a password exceeds the maximum size allowed by Passlib (4096 characters).
Many password hash algorithms take proportionately larger amounts of time and/or memory depending on the size of the password provided. This could present a potential denial of service (DOS) situation if a maliciously large password is provided to an application. Because of this, Passlib enforces a maximum size limit, but one which should be much larger than any legitimate password. PasswordSizeError derives from ValueError.
Note
Applications wishing to use a different limit should set the PASSLIB_MAX_PASSWORD_SIZE environmental variable before Passlib is loaded. The value can be any large positive integer.
New in version 1.6.
base class for Passlib’s user warnings, derives from the builtin UserWarning.
New in version 1.6.
Warning issued when non-fatal issue is found related to the configuration of a CryptContext instance.
This occurs primarily in one of two cases:
In both of these cases, the code will perform correctly & securely; but the warning is issued as a sign the configuration may need updating.
New in version 1.6.
Warning issued when non-fatal issue is found with parameters or hash string passed to a passlib hash class.
This occurs primarily in one of two cases:
New in version 1.6.
Warning issued when something unexpected happens during runtime.
The fact that it’s a warning instead of an error means Passlib was able to correct for the issue, but that it’s anonmalous enough that the developers would love to hear under what conditions it occurred.
New in version 1.6.
Special warning issued when Passlib encounters something that might affect security.
New in version 1.6.