| Server IP : 157.22.201.140 / Your IP : 216.73.216.74 Web Server : nginx/1.30.1 System : Linux mit.vincode.fvds.ru 6.8.0-111-generic #111-Ubuntu SMP PREEMPT_DYNAMIC Sat Apr 11 23:16:02 UTC 2026 x86_64 User : root ( 0) PHP Version : 8.3.6 Disable Function : NONE MySQL : OFF | cURL : ON | WGET : ON | Perl : ON | Python : OFF | Sudo : ON | Pkexec : OFF Directory : /lib/python3/dist-packages/passlib/__pycache__/ |
Upload File : |
�
XR_�8 � �� � d Z G d� de� Z G d� de� Z G d� de� Z G d� de� Z G d � d
e� Z G d� de� Z G d
� de� Z G d� de� Z
G d� de
� Z G d� de
� Z G d� de
� Z
G d� de� Z G d� de� Z G d� de� Z G d� de� Z G d� d e� Z G d!� d"e� Zd#� Zd$� Zd%� Zd&� Zd1d(�Zd1d)�Zd1d*�Zd2d+�Zd1d,�Zd3d.�Zd-Zd4d/�Z d5d0�Z!y')6z6passlib.exc -- exceptions & warnings raised by passlibc � � e Zd ZdZd� Zy)�UnknownBackendErrorz�
Error raised if multi-backend handler doesn't recognize backend name.
Inherits from :exc:`ValueError`.
.. versionadded:: 1.7
c �n � || _ || _ |j �d|��}t j | |� y )Nz: unknown backend: )�hasher�backend�name�
ValueError�__init__)�selfr r �messages �-/usr/lib/python3/dist-packages/passlib/exc.pyr zUnknownBackendError.__init__ s. � �������/5�{�{�G�D�����D�'�*� N��__name__�
__module__�__qualname__�__doc__r � r
r r r s � ��+r
r c � � e Zd ZdZy)�MissingBackendErrora� Error raised if multi-backend handler has no available backends;
or if specifically requested backend is not available.
:exc:`!MissingBackendError` derives
from :exc:`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
:class:`~passlib.hash.bcrypt`).
N�r r r r r r
r r r s � � r
r c � � e Zd ZdZy)�InternalBackendErrorz�
Error raised if something unrecoverable goes wrong with backend call;
such as if ``crypt.crypt()`` returning a malformed hash.
.. versionadded:: 1.7.3
Nr r r
r r r # � � �r
r c � � e Zd ZdZy)�PasswordValueErrora�
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). Hashers may also throw more specific subclasses,
such as :exc:`!PasswordSizeError`.
.. versionadded:: 1.7.3
Nr r r
r r r , s � � � r
r c � � e Zd ZdZdZdd�Zy)�PasswordSizeErrora
Error raised if a password exceeds the maximum size allowed
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
from :exc:`!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.
.. attribute:: max_size
indicates the maximum allowed size.
.. versionadded:: 1.6
Nc �F � || _ |�d}t j | |� y )Nz%password exceeds maximum allowed size)�max_sizer r )r
r �msgs r r zPasswordSizeError.__init__X s# � � ��
��;�9�C��#�#�D�#�.r
�N)r r r r r r r r
r r r : s � ��6 �H�/r
r c � � e Zd ZdZdd�Zy)�PasswordTruncateErrora]
Error raised if password would be truncated by hash.
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``.
.. attribute:: max_size
indicates the maximum allowed size.
.. versionadded:: 1.7
Nc � � |�d|j |j fz }t j | |j |� y )Nz1Password too long (%s truncates to %d characters))r �
truncate_sizer r )r
�clsr s r r zPasswordTruncateError.__init__p s; � ��;�F��H�H�c�/�/�0�1�C��"�"�4��):�):�C�@r
r! r r r
r r# r# a s
� ��Ar
r# c � � e Zd ZdZy)�PasslibSecurityErrorz�
Error raised if critical security issue is detected
(e.g. an attempt is made to use a vulnerable version of a bcrypt backend).
.. versionadded:: 1.6.3
Nr r r
r r( r( w r r
r( c � � e Zd ZdZdZdd�Zy)�
TokenErrora�
Base error raised by v:mod:`passlib.totp` when
a token can't be parsed / isn't valid / etc.
Derives from :exc:`!ValueError`.
Usually one of the more specific subclasses below will be raised:
* :class:`MalformedTokenError` -- invalid chars, too few digits
* :class:`InvalidTokenError` -- no match found
* :class:`UsedTokenError` -- match found, but token already used
.. versionadded:: 1.7
zToken not acceptableNc �T � |�| j }t j | |g|��i |�� y r! )�_default_messager r )r
r �args�kwdss r r zTokenError.__init__� s, � ��;��'�'�C����D�#�5��5��5r
r! )r r r r r, r r r
r r* r* � s � �� .��6r
r* c � � e Zd ZdZdZy)�MalformedTokenErrorz�
Error raised by :mod:`passlib.totp` when a token isn't formatted correctly
(contains invalid characters, wrong number of digits, etc)
zUnrecognized tokenN�r r r r r, r r
r r0 r0 � s � �� ,�r
r0 c � � e Zd ZdZdZy)�InvalidTokenErrorz�
Error raised by :mod:`passlib.totp` when a token is formatted correctly,
but doesn't match any tokens within valid range.
zToken did not matchNr1 r r
r r3 r3 � s � �� -�r
r3 c � � e Zd ZdZdZdZd� Zy)�UsedTokenErrorz�
Error raised by :mod:`passlib.totp` if a token is reused.
Derives from :exc:`TokenError`.
.. autoattribute:: expire_time
.. versionadded:: 1.7
z5Token has already been used, please wait for another.Nc �d � |j dd � | _ t j | g|��i |�� y )N�expire_time)�popr7 r* r )r
r- r. s r r zUsedTokenError.__init__� s- � ��8�8�M�4�8������D�0�4�0�4�0r
)r r r r r, r7 r r r
r r5 r5 � s � �� O�� �K�1r
r5 c � � e Zd ZdZdd�Zd� Zy)�UnknownHashErrorar
Error raised by :class:`~passlib.crypto.lookup_hash` if hash name is not recognized.
This exception derives from :exc:`!ValueError`.
As of version 1.7.3, this may also be raised if hash algorithm is known,
but has been disabled due to FIPS mode (message will include phrase "disabled for fips").
As of version 1.7.4, this may be raised if a :class:`~passlib.context.CryptContext`
is unable to identify the algorithm used by a password hash.
.. versionadded:: 1.7
.. versionchanged: 1.7.3
added 'message' argument.
.. versionchanged:: 1.7.4
altered call signature.
Nc �\ � || _ |�d|z }|| _ t j | ||� y )Nzunknown hash algorithm: %r)�valuer r r )r
r r<