+
    i}'                     n   R t ^ RIt^ RIt]P                  ! ]4      t^ RIHt ^ RIH	t	H
t
 ^ RIHtHtHt ^ RIHu Ht . ROt ! R R]P(                  P*                  ]P,                  4      t]! R	4      tR
t ! R R]P(                  P*                  ]P4                  4      t ! R R]P4                  4      tR# )z.passlib.handlers.misc - misc generic handlers
N)warn)to_native_strstr_consteq)unicodeuunicode_or_bytes_typesunix_disabledunix_fallback	plaintextc                   l   a a ] tR t^t oRtR tRt]R 4       tRV 3R llt	R t
]RR l4       tRtVtV ;t# )r	   aQ  This class provides the fallback behavior for unix shadow files, and follows the :ref:`password-hash-api`.

This class does not implement a hash, but instead provides fallback
behavior as found in /etc/shadow on most unix variants.
If used, should be the last scheme in the context.

* this class will positively identify all hash strings.
* for security, passwords will always hash to ``!``.
* it rejects all passwords if the hash is NOT an empty string (``!`` or ``*`` are frequently used).
* by default it rejects all passwords if the hash is an empty string,
  but if ``enable_wildcard=True`` is passed to verify(),
  all passwords will be allowed through if the hash is an empty string.

.. deprecated:: 1.6
    This has been deprecated due to its "wildcard" feature,
    and will be removed in Passlib 1.8. Use :class:`unix_disabled` instead.
c                r    \        V\        4      '       d   R # \        P                  P	                  VR4      hThash
isinstancer   uhexcExpectedStringErrorclsr   s   &&S/var/www/html/photoedit/myenv/lib/python3.14/site-packages/passlib/handlers/misc.pyidentifyunix_fallback.identify.   *    d233&&,,T6::    c                \   < \        R \        4       \        \        V `  ! R/ VB  Wn        R# )zf'unix_fallback' is deprecated, and will be removed in Passlib 1.8; please use 'unix_disabled' instead.N )r   DeprecationWarningsuperr	   __init__enable_wildcard)selfr    kwds	__class__s   &&,r   r   unix_fallback.__init__5   s/     3  	! 	mT+3d3.r   c                T    V P                   '       d   V P                   # \        R 4      # )!)checksumr   )r!   secrets   &&r   _calc_checksumunix_fallback._calc_checksum=   s     === == S6Mr   c                    \         P                  ! V4       \        V\        4      '       g!   \         P                  P                  VR 4      hV'       d   R# V# )r   F)r   validate_secretr   r   r   r   )r   r(   r   r    s   &&&&r   verifyunix_fallback.verifyE   sA    
6"$ 677&&,,T6::""r   )r    F)__name__
__module____qualname____firstlineno____doc__namecontext_kwdsclassmethodr   r   r)   r-   __static_attributes____classdictcell____classcell__r#   __classdict__s   @@r   r	   r	      sK     " D'L; ;/ # # #r   z*!s   *!c                   F  a a ] tR t^Rt oRtR tRtRt]! ]	! ]
4      4      tR]P                  9   d
   ]! R4      tM]! R4      t]RV 3R ll4       t]R 4       t]R 4       t]R 4       t]P,                  ! R	R
R7      ]RR l4       4       t]RR l4       t]R 4       tRtVtV ;t# )r   a  This class provides disabled password behavior for unix shadow files,
and follows the :ref:`password-hash-api`.

This class does not implement a hash, but instead matches the "disabled account"
strings found in ``/etc/shadow`` on most Unix variants. "encrypting" a password
will simply return the disabled account marker. It will reject all passwords,
no matter the hash string. The :meth:`~passlib.ifc.PasswordHash.hash`
method supports one optional keyword:

:type marker: str
:param marker:
    Optional marker string which overrides the platform default
    used to indicate a disabled account.

    If not specified, this will default to ``"*"`` on BSD systems,
    and use the Linux default ``"!"`` for all other platforms.
    (:attr:`!unix_disabled.default_marker` will contain the default value)

.. versionadded:: 1.6
    This class was added as a replacement for the now-deprecated
    :class:`unix_fallback` class, which had some undesirable features.
bsd*r&   c                   < \         \        V `
  ! R/ VB pVe0   V P                  V4      '       g   \	        RV,          4      hWn        V# )Nzinvalid marker: %rr   )r   r   usingr   
ValueErrordefault_marker)r   markerr"   subclsr#   s   &&, r   rA   unix_disabled.usingx   sH    }c0848<<'' !5!>??$*!r   c                    \        V\        4      '       d   \        pM=\        V\        4      '       d   \        pM \
        P                  P                  VR 4      hV'       * ;'       g    V^ ,          V9   # r   )r   r   _MARKER_CHARSbytes_MARKER_BYTESr   r   r   )r   r   starts   && r   r   unix_disabled.identify   sX      dG$$!Ee$$!E&&,,T6::x++47e++r   c                    \         P                  ! V4       V P                  V4      '       g    \         P                  P	                  V 4      hR # r/   )r   r,   r   r   InvalidHashError)r   r(   r   s   &&&r   r-   unix_disabled.verify   s7    
6"||D!!&&))#..r   c                    V'       d8   \         P                  ! W4       V P                  ! R/ VB P                  V4      # \         P                  ! V4       V P
                  pV'       d   V P                  V4      '       g   Q h\        VR R7      # )rD   paramr   )r   warn_hash_settings_deprecationrA   r   r,   rC   r   r   )r   r(   r"   rD   s   &&, r   r   unix_disabled.hash   sm    --c899$t$))&11
6"###,,v....V844r   1.72.0
deprecatedremovedc                   V P                  V4      '       g    \        P                  P                  V 4      hV'       d$   \        P                  ! V4       \        VR R7      # Ve   V P                  VR7      p V P                  V4      # )configrR   rD   )r   r   r   rO   r,   r   rA   r   )r   r(   r\   rD   s   &&&&r   genhashunix_disabled.genhash   sk     ||F##&&))#..v& x88!iivi.88F##r   c                    V P                  R 4      pVeF   \        VRR7      pV P                  V4      '       d   V P                  V4      pV'       d	   W!,          pV# ) r   rR   )r   r   r   enable)r   r   outs   && r   disableunix_disabled.disable   sM    hhrl V4D||D!!zz$'
r   c                    \        VR R7      pV P                   F?  pVP                  V4      '       g   K  V\        V4      R pV'       d   Vu # \	        R4      h	  \
        P                  P                  V 4      h)r   rR   Nzcannot restore original hash)r   _disable_prefixes
startswithlenrB   r   r   rO   )r   r   prefixorigs   &&  r   rb   unix_disabled.enable   sh    T0++Fv&&CKL)K$%CDD , ff%%c**r   r   r]   N)r0   r1   r2   r3   r4   r5   setting_kwdsr6   tuplestrrI   rg   sysplatformr   rC   r7   rA   r   r-   r   r   deprecated_methodr^   rd   rb   r8   r9   r:   r;   s   @@r   r   r   R   s     , DLLc-01 3
 3  , ,.   5 5 UE:
$  ;
$ 	 	 	+ 	+ 	+r   c                      a  ] tR t^t o RtR tRtRtRt]	R 4       t
]	RR l4       t]	RR l4       t]P                  ! RRR	7      ]	R
 4       4       t]P                  ! RRR	7      ]	RR l4       4       tRtV tR# )r
   aV  This class stores passwords in plaintext, and follows the :ref:`password-hash-api`.

The :meth:`~passlib.ifc.PasswordHash.hash`, :meth:`~passlib.ifc.PasswordHash.genhash`, and :meth:`~passlib.ifc.PasswordHash.verify` methods all require the
following additional contextual keyword:

:type encoding: str
:param encoding:
    This controls the character encoding to use (defaults to ``utf-8``).

    This encoding will be used to encode :class:`!unicode` passwords
    under Python 2, and decode :class:`!bytes` hashes under Python 3.

.. versionchanged:: 1.6
    The ``encoding`` keyword was added.
zutf-8c                r    \        V\        4      '       d   R # \        P                  P	                  VR4      hr   r   r   s   &&r   r   plaintext.identify   r   r   Nc                n    \         P                  ! V4       V'       g   V P                  p\        WR 4      # )r(   )r   r,   default_encodingr   )r   r(   encodings   &&&r   r   plaintext.hash   s+    
6"++HVx88r   c                    V'       g   V P                   p\        W#R 4      pV P                  V4      '       g    \        P                  P                  V 4      h\        V P                  W4      V4      # rH   )rx   r   r   r   r   rO   r   r   )r   r(   r   ry   s   &&&&r   r-   plaintext.verify   sV    ++HTV4||D!!&&))#..388F5t<<r   rV   rW   rX   c                $    V P                  R 4      # )ra   rH   )r   s   &r   	genconfigplaintext.genconfig   s     xx|r   c                    V P                  V4      '       g    \        P                  P                  V 4      hV P	                  WR 7      # )ry   )r   r   r   rO   r   )r   r(   r\   ry   s   &&&&r   r^   plaintext.genhash  s9     ||F##&&))#..xxx22r   r   r   rm   )r0   r1   r2   r3   r4   r5   rn   r6   rx   r7   r   r   r-   r   rs   r~   r^   r8   r9   )r<   s   @r   r
   r
      s     " DL L; ; 9 9 = = UE:  ; UE:3  ;3r   )r   r	   r
   )r4   rq   logging	getLoggerr0   logwarningsr   passlib.utilsr   r   passlib.utils.compatr   r   r   passlib.utils.handlersutilshandlersr   __all__ifcDisabledHashStaticHandlerr	   rI   rK   MinimalHandlerr   r
   r   r   r   <module>r      s     g''1  5 C C # #4#BFF'')9)9 4#l $|+BFF''):): |+|93!! 93r   