[ Avaa Bypassed ]




Upload:

Command:

hmhc3928@18.224.32.243: ~ $
�

>�DgeU���ddlZddlZddlmZddlmZddlmZddlmZddl	m
Z
ddlmZm
Z
ddlmZdd	lmZmZmZmZdd
lmZernddlmZddlmZdd
lmZddlmZddlmZddlmZddlmZddlmZddlm Z ddlm!Z!ddlm"Z"ddlm#Z#ddl$m%Z%ddlm&Z&m'Z'm(Z(m)Z)m*Z*ddl+m,Z,e!d��Z-nd�Z"ed��Z.d�Z/d�Z0Gd�d e1��Z2d!�Z3dd
lmZerGd"�d#e,e#e��Z4nd$���Z4Gd%�d&e5��Z6Gd'�d(e1��Z7Gd)�d*ee6����Z8e8��Z9e.�:e9��dS)+�N)�datetime)�contextmanager)�with_metaclass��Scope)�Client)�Span�Transaction)�Session)�exc_info_from_error�event_from_exception�logger�
ContextVar)�MYPY)�Union)�Any)�Optional)�Tuple)�Dict)�List)�Callable)�	Generator)�Type)�TypeVar)�overload)�ContextManager)�Integration)�Event�Hint�
Breadcrumb�BreadcrumbHint�ExcInfo)�ClientConstructor�Tc��|S�N�)�xs �E/opt/imunify360/venv/lib64/python3.11/site-packages/sentry_sdk/hub.pyrr1s�����sentry_current_hubc��|r|rtd���|�Etj|��}t|��r||��n<|�|��n&|r"tj|��}|jdi|��n|}|S)Nzcannot provide scope and kwargsr')�	TypeError�copy�callable�update_from_scope�update_from_kwargs)�base�scope_change�scope_kwargs�final_scopes    r)�
_update_scoper69s����;��;��9�:�:�:����i��o�o���L�!�!�	8��L��%�%�%�%��)�)�,�7�7�7�7�	���i��o�o��&��&�6�6��6�6�6�6����r*c�F�tjj}|sdS|jdS)NF�send_default_pii)�Hub�current�client�options)r;s r)�_should_send_default_piir=Ks'��
�[�
�F����u��>�,�-�-r*c� �eZdZd�Zd�Zd�ZdS)�
_InitGuardc��||_dSr&)�_client)�selfr;s  r)�__init__z_InitGuard.__init__Ts
������r*c��|Sr&r'�rBs r)�	__enter__z_InitGuard.__enter__Xs���r*c�D�|j}|�|���dSdSr&)rA�close)rB�exc_type�	exc_value�tb�cs     r)�__exit__z_InitGuard.__exit__\s&���L���=�
�G�G�I�I�I�I�I��=r*N��__name__�
__module__�__qualname__rCrFrMr'r*r)r?r?SsA����������������r*r?c�z�t|i|��}tj�|��t	|��}|S)zsInitializes the SDK and optionally integrations.

    This takes the same arguments as the client constructor.
    )rr9r:�bind_clientr?)�args�kwargsr;�rvs    r)�_initrWcs>���T�
$�V�
$�
$�F��K���F�#�#�#�	�F�	�	�B�
�Ir*c��eZdZdS)�initN)rOrPrQr'r*r)rYrYxs�������r*rYc��tSr&)rWr'r*r)�<lambda>r[�s��E�r*c�:�eZdZed���Zed���ZdS)�HubMetac��t�d��}|�.tt��}t�|��|S)z(Returns the current instance of the hub.N)�_local�getr9�
GLOBAL_HUB�set)�clsrVs  r)r:zHubMeta.current�s9���Z�Z��
�
��
�:��Z���B��J�J�r�N�N�N��	r*c��tS)z%Returns the main instance of the hub.)ra)rcs r)�mainzHubMeta.main�s
���r*N)rOrPrQ�propertyr:rer'r*r)r]r]�sH������
����X������X���r*r]c� �eZdZd�Zd�Zd�ZdS)�
_ScopeManagerc�j�||_t|j��|_|jd|_dS�N���)�_hub�len�_stack�
_original_len�_layer)rB�hubs  r)rCz_ScopeManager.__init__�s*����	� ���_�_����j��n����r*c�(�|jd}|�J�|S)N�)rp)rB�scopes  r)rFz_ScopeManager.__enter__�s����A���� � � ��r*c�L�t|jj��}||jkrt	jd|j|z
��dS||jkr5t	jd||jz
|jj|jd���|jj|jdz
}|jj|jdz
d�=|d|jdkr)t	jd|d|jd��dS|d|jdkrd}t	j|��dSdS)Nz1Scope popped too soon. Popped %s scopes too many.zLeaked %s scopes: %srsz2Wrong scope found. Meant to pop %s, but popped %s.rz�init() called inside of pushed scope. This might be entirely legitimate but usually occurs when initializing the SDK inside a request handler or task/job function. Try to initialize the SDK as early as possible instead.)rmrlrnror�error�warningrp)rBrIrJrK�current_len�layerrws       r)rMz_ScopeManager.__exit__�sL���$�)�*�+�+����+�+�+��L�C��"�[�0�
�
�
�
�F�
�4�-�
-�
-��N�&��d�0�0��	� ��!3�!5�!5�6�
�
�
��	� ��!3�a�!7�8���I��T�/�!�3�5�5�6���8�t�{�1�~�%�%��L�D��a����A��
�
�
�
�
�
�1�X���Q��
'�
'�4�
�
�N�7�#�#�#�#�#�(�
'r*NrNr'r*r)rhrh�sA������%�%�%���� $� $� $� $� $r*rhc�l�eZdZdZdZerdZdZ		d d�Zd�Z	d�Z
d�Zd�Ze
d���Ze
d	���Zd
�Zd�Z		d d�Z		d d
�Z		d d�Zd�Z		d d�Z	d!d�Z	d!d�Ze	d!d���Zed���Z	d!d�Zd�Ze	d!d���Zed���Z	d!d�Zd�Zd�Zd�Zd�Z 		d d�Z!d�Z"dS)"r9z�The hub wraps the concurrency management of the SDK.  Each thread has
    its own hub but the hub might transfer with the flow of execution if
    context vars are available.

    If the hub is used with a with statement it's temporarily activated.
    Nc���t|t��r)|}|jd\}}|�tj|��}n|}|�t	��}||fg|_d|_g|_dSrj)�
isinstancer9rnr.r�_last_event_id�	_old_hubs)rB�
client_or_hubrtrqr;�other_scopes      r)rCzHub.__init__�st���m�S�)�)�	#��C�"%�*�R�.��F�K��}��	�+�.�.���"�F��=��G�G�E����'���"�������r*c��|j�tj��t�|��|Sr&)r~�appendr9r:r_rbrEs r)rFz
Hub.__enter__�s1������c�k�*�*�*��
�
�4�����r*c�l�|j���}t�|��dSr&)r~�popr_rb)rBrIrJrK�olds     r)rMzHub.__exit__�s*���n� � �"�"���
�
�3�����r*c�N�|5|��cddd��S#1swxYwYdS)z~Runs a callback in the context of the hub.  Alternatively the
        with statement can be used on the hub directly.
        Nr'�rB�callbacks  r)�runzHub.run�sw���	�	��8�:�:�	�	�	�	�	�	�	�	�	�	�	�	����	�	�	�	�	�	s�
��c���t|t��r|}n|j�|j}ntd���|j}|�|j�|��}|�|SdSdS)aReturns the integration for this hub by name or class.  If there
        is no client bound or the client does not have that integration
        then `None` is returned.

        If the return value is not `None` the hub is guaranteed to have a
        client attached.
        NzIntegration has no name)r|�str�
identifier�
ValueErrorr;�integrationsr`)rB�
name_or_class�integration_namer;rVs     r)�get_integrationzHub.get_integrations~���m�S�)�)�	8�,���
�
%�
1�,�7����6�7�7�7�������$�(�(�)9�:�:�B��~��	����~r*c�(�|jddS)z&Returns the current client on the hub.rkr�rnrEs r)r;z
Hub.client����{�2��q�!�!r*c�(�|jddS)z%Returns the current scope on the hub.rkrsr�rEs r)rtz	Hub.scope"r�r*c��|jS)zReturns the last event ID.)r}rEs r)�
last_event_idzHub.last_event_id(s
���"�"r*c�D�|jd}||df|jd<dS)zBinds a new client to the hub.rkrsNr�)rB�new�tops   r)rSzHub.bind_client-s&��
�k�"�o����A��-���B���r*c��|jd\}}t|||��}|�"|�|||��}|�||_|SdS)zGCaptures an event. Alias of :py:meth:`sentry_sdk.Client.capture_event`.rkN)rnr6�
capture_eventr})rB�event�hintrt�
scope_argsr;�	top_scoperVs        r)r�zHub.capture_event5sY��!�K��O���	��i��
�;�;�����%�%�e�T�5�9�9�B��~�&(��#��I��tr*c�B�|j�dS|�d}|j||d�fd|i|��S)z�Captures a message.  The message is just a string.  If no level
        is provided the default level is `info`.

        :returns: An `event_id` if the SDK decided to send the event (see :py:meth:`sentry_sdk.Client.capture_event`).
        N�info)�message�levelrt)r;r�)rBr�r�rtr�s     r)�capture_messagezHub.capture_messageGsR���;���4��=��E�!�t�!��%�0�0�
�
�8=�
�AK�
�
�	
r*c�(�|j}|�dS|�t|��}ntj��}t	||j���\}}	|j|f||d�|��S#t$r)|�tj����YnwxYwdS)z�Captures an exception.

        :param error: An exception to catch. If `None`, `sys.exc_info()` will be used.

        :returns: An `event_id` if the SDK decided to send the event (see :py:meth:`sentry_sdk.Client.capture_event`).
        N)�client_options)r�rt)	r;r�sys�exc_infor
r<r��	Exception�_capture_internal_exception)rBrvrtr�r;r�r�r�s        r)�capture_exceptionzHub.capture_exception\s�������>��4���*�5�1�1�H�H��|�~�~�H�*�8�F�N�S�S�S���t�	=�%�4�%�e�R�$�e�R�R�z�R�R�R���	=�	=�	=��,�,�S�\�^�^�<�<�<�<�<�	=�����ts�A�0B�Bc�2�tjd|���dS)z�
        Capture an exception that is likely caused by a bug in the SDK
        itself.

        These exceptions do not end up in Sentry and are just logged instead.
        zInternal error in sentry_sdk)r�N)rrv)rBr�s  r)r�zHub._capture_internal_exceptionys ��	��3�h�G�G�G�G�G�Gr*c��|jd\}}|�tjd��dSt|pd��}|�|��|sdSt|pd��}|�d���t
j��|d<|�d���d|d<|jd�|jd||��}n|}|�|j	�
|��ntjd	|��|jd
}t|j	��|kr3|j	���t|j	��|k�1dSdS)a
        Adds a breadcrumb.

        :param crumb: Dictionary with the data as the sentry v7/v8 protocol expects.

        :param hint: An optional value that can be used by `before_breadcrumb`
            to customize the breadcrumbs that are emitted.
        rkNz*Dropped breadcrumb because no client boundr'�	timestamp�type�default�before_breadcrumbz)before breadcrumb dropped breadcrumb (%s)�max_breadcrumbs)
rnrr��dict�updater`r�utcnowr<�_breadcrumbsr�rm�popleft)rB�crumbr�rUr;rt�	new_crumbr�s        r)�add_breadcrumbzHub.add_breadcrumb�sk����B��
����>��K�D�E�E�E��F��U�[�b�!�!��
���V�����	��F��D�J�B�����9�9�[�!�!�)�!)��!2�!2�E�+���9�9�V���$�%�E�&�M��>�-�.�:�;���':�;�E�4�H�H�I�I��I�� ���%�%�i�0�0�0�0��K�C�U�K�K�K� �.�):�;���%�$�%�%��7�7���&�&�(�(�(��%�$�%�%��7�7�7�7�7�7r*c��t|t��sd|vr|d}t|t��r)tj|��|�|��Sd|vr8tj|��|�d��}|jdd|i|��S|�|S|�d|��|jj}|�
|j	di|��Stdi|��S)a"
        Create and start timing a new span whose parent is the currently active
        span or transaction, if any. The return value is a span instance,
        typically used as a context manager to start and stop timing in a `with`
        block.

        Only spans contained in a transaction are sent to Sentry. Most
        integrations start a transaction at the appropriate time, for example
        for every incoming HTTP request. Use `start_transaction` to start a new
        transaction when one is not already in progress.
        �transactionzcDeprecated: use start_transaction to start transactions and Transaction.start_child to start spans.�nameNrqr')r|r
rrw�start_transactionr��
setdefaultrt�span�start_childr	)rBr�rU�deprecation_msgr�s     r)�
start_spanzHub.start_span�s��(�d�K�(�(�	C�M�V�,C�,C�:�
��$��,�,�
4����/�/�/��-�-�d�3�3�3���&�&����/�/�/��z�z�-�0�0��-�t�-�B�B�4�B�6�B�B�B����K����%��&�&�&��z�����#�4�#�-�-�f�-�-�-��~�~�f�~�~�r*c��|�di��}|�"|�d|��td
i|��}|���|jd�}|�|��|�|���|jrD|jo$|jj	d�
d��pd}|�|�	��|S)a�
        Start and return a transaction.

        Start an existing transaction if given, otherwise create and start a new
        transaction with kwargs.

        This is the entry point to manual tracing instrumentation.

        A tree structure can be built by adding child spans to the transaction,
        and child spans to other spans. To start a new child span within the
        transaction or any span, call the respective `.start_child()` method.

        Every child span must be finished before the transaction is finished,
        otherwise the unfinished spans are discarded.

        When used as context managers, spans and transactions are automatically
        finished at the end of the `with` block. If not using context managers,
        call the `.finish()` method.

        When the transaction is finished, it will be sent to Sentry with all its
        finished child spans.
        �custom_sampling_contextNrq)�transaction_context�parent_sampled)�sampling_context�_experiments�	max_spansi�)�maxlenr')r�r�r
�to_jsonr�r��_set_initial_sampling_decision�sampledr;r<r`�init_span_recorder)rBr�rUr�r�r�s      r)r�zHub.start_transaction�s���8#)�*�*�-F��"K�"K�������e�T�*�*�*�%�/�/��/�/�K�
$/�#6�#6�#8�#8�)�8�
�
��	��� 7�8�8�8��2�2�DT�2�U�U�U���	=���T��� 3�N� C� G� G�� T� T���
�
�*�*�)�*�<�<�<��r*c��dSr&r'r�s  r)�
push_scopezHub.push_scope�	��
	
�r*c��dSr&r'r�s  r)r�zHub.push_scoper�r*c��|�9|���5}||��ddd��n#1swxYwYdS|jd\}}|tj|��f}|j�|��t	|��S)a.
        Pushes a new layer on the scope stack.

        :param callback: If provided, this method pushes a scope, calls
            `callback`, and pops the scope again.

        :returns: If no `callback` is provided, a context manager that should
            be used to pop the scope again.
        Nrk)r�rnr.r�rh)rBr�rtr;�	new_layers     r)r�zHub.push_scope#s��������"�"�
 �e�������
 �
 �
 �
 �
 �
 �
 �
 �
 �
 �
 ����
 �
 �
 �
 ��4���B��
����T�Y�u�-�-�.�	�����9�%�%�%��T�"�"�"s�/�3�3c�Z�|j���}|js
Jd���|S)z{
        Pops a scope layer from the stack.

        Try to use the context manager :py:meth:`push_scope` instead.
        z"stack must have at least one layer)rnr�)rBrVs  r)�pop_scope_unsafezHub.pop_scope_unsafe;s0���[�_�_�
�
���{�@�@�@�@�@�{��	r*c��dSr&r'r�s  r)�configure_scopezHub.configure_scopeFr�r*c��dSr&r'r�s  r)r�zHub.configure_scopeMr�r*c����|jd\��|���|���dSt��fd���}|��S)z�
        Reconfigures the scope.

        :param callback: If provided, call the callback with the current scope.

        :returns: If no callback is provided, returns a context manager that returns the scope.
        rkNc3�<�K����V�dSt��V�dSr&r)r;rts��r)�innerz"Hub.configure_scope.<locals>.innerhs-������!��������g�g�
�
�
�
�
r*)rnr)rBr�r�r;rts   @@r)r�zHub.configure_scopeTsh������B��
������!��������4�	�	�	�	�	�	�
��	��u�w�w�r*c���|���|jd\}}t|r
|jdnd|r
|jdnd|j���|_dS)zStarts a new session.rk�releaseN�environment)r�r��user)�end_sessionrnrr<�_user�_session�rBr;rts   r)�
start_sessionzHub.start_sessionrsl��	
��������B��
��� �17�A�F�N�9�-�-�T�9?�I���}�5�5�T���
�
�
����r*c��|jd\}}|j}|�+|���|�|�|��d|j_dS)z)Ends the current session if there is one.rkN)rnr�rH�capture_sessionrt)rBr;rt�sessions    r)r�zHub.end_session}sW����B��
����.�����M�M�O�O�O��!��&�&�w�/�/�/�"��
���r*c�\�|���|jd\}}d|_dS)z�Stops automatic session tracking.

        This temporarily session tracking for the current scope when called.
        To resume session tracking call `resume_auto_session_tracking`.
        rkFN)r�rn�_force_auto_session_trackingr�s   r)�stop_auto_session_trackingzHub.stop_auto_session_tracking�s3��	
��������B��
���-2��*�*�*r*c�4�|jd\}}d|_dS)z�Resumes automatic session tracking for the current scope if
        disabled earlier.  This requires that generally automatic session
        tracking is enabled.
        rkN)rnr�r�s   r)�resume_auto_session_trackingz Hub.resume_auto_session_tracking�s!����B��
���-1��*�*�*r*c�X�|jd\}}|�|�||���SdS)z>
        Alias for :py:meth:`sentry_sdk.Client.flush`
        rkN)�timeoutr�)rn�flush)rBr�r�r;rts     r)r�z	Hub.flush�s7����B��
������<�<��(�<�C�C�C��r*c#�K�|jd\}}|j}|�dS|o|jd}|sdSd|���fV�dS)Nrk�propagate_traceszsentry-trace)rnr�r<�to_traceparent)rBr;rtr�r�s     r)�iter_trace_propagation_headersz"Hub.iter_trace_propagation_headers�sk������B��
����z���<��F�!�H�f�n�5G�&H���	��F��d�1�1�3�3�3�3�3�3�3�3r*)NNr&)#rOrPrQ�__doc__rnrr:rerCrFrMr�r�rfr;rtr�rSr�r�r�r�r�r�r�rr�r�r�r�r�r�r�r�r�r'r*r)r9r9�s����������F�������������(������������0�"�"��X�"�
�"�"��X�"�
#�#�#�
(�(�(���	����*��	
�
�
�
�.������:
H�
H�
H��
�,)�,)�,)�,)�`�*�*�*�*�\�4�4�4�4�l��
�
�
��X�
��
�
��X�
��#�#�#�#�0	�	�	���
�
�
��X�
��
�
��X�
������<	
�	
�	
�	#�	#�	#�	3�	3�	3�2�2�2���D�D�D�D�
4�
4�
4�
4�
4r*r9);r.r�r�
contextlibr�sentry_sdk._compatr�sentry_sdk.scoper�sentry_sdk.clientr�sentry_sdk.tracingr	r
�sentry_sdk.sessionsr�sentry_sdk.utilsrr
rr�sentry_sdk._typesr�typingrrrrrrrrrrrr�sentry_sdk.integrationsrrrr r!r"�sentry_sdk.constsr#r$r_r6r=�objectr?rWrYr�r]rhr9rarbr'r*r)�<module>rs�������
�
�
�
�������%�%�%�%�%�%�-�-�-�-�-�-�"�"�"�"�"�"�$�$�$�$�$�$�0�0�0�0�0�0�0�0�'�'�'�'�'�'�������������#�"�"�"�"�"��������������������������������������������� � � � � � �������������������%�%�%�%�%�%�3�3�3�3�3�3���������������4�3�3�3�3�3������A�A����

��(�	)�	)�����$.�.�.�
�
�
�
�
��
�
�
� 	�	�	�#�"�"�"�"�"���
�
�
�
�
� �.��"5�
�
�
�
�
�M�M���D������d����$-$�-$�-$�-$�-$�F�-$�-$�-$�`p4�p4�p4�p4�p4�.�.��
!�
!�p4�p4�p4�f�S�U�U�
��
�
�:�����r*

Filemanager

Name Type Size Permission Actions
__init__.cpython-311.pyc File 992 B 0644
_compat.cpython-311.pyc File 3.78 KB 0644
_functools.cpython-311.pyc File 2.44 KB 0644
_queue.cpython-311.pyc File 11.64 KB 0644
_types.cpython-311.pyc File 1.79 KB 0644
api.cpython-311.pyc File 6.54 KB 0644
attachments.cpython-311.pyc File 2.29 KB 0644
client.cpython-311.pyc File 16.67 KB 0644
consts.cpython-311.pyc File 3.09 KB 0644
debug.cpython-311.pyc File 2.44 KB 0644
envelope.cpython-311.pyc File 12.58 KB 0644
hub.cpython-311.pyc File 25.07 KB 0644
scope.cpython-311.pyc File 16.48 KB 0644
serializer.cpython-311.pyc File 16.5 KB 0644
sessions.cpython-311.pyc File 8.71 KB 0644
tracing.cpython-311.pyc File 27.45 KB 0644
transport.cpython-311.pyc File 16.72 KB 0644
utils.cpython-311.pyc File 32.93 KB 0644
worker.cpython-311.pyc File 7.23 KB 0644