Viewing File: /usr/lib/python2.7/site-packages/passlib/exc.pyo

ó
ƒXc@sÃdZdefd„ƒYZdefd„ƒYZdefd„ƒYZdefd„ƒYZd	efd
„ƒYZdefd„ƒYZd
efd„ƒYZ	defd„ƒYZ
defd„ƒYZdefd„ƒYZde
fd„ƒYZdefd„ƒYZdefd„ƒYZdefd„ƒYZdefd„ƒYZd„Zd „Zd!„Zd"„Zd)d#„Zd)d$„Zd)d%„Zd)d)d&„Zd)d'„Zed(„Zd)S(*s6passlib.exc -- exceptions & warnings raised by passlibtUnknownBackendErrorcBseZdZd„ZRS(s
    Error raised if multi-backend handler doesn't recognize backend name.
    Inherits from :exc:`ValueError`.

    .. versionadded:: 1.7
    cCs9||_||_d|j|f}tj||ƒdS(Ns%s: unknown backend: %r(thashertbackendtnamet
ValueErrort__init__(tselfRRtmessage((s//usr/lib/python2.7/site-packages/passlib/exc.pyRs		(t__name__t
__module__t__doc__R(((s//usr/lib/python2.7/site-packages/passlib/exc.pyRstMissingBackendErrorcBseZdZRS(sž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`).
    (RR	R
(((s//usr/lib/python2.7/site-packages/passlib/exc.pyRs
tPasswordSizeErrorcBs eZdZdZdd„ZRS(sÐ
    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.

    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
    cCs2||_|dkrd}ntj||ƒdS(Ns%password exceeds maximum allowed size(tmax_sizetNoneRR(RR
tmsg((s//usr/lib/python2.7/site-packages/passlib/exc.pyR:s		N(RR	R
RR
R(((s//usr/lib/python2.7/site-packages/passlib/exc.pyRstPasswordTruncateErrorcBseZdZdd„ZRS(sk
    Error raised if password would be truncated by hash.
    This derives from :exc:`PasswordSizeError` and :exc:`ValueError`.

    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
    cCs?|dkr%d|j|jf}ntj||j|ƒdS(Ns1Password too long (%s truncates to %d characters)(RRt
truncate_sizeRR(RtclsR((s//usr/lib/python2.7/site-packages/passlib/exc.pyRRsN(RR	R
RR(((s//usr/lib/python2.7/site-packages/passlib/exc.pyRCs
tPasslibSecurityErrorcBseZdZRS(s©
    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
    (RR	R
(((s//usr/lib/python2.7/site-packages/passlib/exc.pyRXst
TokenErrorcBs eZdZdZdd„ZRS(s­
    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
    sToken not acceptablecOs2|dkr|j}ntj||||ŽdS(N(Rt_default_messageRR(RRtargstkwds((s//usr/lib/python2.7/site-packages/passlib/exc.pyRssN(RR	R
RRR(((s//usr/lib/python2.7/site-packages/passlib/exc.pyRas
tMalformedTokenErrorcBseZdZdZRS(s“
    Error raised by :mod:`passlib.totp` when a token isn't formatted correctly
    (contains invalid characters, wrong number of digits, etc)
    sUnrecognized token(RR	R
R(((s//usr/lib/python2.7/site-packages/passlib/exc.pyRystInvalidTokenErrorcBseZdZdZRS(s‡
    Error raised by :mod:`passlib.totp` when a token is formatted correctly,
    but doesn't match any tokens within valid range.
    sToken did not match(RR	R
R(((s//usr/lib/python2.7/site-packages/passlib/exc.pyRstUsedTokenErrorcBs#eZdZdZdZd„ZRS(s¦
    Error raised by :mod:`passlib.totp` if a token is reused.
    Derives from :exc:`TokenError`.

    .. autoattribute:: expire_time

    .. versionadded:: 1.7
    s5Token has already been used, please wait for another.cOs,|jddƒ|_tj|||ŽdS(Ntexpire_time(tpopRRRR(RRR((s//usr/lib/python2.7/site-packages/passlib/exc.pyR˜sN(RR	R
RRRR(((s//usr/lib/python2.7/site-packages/passlib/exc.pyR‰stUnknownHashErrorcBseZdZd„ZRS(s¨Error raised by :class:`~passlib.crypto.lookup_hash` if hash name is not recognized.
    This exception derives from :exc:`!ValueError`.

    .. versionadded:: 1.7
    cCs!||_tj|d|ƒdS(Nsunknown hash algorithm: %r(RRR(RR((s//usr/lib/python2.7/site-packages/passlib/exc.pyR£s	(RR	R
R(((s//usr/lib/python2.7/site-packages/passlib/exc.pyRstPasslibWarningcBseZdZRS(sxbase class for Passlib's user warnings,
    derives from the builtin :exc:`UserWarning`.

    .. versionadded:: 1.6
    (RR	R
(((s//usr/lib/python2.7/site-packages/passlib/exc.pyRªstPasslibConfigWarningcBseZdZRS(sHWarning issued when non-fatal issue is found related to the configuration
    of a :class:`~passlib.context.CryptContext` instance.

    This occurs primarily in one of two cases:

    * The CryptContext contains rounds limits which exceed the hard limits
      imposed by the underlying algorithm.
    * An explicit rounds value was provided which exceeds the limits
      imposed by the CryptContext.

    In both of these cases, the code will perform correctly & securely;
    but the warning is issued as a sign the configuration may need updating.

    .. versionadded:: 1.6
    (RR	R
(((s//usr/lib/python2.7/site-packages/passlib/exc.pyR³stPasslibHashWarningcBseZdZRS(sÔ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:

    * A rounds value or other setting was explicitly provided which
      exceeded the handler's limits (and has been clamped
      by the :ref:`relaxed<relaxed-keyword>` flag).

    * A malformed hash string was encountered which (while parsable)
      should be re-encoded.

    .. versionadded:: 1.6
    (RR	R
(((s//usr/lib/python2.7/site-packages/passlib/exc.pyR ÄstPasslibRuntimeWarningcBseZdZRS(s8Warning 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 anomalous enough
    that the developers would love to hear under what conditions it occurred.

    .. versionadded:: 1.6
    (RR	R
(((s//usr/lib/python2.7/site-packages/passlib/exc.pyR!ÔstPasslibSecurityWarningcBseZdZRS(sxSpecial warning issued when Passlib encounters something
    that might affect security.

    .. versionadded:: 1.6
    (RR	R
(((s//usr/lib/python2.7/site-packages/passlib/exc.pyR"ÞscCs|r
|jSdS(Ns	<unnamed>(R(thandler((s//usr/lib/python2.7/site-packages/passlib/exc.pyt	_get_nameïscCsP|j}|jr5|jdkr5d|j|jfS|dkrEdS|jSdS(s<return pretty-printed string containing name of value's typet__builtin__tbuiltinss%s.%sRN(s__builtin__R&(t	__class__R	RR(tvalueR((s//usr/lib/python2.7/site-packages/passlib/exc.pyt	type_nameõs	cCs#t|ƒ}td|||fƒS(sGerror message when param was supposed to be one type, but found anothers%s must be %s, not %s(R)t	TypeError(R(texpectedtparamR((s//usr/lib/python2.7/site-packages/passlib/exc.pytExpectedTypeErrorÿscCst|d|ƒS(s<error message when param was supposed to be unicode or bytessunicode or bytes(R-(R(R,((s//usr/lib/python2.7/site-packages/passlib/exc.pytExpectedStringErrorscCs t|ƒ}td||fƒS(sEraised when verify() method gets passed config string instead of hashs.expected %s hash, got %s config string instead(R$R(R#R((s//usr/lib/python2.7/site-packages/passlib/exc.pytMissingDigestErrorscCst|ƒ}td|ƒS(sFraised by OS crypt() supporting hashes, which forbid NULLs in passwords(%s does not allow NULL bytes in password(R$R(R#R((s//usr/lib/python2.7/site-packages/passlib/exc.pytNullPasswordErrorscCstdt|ƒƒS(s5error raised if unrecognized hash provided to handlersnot a valid %s hash(RR$(R#((s//usr/lib/python2.7/site-packages/passlib/exc.pytInvalidHashErrorscCs3dt|ƒ}|r)d||f}nt|ƒS(sAerror raised if recognized-but-malformed hash provided to handlersmalformed %s hashs%s (%s)(R$R(R#treasonttext((s//usr/lib/python2.7/site-packages/passlib/exc.pytMalformedHashErrorscCs
t|dƒS(sJerror raised if hash was recognized but contained zero-padded rounds fieldszero-padded rounds(R4(R#((s//usr/lib/python2.7/site-packages/passlib/exc.pytZeroPaddedRoundsError%scCs8|j}|rdnd}d||f}t||ƒS(s@error raised if hash was recognized, but checksum was wrong sizetbytestcharsschecksum must be exactly %d %s(t
checksum_sizeR4(R#trawR8tunitR2((s//usr/lib/python2.7/site-packages/passlib/exc.pytChecksumSizeError,s	N(R
RRtRuntimeErrorRRRRRRRRRtUserWarningRRR R!R"R$R)R-R.RR/R0R1R4R5tFalseR;(((s//usr/lib/python2.7/site-packages/passlib/exc.pyt<module>s2
%	
	
		
		
Back to Directory File Manager