diff options
author | Eli Collins <elic@assurancetechnologies.com> | 2020-05-12 12:27:50 -0400 |
---|---|---|
committer | Eli Collins <elic@assurancetechnologies.com> | 2020-05-12 12:27:50 -0400 |
commit | 6c96dd0a469aafa2592641ae3b3d820aaabd7d35 (patch) | |
tree | a32ca8880cd58591a0b18f621a3c7c584344cb51 /passlib/exc.py | |
parent | b8eff68d18df6a85b725eabebdc7cfd9fd6cfe50 (diff) | |
download | passlib-6c96dd0a469aafa2592641ae3b3d820aaabd7d35.tar.gz |
docs: minor adjusted to doc language
Diffstat (limited to 'passlib/exc.py')
-rw-r--r-- | passlib/exc.py | 9 |
1 files changed, 6 insertions, 3 deletions
diff --git a/passlib/exc.py b/passlib/exc.py index 42d3928..280043d 100644 --- a/passlib/exc.py +++ b/passlib/exc.py @@ -31,9 +31,10 @@ class MissingBackendError(RuntimeError): class PasswordValueError(ValueError): """ Error raised if a password can't be hashed / verified for various reasons. + This exception derives from the builtin :exc:`!ValueError`. May be thrown directly when password violates internal invariants of hasher - (e.g. some don't support NULL characters); may also throw more specified subclasses, + (e.g. some don't support NULL characters). Hashers may also throw more specific subclasses, such as :exc:`!PasswordSizeError`. .. versionadded:: 1.7.3 @@ -47,12 +48,14 @@ class PasswordSizeError(PasswordValueError): by Passlib (by default, 4096 characters); or if password exceeds a hash-specific size limitation. + This exception derives from :exc:`PasswordValueError` (above). + 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. :exc:`!PasswordSizeError` derives + than any legitimate password. :exc:`PasswordSizeError` derives from :exc:`!ValueError`. .. note:: @@ -81,7 +84,7 @@ class PasswordSizeError(PasswordValueError): class PasswordTruncateError(PasswordSizeError): """ Error raised if password would be truncated by hash. - This derives from :exc:`PasswordSizeError` and :exc:`ValueError`. + This derives from :exc:`PasswordSizeError` (above). Hashers such as :class:`~passlib.hash.bcrypt` can be configured to raises this error by setting ``truncate_error=True``. |