Ë
    hjMO  ã                   ól  — d Z ddlZddlZ ej                  e«      ZddlmZ ddlm	Z	 ddl
mZmZ ddlmZ ddlmZmZmZ ddlmZ dd	lmZ g d
¢Z G d„ de«      Z e«       Z e«       Zej<                  Z e d‚i dd“dd“dd“dd“dd“dd“dd“dd“dd“dd“dd“dd“d d“d!d“d"d#“d$d#“d%d#“d&d#“d'd#“d(d#“d)d#“d*d#“d+d#“d,d“d-d.“d/d“d0d1“d2d1“d3d1“d4d1“d5d1“d6d1“d7d8“d9d8“d:d8“d;d<“d=d<“d>d8“d?d8“d@d8“dAd8“dBd8“dCd8“dDd8“dEd8“dFd8“dGd8“dHd8“dId“dJd“dKd“dLd“dMd“dNd“dOd“dPdQ“dRdQ“dSdT“dUdT“dVd“dWdX“dYdX“dZd“d[d“d\d“d]d^“d_d`“dadb“dcd<“ddde“dfdg“dhdi“djdk“dldk“dmdn“dod`“dpd`“ŽZ! ejD                  dq«      Z# e$g dr¢«      Z%ds„ Z&dt„ Z'dƒdv„Z(efdw„Z)d„dx„Z*d„dy„Z+d…dz„Z,d†d{„Z-d|Z.d}Z/d~Z0e.dufd„Z1ed€„ «       Z2d�„ Z3y)‡z6passlib.registry - registry for password hash handlersé    N)Úwarn)Úexc)ÚExpectedTypeErrorÚPasslibWarning)ÚPasswordHash)Úis_crypt_handlerÚ	has_cryptÚunix_crypt_schemes)Úunicode_or_str)Úmemoize_single_value)Úregister_crypt_handler_pathÚregister_crypt_handlerÚget_crypt_handlerÚlist_crypt_handlersc                   ó0   — e Zd ZdZdZ dZd„ Zd„ Zd„ Zd„ Zy)Ú_PasslibRegistryProxyzòproxy module passlib.hash

    this module is in fact an object which lazy-loads
    the requested password hash algorithm from wherever it has been stored.
    it acts as a thin wrapper around :func:`passlib.registry.get_crypt_handler`.
    zpasslib.hashNc                 ó|   — |j                  d«      rt        d|›�«      ‚t        |d «      }|r|S t        d|›�«      ‚)NÚ_zmissing attribute: zunknown password hash: )Ú
startswithÚAttributeErrorr   )ÚselfÚattrÚhandlers      úY/var/www/html/sergio/sergio-backend/venv/lib/python3.12/site-packages/passlib/registry.pyÚ__getattr__z!_PasslibRegistryProxy.__getattr__(   s>   € Ø�?‰?˜3ÔÝ ¹DÐ!BÓCÐCÜ# D¨$Ó/ˆÙØˆNå ÁÐ!FÓGÐGó    c                 óp   — |j                  d«      rt        j                  | ||«       y t        ||¬«       y )Nr   ©Ú_attr)r   ÚobjectÚ__setattr__r   )r   r   Úvalues      r   r!   z!_PasslibRegistryProxy.__setattr__1   s.   € Ø�?‰?˜3Ôô ×Ñ˜t T¨5Õ1ô # 5°Ö5r   c                  ó   — y)Nz<proxy module 'passlib.hash'>© )r   s    r   Ú__repr__z_PasslibRegistryProxy.__repr__;   s   € Ø.r   c                 ó´   — t        t        | j                  «      «      }|j                  | j                  «       |j                  t
        «       t        |«      S ©N)ÚsetÚdirÚ	__class__ÚupdateÚ__dict__Ú
_locationsÚsorted)r   Úattrss     r   Ú__dir__z_PasslibRegistryProxy.__dir__>   s=   € ô ”C˜Ÿ™Ó'Ó(ˆØ�‰�T—]‘]Ô#Ø�‰”ZÔ Ü�e‹}Ðr   )	Ú__name__Ú
__module__Ú__qualname__Ú__doc__Ú__package__r   r!   r%   r0   r$   r   r   r   r      s(   „ ñð €HØ€KòHò6ò/ór   r   Úapr_md5_cryptzpasslib.handlers.md5_cryptÚargon2zpasslib.handlers.argon2Úatlassian_pbkdf2_sha1zpasslib.handlers.pbkdf2Úbcryptzpasslib.handlers.bcryptÚbcrypt_sha256Úbigcryptzpasslib.handlers.des_cryptÚ
bsd_nthashzpasslib.handlers.windowsÚ
bsdi_cryptÚ	cisco_pixzpasslib.handlers.ciscoÚ	cisco_asaÚcisco_type7Úcta_pbkdf2_sha1Úcrypt16Ú	des_cryptÚdjango_argon2zpasslib.handlers.djangoÚdjango_bcryptÚdjango_bcrypt_sha256Údjango_pbkdf2_sha256Údjango_pbkdf2_sha1Údjango_salted_sha1Údjango_salted_md5Údjango_des_cryptÚdjango_disabledÚdlitz_pbkdf2_sha1Úfshpzpasslib.handlers.fshpÚgrub_pbkdf2_sha512Úhex_md4zpasslib.handlers.digestsÚhex_md5Úhex_sha1Ú
hex_sha256Ú
hex_sha512ÚhtdigestÚldap_plaintextzpasslib.handlers.ldap_digestsÚldap_md5Ú	ldap_sha1Úldap_hex_md5zpasslib.handlers.roundupÚldap_hex_sha1Úldap_salted_md5Úldap_salted_sha1Úldap_salted_sha256Úldap_salted_sha512Úldap_des_cryptÚldap_bsdi_cryptÚldap_md5_cryptÚldap_bcryptÚldap_sha1_cryptÚldap_sha256_cryptÚldap_sha512_cryptÚldap_pbkdf2_sha1Úldap_pbkdf2_sha256Úldap_pbkdf2_sha512ÚlmhashÚ	md5_cryptÚmsdccÚmsdcc2Ú	mssql2000zpasslib.handlers.mssqlÚ	mssql2005Úmysql323zpasslib.handlers.mysqlÚmysql41ÚnthashÚoracle10zpasslib.handlers.oracleÚoracle11Úpbkdf2_sha1Úpbkdf2_sha256Úpbkdf2_sha512Úphpasszpasslib.handlers.phpassÚ	plaintextzpasslib.handlers.miscÚpostgres_md5zpasslib.handlers.postgresÚroundup_plaintextÚscramzpasslib.handlers.scramÚscryptzpasslib.handlers.scryptÚ
sha1_cryptzpasslib.handlers.sha1_cryptÚsha256_cryptzpasslib.handlers.sha2_cryptÚsha512_cryptÚsun_md5_cryptzpasslib.handlers.sun_md5_cryptÚunix_disabledÚunix_fallbackz^[a-z][a-z0-9_]+[a-z0-9]$)ÚonloadÚpolicyÚcontextÚallÚdefaultÚnoneÚautoc                 óü   — | st        d| ›�«      ‚| j                  «       | k7  rt        d| ›�«      ‚t        j                  | «      st        d| ›�«      ‚d| v rt        d| ›�«      ‚| t        v rt        d| ›�«      ‚y)zßhelper to validate handler name

    :raises ValueError:
        * if empty name
        * if name not lower case
        * if name contains double underscores
        * if name is reserved (e.g. ``context``, ``all``).
    zhandler name cannot be empty: zname must be lower-case: z^invalid name (must be 3+ characters,  begin with a-z, and contain only underscore, a-z, 0-9): Ú__z)name may not contain double-underscores: zthat name is not allowed: T)Ú
ValueErrorÚlowerÚ_name_reÚmatchÚ_forbidden_names)Únames    r   Ú_validate_handler_namer’   ³   sŠ   € ñ Ý¹tÐEÓFÐFØ‡z�zƒ|�tÒÝ¹$Ð@ÓAÐAÜ�>‰>˜$ÔÝá'+ð.ó /ð 	/ð ˆt�|ÝÙð!ó "ð 	"àÔÑÝ¹4ÐAÓBÐBØr   c                 ó6  — t        | «       |j                  d«      rt        d«      ‚d|v rN|j                  d«      dkD  rt        d«      ‚|j	                  d|j                  d«      «      dkD  rt        d«      ‚|t        | <   t        j                  d| |«       y	)
av  register location to lazy-load handler when requested.

    custom hashes may be registered via :func:`register_crypt_handler`,
    or they may be registered by this function,
    which will delay actually importing and loading the handler
    until a call to :func:`get_crypt_handler` is made for the specified name.

    :arg name: name of handler
    :arg path: module import path

    the specified module path should contain a password hash handler
    called :samp:`{name}`, or the path may contain a colon,
    specifying the module and module attribute to use.
    for example, the following would cause ``get_handler("myhash")`` to look
    for a class named ``myhash`` within the ``myapp.helpers`` module::

        >>> from passlib.registry import registry_crypt_handler_path
        >>> registry_crypt_handler_path("myhash", "myapp.helpers")

    ...while this form would cause ``get_handler("myhash")`` to look
    for a class name ``MyHash`` within the ``myapp.helpers`` module::

        >>> from passlib.registry import registry_crypt_handler_path
        >>> registry_crypt_handler_path("myhash", "myapp.helpers:MyHash")
    Ú.zpath cannot start with '.'Ú:é   z"path cannot have more than one ':'éÿÿÿÿz$path cannot have '.' to right of ':'z!registered path to %r handler: %rN)	r’   r   rŒ   ÚcountÚfindÚindexr-   ÚlogÚdebug)r‘   Úpaths     r   r   r   Ë   s�   € ô6 ˜4Ô ð ‡��sÔÜÐ5Ó6Ð6Ø
ˆd�{Ø�:‰:�c‹?˜QÒÜÐAÓBÐBØ�9‰9�S˜$Ÿ*™* S›/Ó*¨RÒ/ÜÐCÓDÐDð „JˆtÑÜ‡I�IÐ1°4¸Õ>r   Fc                 óª  — t        | «      st        | dd«      ‚| st        d«      ‚| j                  }t	        |«       |r||k7  rt        d|›d|›d�«      ‚t        j                  |«      }|rG|| u rt        j                  d|| «       y|rt        j                  d	||«       nt        d
|›d|›�«      ‚| t        |<   t        j                  d|| «       y)a@  register password hash handler.

    this method immediately registers a handler with the internal passlib registry,
    so that it will be returned by :func:`get_crypt_handler` when requested.

    :arg handler: the password hash handler to register
    :param force: force override of existing handler (defaults to False)
    :param _attr:
        [internal kwd] if specified, ensures ``handler.name``
        matches this value, or raises :exc:`ValueError`.

    :raises TypeError:
        if the specified object does not appear to be a valid handler.

    :raises ValueError:
        if the specified object's name (or other required attributes)
        contain invalid values.

    :raises KeyError:
        if a (different) handler was already registered with
        the same name, and ``force=True`` was not specified.
    zpassword hash handlerr   z``bool(handler)`` must be Truez3handlers must be stored only under their own name (z != Ú)z&same %r handler already registered: %rNz/overriding previously registered %r handler: %rzanother z& handler has already been registered: zregistered %r handler: %r)r   r   ÚAssertionErrorr‘   r’   rŒ   Ú	_handlersÚgetr›   rœ   ÚwarningÚKeyError)r   Úforcer   r‘   Úothers        r   r   r   õ   sÙ   € ô0 ˜GÔ$Ü Ð)@À)ÓLÐLÙÜÐ=Ó>Ð>ð �<‰<€DÜ˜4Ô Ù�˜$’ÝÚ¢ð'ó (ð 	(ô �M‰M˜$Ó€EÙØ�GÑÜ�I‰IÐ>ÀÀgÔNØÙÜ�K‰KÐIØ˜eõ%õ Ú ¡%ð)ó *ð *ð „Iˆd�OÜ‡I�IÐ)¨4°Õ9r   c                 ó²  — | j                  d«      r|t        u rt        d| ›�«      ‚|S 	 t        |    S # t        $ r Y nw xY wt	        | t
        «      sJ d«       ‚| j                  dd«      j                  «       }|| k7  r3t        d| ›d|›�t        d¬«       |} 	 t        |    S # t        $ r Y nw xY wt        j                  | «      }|rxd	|v r|j                  d	«      \  }}n|| }}t        ||gd
¬«      }t        j                  | «      }|rt        |«      sJ d| ›d|›�«       ‚|S t        ||«      }t!        || ¬«       |S |t        u rt        d| ›�«      ‚|S )a'  return handler for specified password hash scheme.

    this method looks up a handler for the specified scheme.
    if the handler is not already loaded,
    it checks if the location is known, and loads it first.

    :arg name: name of handler to return
    :param default: optional default value to return if no handler with specified name is found.

    :raises KeyError: if no handler matching that name is found, and no default specified, a KeyError will be raised.

    :returns: handler attached to name, or default value (if specified).
    r   zinvalid handler name: zname must be string instanceÚ-zLhandler names should be lower-case, and use underscores instead of hyphens: z => é   )Ú
stacklevelr•   r   )ÚfromlistÚlevelzunexpected object: name=z object=r   z&no crypt handler found for algorithm: )r   Ú_UNSETr¤   r¡   Ú
isinstancer   Úreplacer�   r   r   r-   r¢   ÚsplitÚ
__import__r   Úgetattrr   )r‘   r‡   Úaltr�   ÚmodnameÚmodattrÚmodr   s           r   r   r   *  sw  € ð  ‡��sÔØ”fÑÝ¹Ð?Ó@Ð@àˆNðÜ˜‰ÐøÜò Ùðúô �dœNÔ+ÐKÐ-KÓKÐ+Ø
�,‰,�s˜3Ó
×
%Ñ
%Ó
'€CØ
ˆd‚{ÝÚ'+©Sð2Ü3AØõ	ð ˆð	Ü˜T‘?Ð"øÜò 	Ùð	úô �>‰>˜$Ó€DÙØ�$‰;Ø#Ÿz™z¨#›ÑˆG‘Wà# T�WˆGô
 ˜¨G¨9¸AÔ>ˆô —-‘- Ó%ˆÙä# GÔ,ÑfÒX\Ñ^eÐ.fÓfÐ,ØˆNô ˜#˜wÓ'ˆÜ˜w¨dÕ3Øˆð ”&ÑÝÁTÐKÓLÐLàˆs    «4 ´	A ¿A ÂB# Â#	B/Â.B/c                 ór   — t        t        «      }| s|j                  t        «       t	        d„ |D «       «      S )zÒreturn sorted list of all known crypt handler names.

    :param loaded_only: if ``True``, only returns names of handlers which have actually been loaded.

    :returns: list of names of all known handlers
    c              3   óD   K  — | ]  }|j                  d «      rŒ|–— Œ y­w)r   N)r   ©Ú.0r‘   s     r   Ú	<genexpr>z&list_crypt_handlers.<locals>.<genexpr>�  s   è ø€ ÐE¡5˜4°·±ÀÕ0D”$¡5ùs   ‚ ™ )r(   r¡   r+   r-   r.   )Úloaded_onlyÚnamess     r   r   r   u  s/   € ô ”	‹N€EÙØ�‰”ZÔ ô ÑE¡5ÓEÓEÐEr   c                 ó0   — | t         v xs | xr | t        v S )aA  check if handler name is known.

    this is only useful for two cases:

    * quickly checking if handler has already been loaded
    * checking if handler exists, without actually loading it

    :arg name: name of handler
    :param loaded_only: if ``True``, returns False if handler exists but hasn't been loaded
    ©r¡   r-   )r‘   r¼   s     r   Ú_has_crypt_handlerrÀ   …  s    € ð ”IÐÒJ { ?Ò#I°t¼zÐ7IÐJr   c                 óH   — | t         v rt         | = |r| t        v rt        | = yyy)a£  unloads a handler from the registry.

    .. warning::

        this is an internal function,
        used only by the unittests.

    if loaded handler is found with specified name, it's removed.
    if path to lazy load handler is found, it's removed.

    missing names are a noop.

    :arg name: name of handler to unload
    :param locations: if False, won't purge registered handler locations (default True)
    Nr¿   )r‘   Ú	locationss     r   Ú_unload_handler_namerÃ   ’  s,   € ð  ŒyÑÜ�dˆOÙ�TœZÑ'Ü�tÑð (€yr   c                 óˆ   — t        | «      r| S t        | t        «      rt        | «      S t	        j
                  | t        |«      ‚)z>
    internal helper to resolve argument to hasher object
    )r   r®   r   r   r   r   )ÚhasherÚparams     r   Ú_resolverÇ   °  s;   € ô ˜ÔØˆÜ	�FœNÔ	+Ü  Ó(Ð(ä×#Ñ# F¬N¸EÓBÐBr   ÚanyÚbuiltinÚos_cryptc                 ó<  — t        | «      } |t        k(  rt        | d«      sy	 | j                  «        yt        | d«      r"|r|| j                  vry| j                  |«      S |t        k(  ry|ryt	        j                  | |«      ‚# t        j
                  $ r Y yw xY w)a£  
    Test if specified backend is available for hasher.

    :param hasher:
        Hasher name or object.

    :param backend:
        Name of backend, or ``"any"`` if any backend will do.
        For hashers without multiple backends, will pretend
        they have a single backend named ``"builtin"``.

    :param safe:
        By default, throws error if backend is unknown.
        If ``safe=True``, will just return false value.

    :raises ValueError:
        * if hasher name is unknown.
        * if backend is unknown to hasher, and safe=False.

    :return:
        True if backend available, False if not available,
        and None if unknown + safe=True.
    Úget_backendTFÚhas_backendN)
rÇ   ÚANYÚhasattrrÌ   r   ÚMissingBackendErrorÚbackendsrÍ   ÚBUILTINÚUnknownBackendError)rÅ   ÚbackendÚsafes      r   rÍ   rÍ   Â  s¤   € ô0 �fÓ€Fà”#‚~Ü�v˜}Ô-àð	Ø×ÑÔ Øô
 ˆv�}Ô%á�G 6§?¡?Ñ2ØØ×!Ñ! 'Ó*Ð*ð ”'ÒØÙ	Øä×%Ñ% f¨gÓ6Ð6øô! ×&Ñ&ò 	Ùð	ús   £B ÂBÂBc                  óÆ   — t         syt        d„ t        D «       «      } | sAddl}t	        d|j                  «       ›d|j                  «       ›d�t        j                  «       | S )zN
    return tuple of schemes which :func:`crypt.crypt` natively supports.
    r$   c              3   ó\   K  — | ]$  }t        |«      j                  t        «      r|–— Œ& y ­wr'   )r   rÍ   ÚOS_CRYPTr¹   s     r   r»   z1get_supported_os_crypt_schemes.<locals>.<genexpr>  s,   è ø€ ð DÑ#3˜4Ü& tÓ,×8Ñ8¼ÔBô Ñ#3ùs   ‚*,r   Nz]crypt.crypt() function is present, but doesn't support any formats known to passlib! (system=z	 release=rŸ   )	Úos_crypt_presentÚtupleÚos_crypt_schemesÚplatformr   ÚsystemÚreleaser   ÚPasslibRuntimeWarning)ÚcacherÜ   s     r   Úget_supported_os_crypt_schemesrá      s^   € õ
 ØÜñ DÕ#3ó Dó D€EáãÝà�o‰oÕ ×!1Ñ!1Õ!3ð5ô ×&Ñ&ô	(ð €Lr   c                 ó6   — t         xr t        | t        d¬«      S )a  
    check if hash is supported by native :func:`crypt.crypt` function.
    if :func:`crypt.crypt` is not present, will always return False.

    :param hasher:
        name or hasher object.

    :returns bool:
        True if hash format is supported by OS, else False.
    T)rÕ   )rÙ   rÍ   rØ   )rÅ   s    r   Úhas_os_crypt_supportrã     s   € ô ÒH¤¨F´HÀ4Ô HÐHr   r$   )FN)F)T)r"   )4r4   ÚreÚloggingÚ	getLoggerr1   r›   Úwarningsr   Úpasslibr   Úpasslib.excr   r   Úpasslib.ifcr   Úpasslib.utilsr   r	   rÙ   r
   rÛ   Úpasslib.utils.compatr   Úpasslib.utils.decorr   Ú__all__r    r   Ú_proxyr­   r,   r¡   Údictr-   ÚcompilerŽ   Ú	frozensetr�   r’   r   r   r   r   rÀ   rÃ   rÇ   rÎ   rÒ   rØ   rÍ   rá   rã   r$   r   r   Ú<module>ró      sÀ  ðÙ <ó
 
Û Ð'�g×'Ñ'¨Ó1�Ý å ß 9Ý $÷ñ õ 0Ý 4ò€ô&˜Fô &ñR 
Ó	 €ñ 
‹€ð �O‰O€	ñ
 ò Pñ 1ðPñ 'ð	Pñ
 6ðPñ 'ðPñ .ðPñ ,ðPñ ,ðPñ .ðPñ )ðPñ )ðPñ +ðPñ 0ðPñ +ðPñ  -ð!Pñ" .ð#Pñ$ .ð%Pñ& 5ð'Pñ( 5ð)Pñ* 3ð+Pñ, 3ð-Pñ. 2ð/Pñ0 1ð1Pñ2 0ð3Pñ4 2ð5Pñ6 #ð7Pñ8 3ð9Pñ: )ð;Pñ< )ð=Pñ> *ð?Pñ@ ,ðAPñB ,ðCPñD *ðEPñF 5ðGPñH /ðIPñJ 0ðKPñL .ðMPñN /ðOPñP 6ðQPñR 7ðSPñT 9ðUPñV 9ðWPñX 5ðYPñZ 6ð[Pñ\ 5ð]Pñ^ 2ð_Pñ` 6ðaPñb 8ðcPñd 8ðePñf 1ðgPñh 3ðiPñj 3ðkPñl (ðmPñn -ðoPñp 'ðqPñr (ðsPñt )ðuPñv )ðwPñx (ðyPñz 'ð{Pñ| (ð}Pñ~ )ðPñ@ )ðAPñB ,ðCPñD .ðEPñF .ðGPñH 'ðIPñJ (ðKPñL /ðMPñN 3ðOPñP %ðQPñR 'ðSPñT /ðUPñV 1ðWPñX 1ðYPñZ 5ð[Pñ\ ,ð]Pñ^ ,ð_P€
ðf ˆ2�:‰:Ð1Ó2€ñ ò 9ó :Ð òò0(?óT3:ðj %+ó IóVFó Kóó<	Cð €Ø
€Ø€ð !$¨%ó 37ð| ñó ðó&Ir   