Ë
    hjt7  ã                   óª   — 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y)
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                  j	                  «       «      S ©N)ÚtypeÚ__name__Ú	__bases__Ú__dict__Úcopy)ÚclsÚmetas    €úT/var/www/html/sergio/sergio-backend/venv/lib/python3.12/site-packages/passlib/ifc.pyÚbuilderz(recreate_with_metaclass.<locals>.builder   s8   ø€ Ø”4˜“9ÑØˆJÙ�C—L‘L #§-¡-°·±×1BÑ1BÓ1DÓEÐEó    © )r   r   s   ` r   Úrecreate_with_metaclassr      s   ø€ ô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y)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Ð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‰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Ð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ÐDr   c                  ó   — y)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   € ð( r   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                 ór   — | j                   rt        d«      ‚ | j                  di |¤Žj                  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ß   s8   € ð$ ×ÒÜ%Ð&GÓHÐHØˆs�y‰yÑ(˜<Ñ(×-Ñ-¨bÓ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Ð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ñ6  %°ÀIÔNØñ	'ó ó Oð	'ð ØñEó ó ðEð ØòEó ó ðEð, òó ðð0 ØñEó ó ðEñ  %°Ô7Øñ2ó ó 8ð2ñ(  %°Ô7ØñEó ó 8ðEð@ �Jr   c                   ó6   — e Zd ZdZdZedd„«       Zed„ «       Zy)ÚDisabledHashzR
    extended disabled-hash methods; only need be present if .disabled = True
    TNc                 ó$   — | j                  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Ð8r   r   )r	   r;   r<   r=   r>   rB   rF   rI   r   r   r   rD   rD   D  s4   „ ñð €Kàòó ðð ñ9ó ñ9r   rD   )r=   ÚloggingÚ	getLoggerr	   ÚlogÚsysÚpasslib.utils.decorr   Ú__all__r   Úabcr   r   r   Úobjectr   rD   r   r   r   Ú<module>rR      sp   ðÙ 7ó
 Ð'�g×'Ñ'¨Ó1�Û 
õ 2ð ð€ò÷ :Ñ 9ñ ˜Ó!ôq�6ó qó "ðqô|9�<õ 9r   