AlkantarClanX12

Your IP : 3.135.216.196


Current Path : /opt/cloudlinux/venv/lib64/python3.11/site-packages/raven/__pycache__/
Upload File :
Current File : //opt/cloudlinux/venv/lib64/python3.11/site-packages/raven/__pycache__/processors.cpython-311.pyc

�

�܋f����dZddlmZddlZddlZddlmZmZmZddl	m
Z
Gd�de��ZGd�d	e��Z
Gd
�de��ZGd�d
e��ZGd�de��ZdS)z�
raven.core.processors
~~~~~~~~~~~~~~~~~~~~~

:copyright: (c) 2010-2012 by the Sentry Team, see AUTHORS for more details.
:license: BSD, see LICENSE for more details.
�)�absolute_importN)�string_types�	text_type�PY3)�varmapc�2�eZdZd�Zd�Zd�Zd�Zd�Zd�ZdS)�	Processorc��||_dS�N)�client)�selfrs  �G/opt/cloudlinux/venv/lib64/python3.11/site-packages/raven/processors.py�__init__zProcessor.__init__s
�������c��dSr��r
�data�kwargss   r�get_datazProcessor.get_datas���rc�D�|j|fi|��}|r|}d|vrHd|dvr>|d�dg��D]!}d|vr|�|d���"d|vr|�|d��d|vr|�|d��|d<|S)N�	exception�values�
stacktrace�request�extra)r�get�filter_stacktrace�filter_http�filter_extra)r
rr�resp�values     r�processzProcessor.processs����t�}�T�,�,�V�,�,���	��D��$����4��,�,�,�!�+�.�2�2�8�R�@�@�D�D�E�#�u�,�,��.�.�u�\�/B�C�C�C���������T�)�_�-�-�-��d�?�?� �-�-�d�7�m�<�<�D��M��rc��dSrr�r
rs  rrzProcessor.filter_stacktrace+����rc��dSrrr%s  rrzProcessor.filter_http.r&rc��|Srrr%s  rr zProcessor.filter_extra1s���rN)	�__name__�
__module__�__qualname__rrr#rrr rrrr	r	sn���������������&
�
�
�
�
�
�����rr	c��eZdZdZd�ZdS)�RemovePostDataProcessorzRemoves HTTP post data.c�2�|�dd��dS)Nr)�poprs   rrz#RemovePostDataProcessor.filter_http8s�����������rN)r)r*r+�__doc__rrrrr-r-5s)������!�!�����rr-c��eZdZdZd�ZdS)�RemoveStackLocalsProcessorz1Removes local context variables from stacktraces.c�d�|�dg��D]}|�dd���dS�N�frames�vars)rr/)r
rr�frames    rrz,RemoveStackLocalsProcessor.filter_stacktrace?s@���X�X�h��+�+�	$�	$�E��I�I�f�d�#�#�#�#�	$�	$rN)r)r*r+r0rrrrr2r2<s)������;�;�$�$�$�$�$rr2c�J�eZdZdZdZed���Zd�Zd�Zd�Z	d�Z
d�Zd	S)
�SanitizeKeysProcessorzL
    Asterisk out things that correspond to a configurable set of keys.
    z********c�R�t|jd��}|�td���|S)N�
sanitize_keyszFThe sanitize_keys setting must be present to use SanitizeKeysProcessor)�getattrr�
ValueError)r
�keyss  rr;z#SanitizeKeysProcessor.sanitize_keysKs,���t�{�O�4�4���<��e�f�f�f��rc���|�dS|s|St|t��r|�dd��}nt|��}|���}|jD]}||vr	|jcS�|S)N�utf-8�replace)�
isinstance�bytes�decoder�lowerr;�MASK)r
�itemr"�keys    r�sanitizezSanitizeKeysProcessor.sanitizeRs����=��F��	��L��d�E�"�"�	#��;�;�w�	�2�2�D�D��T�?�?�D��z�z�|�|���%�	!�	!�C��d�{�{��y� � � ���rc�~�|�dg��D]%}d|vr�t|j|d��|d<�&dSr4)rrrI)r
rr7s   rrz'SanitizeKeysProcessor.filter_stacktracegsV���X�X�h��+�+�	A�	A�E��U�"�"��"�4�=�%��-�@�@�E�&�M�M�	A�	Arc���dD]�}||vr�tr:t||t��r||�dd��||<t||t��r5d||vr+|dkrd}nd}|�|||��||<��t
|j||��||<|dkr5d	||vr+|�||d	d��||d	<��dS)
N)r�cookies�headers�env�query_stringr@rA�=rL�;�&rM�Cookie)rrBrCrDr�_sanitize_keyvalsrrI)r
r�n�	delimiters    rrz!SanitizeKeysProcessor.filter_httpms��F�	�	�A���}�}���
=�z�$�q�'�5�1�1�
=��q�'�.�.��)�<�<��Q���$�q�'�<�0�0�
�S�D��G�^�^��	�>�>� #�I�I� #�I��0�0��a��)�D�D��Q��� ����Q��8�8��Q���	�>�>�h�$�q�'�&9�&9�(,�(>�(>��Q���)�3�)�)�D��G�H�%��)	�	rc�,�t|j|��Sr)rrIr%s  rr z"SanitizeKeysProcessor.filter_extra�s���d�m�T�*�*�*rc�:�g}|�|��D]e}|�d��}t|��dkr&|�|d|j|�f���P|�|���f|�d�|D����S)NrP�rc3�@K�|]}d�|��V��dS)rPN)�join)�.0�keyvals  r�	<genexpr>z:SanitizeKeysProcessor._sanitize_keyvals.<locals>.<genexpr>�s.����O�O�6�c�h�h�v�.�.�O�O�O�O�O�Or)�split�len�appendrIr[)r
�keyvalsrV�sanitized_keyvalsr]s     rrTz'SanitizeKeysProcessor._sanitize_keyvals�s������m�m�I�.�.�	1�	1�F��\�\�#�&�&�F��6�{�{�a���!�(�(�&��)�]�T�]�F�5K�)L�M�M�M�M�!�(�(��0�0�0�0��~�~�O�O�=N�O�O�O�O�O�OrN)r)r*r+r0rF�propertyr;rIrrr rTrrrr9r9Ds����������D�
����X�����*A�A�A����2+�+�+�	P�	P�	P�	P�	Prr9c���eZdZdZegd���Zejd��Ze	d���Z
e	d���Z�fd�Z�xZ
S)�SanitizePasswordsProcessorz�
    Asterisk out things that look like passwords, credit card numbers,
    and API keys in frames, http, and basic extra data.
    )�password�secret�passwd�
authorization�api_key�apikey�
sentry_dsn�access_tokenz^(?:\d[ -]*?){13,16}$c��|jSr)�KEYS�r
s rr;z(SanitizePasswordsProcessor.sanitize_keys�s
���y�rc�D�tjdt��|jS)Nz�`SanitizePasswordsProcessor.Fields` has been deprecated. Use `SanitizePasswordsProcessor.KEYS` or `SanitizePasswordsProcessor.sanitize_keys` instead)�warnings�warn�DeprecationWarningrprqs r�FIELDSz!SanitizePasswordsProcessor.FIELDS�s*���
�
�
�		
�	
�	
��y�rc����tt|���||��}t|t��r!|j�|��r|jS|Sr)�superrfrIrBr�	VALUES_RE�matchrF)r
rGr"�	__class__s   �rrIz#SanitizePasswordsProcessor.sanitize�sY����0�$�7�7�@�@��u�M�M���e�\�*�*�	�t�~�/C�/C�E�/J�/J�	��9���r)r)r*r+r0�	frozensetrp�re�compileryrdr;rvrI�
__classcell__)r{s@rrfrf�s����������
�9�	�	�	�	�	�D���
�3�4�4�I�
����X������X����������rrf)r0�
__future__rr}rs�raven.utils.compatrrr�raven.utilsr�objectr	r-r2r9rfrrr�<module>r�sT����'�&�&�&�&�&�	�	�	�	�����;�;�;�;�;�;�;�;�;�;�������!�!�!�!�!��!�!�!�H�����i����$�$�$�$�$��$�$�$�NP�NP�NP�NP�NP�I�NP�NP�NP�b$�$�$�$�$�!6�$�$�$�$�$r