403Webshell
Server IP : 217.160.0.135  /  Your IP : 216.73.217.85
Web Server : Apache
System : Linux www 6.18.52-i1-ampere #1203 SMP Mon Sep 14 18:29:59 CEST 2026 aarch64
User : sws1074145052 ( 1074145052)
PHP Version : 8.3.32
Disable Function : NONE
MySQL : OFF  |  cURL : ON  |  WGET : ON  |  Perl : ON  |  Python : OFF  |  Sudo : OFF  |  Pkexec : OFF
Directory :  /lib/python3/dist-packages/django/contrib/messages/storage/__pycache__/

Upload File :
current_dir [ Writeable ] document_root [ Writeable ]

 

Command :


[ Back ]     

Current File : /lib/python3/dist-packages/django/contrib/messages/storage/__pycache__/cookie.cpython-311.pyc
�

�|�e�����ddlZddlZddlmZddlmZmZddlmZddl	m
Z
ddlmZm
Z
ddlmZmZGd�d	ej��ZGd
�dej��ZGd�d
��ZGd�de��ZdS)�N)�settings)�BaseStorage�Message)�signing)�SimpleCookie)�constant_time_compare�salted_hmac)�SafeData�	mark_safec�&��eZdZdZdZ�fd�Z�xZS)�MessageEncoderzI
    Compactly serialize instances of the ``Message`` class as JSON.
    �__json_messagec���t|t��rVt|jt��rdnd}|j||j|jg}|jr|�|j��|St���	|��S)N�r)
�
isinstancer�messager
�message_key�level�
extra_tags�append�super�default)�self�obj�is_safedatar�	__class__s    ��H/usr/lib/python3/dist-packages/django/contrib/messages/storage/cookie.pyrzMessageEncoder.defaults}����c�7�#�#�	�)�#�+�x�@�@�G�!�!�a�K��'��c�i���M�G��~�
/����s�~�.�.�.��N��w�w���s�#�#�#�)�__name__�
__module__�__qualname__�__doc__rr�
__classcell__�rs@rr
r
sI���������#�K�$�$�$�$�$�$�$�$�$rr
c�(��eZdZdZd�Z�fd�Z�xZS)�MessageDecoderzE
    Decode JSON that includes serialized ``Message`` instances.
    c�J��t|t��rW|rU|dtjkr1|drt	|d��|d<t|dd��S�fd�|D��St|t��r �fd�|���D��S|S)Nrr��c�:��g|]}��|����S���process_messages)�.0�itemrs  �r�
<listcomp>z3MessageDecoder.process_messages.<locals>.<listcomp>(s'���@�@�@�D�D�)�)�$�/�/�@�@�@rc�B��i|]\}}|��|����Sr+r,)r.�key�valuers   �r�
<dictcomp>z3MessageDecoder.process_messages.<locals>.<dictcomp>*s=���3�3�3�"��U���.�.�u�5�5�3�3�3r)r�listr
rrr�dict�items�rrs` rr-zMessageDecoder.process_messages"s�����c�4� � �	A�S�	A��1�v��3�3�3��q�6�/�&�s�1�v�.�.�C��F���A�B�B��(�(�@�@�@�@�C�@�@�@�@��c�4� � �	3�3�3�3�3�&)�i�i�k�k�3�3�3�
3��
rc�b��t��j|fi|��}|�|��S)N)r�decoder-)r�s�kwargs�decodedrs    �rr:zMessageDecoder.decode.s4��� �%�'�'�.��-�-�f�-�-���$�$�W�-�-�-r)rr r!r"r-r:r#r$s@rr&r&sQ���������
�
�
�.�.�.�.�.�.�.�.�.rr&c��eZdZd�Zd�ZdS)�MessageSerializerc�`�tj|dt����d��S)N)�,�:)�
separators�cls�latin-1)�json�dumpsr
�encoder8s  rrGzMessageSerializer.dumps4s3���z��!��
�
�
��&��
�
�		rc�^�tj|�d��t���S)NrE�rD)rF�loadsr:r&)r�datas  rrKzMessageSerializer.loads;s#���z�$�+�+�i�0�0�n�E�E�E�ErN)rr r!rGrKr+rrr?r?3s7���������F�F�F�F�Frr?c�`��eZdZdZdZdZdZdZ�fd�Zd�Z	d�Z
dd
�Zd�Zdd
�Z
d�Zd�Z�xZS)�
CookieStoragez%
    Store messages in a cookie.
    �messagesi�__messagesnotfinished__�django.contrib.messagesc�x��t��j|i|��tj|j���|_dS)N)�salt)r�__init__r�get_cookie_signer�key_salt�signer)r�argsr<rs   �rrTzCookieStorage.__init__Ks:��������$�)�&�)�)�)��/�T�]�C�C�C����rc���|jj�|j��}|�|��}|o|d|jk}|r|s|���||fS)a

        Retrieve a list of messages from the messages cookie. If the
        not_finished sentinel value is found at the end of the message list,
        remove it and return a result indicating that not all messages were
        retrieved by this storage.
        ���)�request�COOKIES�get�cookie_name�_decode�not_finished�pop)rrXr<rLrO�
all_retrieveds      r�_getzCookieStorage._getOsp���|�#�'�'��(8�9�9���<�<��%�%��%�K�(�2�,�$�:K�*K�L�
��	�M�	��L�L�N�N�N���&�&rc��|rN|�|j|tjtjpdtjpdtj���dS|�|jtjtj���dS)zz
        Either set the cookie with the encoded data if there is any data to
        store, or delete the cookie.
        N)�domain�secure�httponly�samesite)rerh)�
set_cookier^r�SESSION_COOKIE_DOMAIN�SESSION_COOKIE_SECURE�SESSION_COOKIE_HTTPONLY�SESSION_COOKIE_SAMESITE�
delete_cookie)r�encoded_data�responses   r�_update_cookiezCookieStorage._update_cookie^s���
�
	����� �,��5��5�=��!�9�A�T�!�9�
 �
�
�
�
�
�
�"�"�� ��5�!�9�
#�
�
�
�
�
rTc���	�g}|�|��}|jr�t���	�	fd�}|r�||��|jkr�|r)|�|�d����n(|�d|�����|�||jgz|���}|r||��|jk��|�||��|S)aT
        Store the messages to a cookie and return a list of any messages which
        could not be stored.

        If the encoded data is larger than ``max_cookie_size``, remove
        messages until the data fits (these are the messages which are
        returned), and add the not_finished sentinel value to indicate as much.
        c�T��t��|��d��S)Nr)�len�value_encode)�val�cookies �r�
stored_lengthz+CookieStorage._store.<locals>.stored_length�s$����6�.�.�s�3�3�A�6�7�7�7rr)�encode_empty)�_encode�max_cookie_sizerrra�insertr`rq)
rrOrp�
remove_oldestrXr<�unstored_messagesrorxrws
         @r�_storezCookieStorage._storers ������|�|�H�-�-����	L�"�^�^�F�
8�
8�
8�
8�
8��
L�=�=��#>�#>��AU�#U�#U� �@�%�,�,�X�\�\�!�_�_�=�=�=�=�%�,�,�Q������?�?�?�#�|�|�H��8I�7J�,J�9J� ,� L� L���
L�=�=��#>�#>��AU�#U�#U�	
���L�(�3�3�3� � rc�J�d}t||�����S)z�
        # RemovedInDjango40Warning: pre-Django 3.1 hashes will be invalid.
        Create an HMAC/SHA1 hash based on the value and the project setting's
        SECRET_KEY, modified to make it unique for the present purpose.
        rQ)r	�	hexdigest)rr3rVs   r�_legacy_hashzCookieStorage._legacy_hash�s%��-���8�U�+�+�5�5�7�7�7rFc�R�|s|r"|j�|td���SdS)a
        Return an encoded version of the messages list which can be stored as
        plain text.

        Since the data will be retrieved from the client-side, the encoded data
        also contains a hash to ensure that the data was not tampered with.
        T)�
serializer�compressN)rW�sign_objectr?)rrOrys   rrzzCookieStorage._encode�s@���	b�|�	b��;�*�*�8�@Q�\`�*�a�a�a�	b�	brc��|sdS	|j�|t���S#tj$r|�|��}Yn:tjtj	f$r|j�
|��}YnwxYw|r1	tj|t���S#tj	$rYnwxYwd|_
dS)z�
        Safely decode an encoded text stream back into a list of messages.

        If the encoded text stream contained an invalid hash or was in an
        invalid format, return None.
        N)r�rJT)rW�
unsign_objectr?r�BadSignature�_legacy_decode�binascii�ErrorrF�JSONDecodeError�unsignrKr&�used)rrLr=s   rr_zCookieStorage._decode�s����	��4�	/��;�,�,�T�>O�,�P�P�P��
�#�	0�	0�	0��)�)�$�/�/�G�G�G���� 4�5�	/�	/�	/��k�(�(��.�.�G�G�G�	/�����	�
��z�'�~�>�>�>�>���'�
�
�
���
������	��ts'� '�$B�
4B�B�
B%�%B7�6B7c��|�dd��}t|��dkr*|\}}t||�|����r|SdS)N�$rr))�splitrtrr�)rrL�bits�hash_r3s     rr�zCookieStorage._legacy_decode�sW���z�z�#�q�!�!���t�9�9��>�>��L�E�5�$�U�D�,=�,=�e�,D�,D�E�E�
����tr)T)F)rr r!r"r^r{r`rVrTrcrqrr�rzr_r�r#r$s@rrNrN?s�����������K��O�,�L�(�H�D�D�D�D�D�
'�
'�
'����(!�!�!�!�:
8�
8�
8�	b�	b�	b�	b� � � �D������rrN)r�rF�django.confr�$django.contrib.messages.storage.baserr�django.corer�django.httpr�django.utils.cryptorr	�django.utils.safestringr
r�JSONEncoderr
�JSONDecoderr&r?rNr+rr�<module>r�s]���������� � � � � � �E�E�E�E�E�E�E�E�������$�$�$�$�$�$�B�B�B�B�B�B�B�B�7�7�7�7�7�7�7�7�$�$�$�$�$�T�%�$�$�$�".�.�.�.�.�T�%�.�.�.�,	F�	F�	F�	F�	F�	F�	F�	F�P�P�P�P�P�K�P�P�P�P�Pr

Youez - 2016 - github.com/yon3zu
LinuXploit