§
    HŠtjt7  ã                   óÀ   — d Z ddlZ ej        e¦  «        ZddlZddlmZ dgZd„ Z	ddl
mZmZmZ  e	e¦  «         G d„ de¦  «        ¦   «         Z G d„ d	e¦  «        ZdS )
z1passlib.ifc - abstract interfaces used by Passlibé    N)Údeprecated_methodÚPasswordHashc                 ó   ‡ — ˆ fd„}|S )z5class decorator that re-creates class using metaclassc                 ó†   •— ‰t          | ¦  «        u r| S  ‰| j        | j        | j                             ¦   «         ¦  «        S ©N)ÚtypeÚ__name__Ú	__bases__Ú__dict__Úcopy)ÚclsÚmetas    €úI/var/www/html/CA-Chatbot/venv/lib/python3.11/site-packages/passlib/ifc.pyÚbuilderz(recreate_with_metaclass.<locals>.builder   s?   ø€ Ø•4˜‘9”9ÐÐØˆJØˆt�C”L #¤-°´×1BÒ1BÑ1DÔ1DÑEÔEÐEó    © )r   r   s   ` r   Úrecreate_with_metaclassr      s(   ø€ ðFð Fð Fð Fð Fð €Nr   )ÚABCMetaÚabstractmethodÚabstractpropertyc                   óŽ  — e Zd ZdZdZdZdZdZee	d„ ¦   «         ¦   «         Z
 eddd¬	¦  «        ed
„ ¦   «         ¦   «         Zee	d„ ¦   «         ¦   «         Zee	dd„¦   «         ¦   «         Zedd„¦   «         Zee	d„ ¦   «         ¦   «         Z edd¬¦  «        ed„ ¦   «         ¦   «         Z edd¬¦  «        ed„ ¦   «         ¦   «         ZdZdS )r   züThis class describes an abstract interface which all password hashes
    in Passlib adhere to. Under Python 2.6 and up, this is an actual
    Abstract Base Class built using the :mod:`!abc` module.

    See the Passlib docs for full documentation.
    FNTc                 ó    — t          d¦  «        ‚)a  
        Hash secret, returning result.
        Should handle generating salt, etc, and should return string
        containing identifier, salt & other configuration, as well as digest.

        :param \\*\\*settings_kwds:

            Pass in settings to customize configuration of resulting hash.

            .. deprecated:: 1.7

                Starting with Passlib 1.7, callers should no longer pass settings keywords
                (e.g. ``rounds`` or ``salt`` directly to :meth:`!hash`); should use
                ``.using(**settings).hash(secret)`` construction instead.

                Support will be removed in Passlib 2.0.

        :param \\*\\*context_kwds:

            Specific algorithms may require context-specific information (such as the user login).
        úmust be implemented by subclass©ÚNotImplementedError)r   ÚsecretÚsetting_and_context_kwdss      r   ÚhashzPasswordHash.hashr   s   € õ6 "Ð"CÑDÔDÐDr   z1.7z2.0z.hash())Ú
deprecatedÚremovedÚreplacementc                 ó   —  | j         |i |¤ŽS )a  
        Legacy alias for :meth:`hash`.

        .. deprecated:: 1.7
            This method was renamed to :meth:`!hash` in version 1.7.
            This alias will be removed in version 2.0, and should only
            be used for compatibility with Passlib 1.3 - 1.6.
        ©r   )r   ÚargsÚkwdss      r   ÚencryptzPasswordHash.encrypt�   s   € ð ˆsŒx˜Ð& Ð&Ð&Ð&r   c                 ó    — t          d¦  «        ‚)z.verify secret against hash, returns True/Falser   r   )r   r   r   Úcontext_kwdss       r   ÚverifyzPasswordHash.verifyŸ   ó   € õ "Ð"CÑDÔDÐDr   c                 ó    — t          d¦  «        ‚)aì  
        Return another hasher object (typically a subclass of the current one),
        which integrates the configuration options specified by ``kwds``.
        This should *always* return a new object, even if no configuration options are changed.

        .. todo::

            document which options are accepted.

        :returns:
            typically returns a subclass for most hasher implementations.

        .. todo::

            add this method to main documentation.
        r   r   )r   Úrelaxedr%   s      r   ÚusingzPasswordHash.using¨   s   € õ& "Ð"CÑDÔDÐDr   c                 ó   — dS )aø  
        check if hash's configuration is outside desired bounds,
        or contains some other internal option which requires
        updating the password hash.

        :param hash:
            hash string to examine

        :param secret:
            optional secret known to have verified against the provided hash.
            (this is used by some hashes to detect legacy algorithm mistakes).

        :return:
            whether secret needs re-hashing.

        .. versionadded:: 1.7
        Fr   )r   r   r   s      r   Úneeds_updatezPasswordHash.needs_updateÀ   s	   € ð( ˆur   c                 ó    — t          d¦  «        ‚)z8check if hash belongs to this scheme, returns True/Falser   r   ©r   r   s     r   ÚidentifyzPasswordHash.identifyÙ   r*   r   )r   r    c                 ón   — | j         rt          d¦  «        ‚ | j        di |¤Ž                     d¦  «        S )a¥  
        compile settings into a configuration string for genhash()

        .. deprecated:: 1.7

            As of 1.7, this method is deprecated, and slated for complete removal in Passlib 2.0.

            For all known real-world uses, hashing a constant string
            should provide equivalent functionality.

            This deprecation may be reversed if a use-case presents itself in the mean time.
        r   Ú r   )r(   r   r-   r   )r   Úsetting_kwdss     r   Ú	genconfigzPasswordHash.genconfigß   sE   € ð$ Ôð 	IÝ%Ð&GÑHÔHÐHØˆsŒyÐ(Ð(˜<Ð(Ð(×-Ò-¨bÑ1Ô1Ð1r   c                 ó    — t          d¦  «        ‚)a1  
        generated hash for secret, using settings from config/hash string

        .. deprecated:: 1.7

            As of 1.7, this method is deprecated, and slated for complete removal in Passlib 2.0.

            This deprecation may be reversed if a use-case presents itself in the mean time.
        r   r   )r   r   ÚconfigÚcontexts       r   ÚgenhashzPasswordHash.genhashõ   s   € õ "Ð"CÑDÔDÐDr   )Fr   )r	   Ú
__module__Ú__qualname__Ú__doc__Úis_disabledÚtruncate_sizeÚtruncate_errorÚtruncate_verify_rejectÚclassmethodr   r   r   r&   r)   r-   r/   r2   r6   r:   r   r   r   r   r   r   %   s«  € € € € € ðð ð( €Kð €Mð €Nð "Ðð6 ØðEð Eñ „^ñ „[ðEð6 Ð %°ÀIÐNÑNÔNØð	'ð 	'ñ „[ñ OÔNð	'ð ØðEð Eñ „^ñ „[ðEð ØðEð Eð Eñ „^ñ „[ðEð, ðð ð ñ „[ðð0 ØðEð Eñ „^ñ „[ðEð Ð %°Ð7Ñ7Ô7Øð2ð 2ñ „[ñ 8Ô7ð2ð( Ð %°Ð7Ñ7Ô7ØðEð Eñ „[ñ 8Ô7ðEð@ €J€J€Jr   c                   óD   — e Zd ZdZdZedd„¦   «         Zed„ ¦   «         ZdS )ÚDisabledHashzR
    extended disabled-hash methods; only need be present if .disabled = True
    TNc                 ó,   — |                       d¦  «        S )z£
        return string representing a 'disabled' hash;
        optionally including previously enabled hash
        (this is up to the individual scheme).
        r4   r#   r1   s     r   ÚdisablezDisabledHash.disableK  s   € ð �xŠx˜‰|Œ|Ðr   c                 ó    — t          d¦  «        ‚)zŽ
        given a disabled-hash string,
        extract previously-enabled hash if one is present,
        otherwise raises ValueError
        zcannot restore original hash)Ú
ValueErrorr1   s     r   ÚenablezDisabledHash.enableU  s   € õ Ð7Ñ8Ô8Ð8r   r   )r	   r;   r<   r=   r>   rB   rF   rI   r   r   r   rD   rD   D  s^   € € € € € ðð ð €Kàðð ð ñ „[ðð ð9ð 9ñ „[ð9ð 9ð 9r   rD   )r=   ÚloggingÚ	getLoggerr	   ÚlogÚsysÚpasslib.utils.decorr   Ú__all__r   Úabcr   r   r   Úobjectr   rD   r   r   r   ú<module>rR      sÿ   ðØ 7Ð 7ð
 €€€Ð'�gÔ'¨Ñ1Ô1�Ø 
€
€
€
ð 2Ð 1Ð 1Ð 1Ð 1Ð 1ð ð€ðð ð ð :Ð 9Ð 9Ð 9Ð 9Ð 9Ð 9Ð 9Ð 9Ð 9ð Ð˜Ñ!Ô!ðqð qð qð qð q�6ñ qô qñ "Ô!ðqð|9ð 9ð 9ð 9ð 9�<ñ 9ô 9ð 9ð 9ð 9r   