OwlCyberSecurity - MANAGER
Edit File: sanic.cpython-311.pyc
� ������h������������������������������d�Z�ddlmZ�ddlZddlZddlmZ�ddlmZ�ddl m Z �ddlmZ�ddl mZ�dd lmZ��ej����������������������Ze���������������������d ������������Zdd�Z�G�d��d e������������ZdS�)z� raven.contrib.sanic ~~~~~~~~~~~~~~~~~~~ :copyright: (c) 2010-2018 by the Sentry Team, see AUTHORS for more details. :license: BSD, see LICENSE for more details. �����)�absolute_importN)� setup_logging)�Client)� SentryHandler)�urlparse)� to_unicode)�convert_options�logging_configuredc������������������������|�di�t����������|j��������|t����������|j�����������������������������dg�������������������������t����������|j��������g������������z��d|id����������������S�)N�SENTRY_INCLUDE_PATHS�app)�dsn� include_paths�extra)�defaults��)r ����config�set�get�name)� client_clsr ���r���s��� �d/builddir/build/BUILD/cloudlinux-venv-1.0.8/venv/lib/python3.11/site-packages/raven/contrib/sanic.py�make_clientr������s~�������:����� ��J���� ���'=�r�B�B�C�C��3�8�*�o�o�&���3�� �� � �� �� ����������c�������������������������e�Zd�ZdZdedddej��������fd�Zd��Zd��Z d��Z d��Zd ��Zd ��Z � �dd�Zd��Zd ��Zd��Zd��Zd��Zd��Zd��Zd��ZdS�)�Sentryaj�� Sanic application for Sentry. Look up configuration from ``os.environ['SENTRY_DSN']``:: >>> sentry = Sentry(app) Pass an arbitrary DSN:: >>> sentry = Sentry(app, dsn='http://public:secret@example.com/1') Pass an explicit client:: >>> sentry = Sentry(app, client=client) Automatically configure logging:: >>> sentry = Sentry(app, logging=True, level=logging.ERROR) Capture an exception:: >>> try: >>> 1 / 0 >>> except ZeroDivisionError: >>> sentry.captureException() Capture a message:: >>> sentry.captureMessage('hello, world!') NFc������������������������|r$t����������|t����������������������st����������d�������������||�_��������||�_��������||�_��������||�_��������||�_��������||�_��������|�� ��������������������|�������������d�S�)Nz&client should be an instance of Client) � isinstancer���� TypeError�clientr���r����logging�logging_exclusions�level�init_app)�selfr ���r ���r���r���r!���r"���r#���s��� r����__init__zSentry.__init__M���so�������� F�*�V�V�4�4�� F��D�E�E�E����$���������"4����� �� � �c�����r���c������������������V����|�j���������sd�S� �|�j������������������������������|����������������������|�������������������������nC#�t����������$�r6}|�j���������j�����������������������������t ����������|�������������������������Y�d�}~nd�}~ww�xY�wt����������|������������||j��������f}|�� ��������������������|��������������d�S�)N)�exc_info) r ����http_context� get_http_info� Exception�logger� exceptionr����type� __traceback__�captureException)r%����requestr-����e�exception_infos��� r����handle_exceptionzSentry.handle_exceptionZ���s��������{�� ��F� 8��K�$�$�T�%7�%7��%@�%@�A�A�A�A���� 8�� 8�� 8��K��(�(��A���7�7�7�7�7�7�7�7����� 8���� ��y�/�/�9�i�6M�N�����~��6�6�6�6�6s����-9�� A9�,A4�4A9c�����������������������|j���������S��N)�form�r%���r1���s��� r���� get_form_datazSentry.get_form_datag���� �������|�r���c������������������v�����|�����������������������|������������r|�j��������}n|�j��������}|����������������������||������������S�)zR Determine how to retrieve actual data by using request.mimetype. )�is_json_type� get_json_datar9����get_http_info_with_retriever)r%���r1���� retrievers��� r���r*���zSentry.get_http_infoj���sB����������W�%�%�� +��*�I�I��*�I��0�0��)�D�D�Dr���c�����������������������|j���������S�r6���)�jsonr8���s��� r���r=���zSentry.get_json_datat���r:���r���c����������������������t����������j��������|j��������������������} ��||������������}n#�t����������$�r�i�}Y�nw�xY�wd���������������������|j��������|j��������|j��������������������|j��������|j ��������||j ��������|j��������d|j��������id�S�)zT Exact method for getting http_info but with form data work around. z{0}://{1}{2}�REMOTE_ADDR)�url�query_string�method�data�cookies�headers�env) r����urlsplitrD���r+����format�scheme�netloc�path�queryrF���rH���rI����remote_addr)r%���r1���r?����urlpartsrG���s��� r���r>���z#Sentry.get_http_info_with_retrieverw���s���������$�W�[�1�1�� ��9�W�%�%�D�D���� �� �� ��D�D�D� �����"�(�(�����(�-�A��A�$�N��n�������w�2�� �� �� s����'��6�6c������������������B�����|j������������������������������d������������}|dk����S�)Nzcontent-typezapplication/json)rI���r���)r%���r1����content_types��� r���r<���zSentry.is_json_type����s#��������*�*�>�:�:���1�1�1r���c������������������^����|�||�_���������|�||�_��������|�||�_��������|�d|�_��������n||�_��������|�j��������s t����������|�j��������||�j���������������������|�_��������|�j��������rTi�}|�j��������� |�j��������|d<���t����������|�j��������|�j���������������������}t����������|fi�|���t����������j ��������|�fdt����������i|���t����������|d������������si�|_��������|�|j��������d<���|j �����������������������������t����������|�j���������������������|���������������������|�j��������d��������������|���������������������|�j��������d ��������������d�S�) N)�rootzsanic.accesszsanic.error�exclude)r#����sentry_handler� extensions�sentryr1���)� attach_to�response)r���r#���r!���r"���r ���r���r���r���r���r ����send�hasattrrY���� error_handler�addr+���r4����register_middleware�before_request� after_request)r%���r ���r���r!���r#���r"����kwargs�handlers��� r���r$���zSentry.init_app����sf������?��D�H����D�J���"�D�L��%�'7�D�#�#��'9�D�#��{�� F�%�d�o�s�D�H�E�E�D�K��<�� >��F��&�2�$(�$;��y�!�#�D�K�t�z�B�B�B�G��'�,�,�V�,�,�,��#�� >�� >�%2� >�6<� >�� >�� >���s�L�)�)�� ��C�N�#'���x� �����i��)>�?�?�?����� 3�y��I�I�I����� 2�j��I�I�I�I�Ir���c�����������������������d�|�_��������� �|�j�����������������������������|����������������������|�������������������������d�S�#�t����������$�r7}|�j��������j�����������������������������t����������|�������������������������Y�d�}~d�S�d�}~ww�xY�wr6���)� last_event_idr ���r)���r*���r+���r,���r-���r���)r%���r1���r2���s��� r���rb���zSentry.before_request����s�������!��� 8��K�$�$�T�%7�%7��%@�%@�A�A�A�A�A���� 8�� 8�� 8��K��(�(��A���7�7�7�7�7�7�7�7�7����� 8���s����-8�� A9�,A4�4A9c������������������n�����|�j���������r|�j���������|j��������d<���|�j��������j��������������������������������������������d�S�)NzX-Sentry-ID)rg���rI���r ����context�clear)r%���r1���r\���s��� r���rc���zSentry.after_request����s;��������� A�.2�.@�H��]�+����!�!�#�#�#�#�#r���c������������������v�����|�j���������s J�d����������������|�j���������j��������|i�|��}|����������������������|�������������|S�)Nz5captureException called before application configured)r ���r0����set_last_event_id_from_result�r%����argsrd����results��� r���r0���zSentry.captureException����sJ�������{�S�S�S�S�S�{�-���-�t�>�v�>�>���*�*�6�2�2�2�� r���c������������������v�����|�j���������s J�d����������������|�j���������j��������|i�|��}|����������������������|�������������|S�)Nz3captureMessage called before application configured)r ����captureMessagerl���rm���s��� r���rq���zSentry.captureMessage����sJ�������{�Q�Q�Q�Q�Q�{�+���+�T�<�V�<�<���*�*�6�2�2�2�� r���c������������������Z�����|r!|�j������������������������������|������������|�_��������d�S�d�|�_��������d�S�r6���)r ���� get_identrg���)r%���ro���s��� r���rl���z$Sentry.set_last_event_id_from_result����s6�������� &�!%��!6�!6�v�!>�!>�D����!%�D���r���c������������������H�����|�j���������s J�d����������������|�j���������j��������|i�|��S�)Nz1user_context called before application configured)r ����user_context�r%���rn���rd���s��� r���ru���zSentry.user_context�����2�������{�O�O�O�O�O�{�'�t�{�'��8��8�8�8r���c������������������H�����|�j���������s J�d����������������|�j���������j��������|i�|��S�)Nz1tags_context called before application configured)r ����tags_contextrv���s��� r���ry���zSentry.tags_context����rw���r���c������������������H�����|�j���������s J�d����������������|�j���������j��������|i�|��S�)Nz2extra_context called before application configured)r ���� extra_contextrv���s��� r���r{���zSentry.extra_context����s2�������{�P�P�P�P�P�{�(�t�{�(�$�9�&�9�9�9r���)NNNN)�__name__� __module__�__qualname__�__doc__r���r!����NOTSETr&���r4���r9���r*���r=���r>���r<���r$���rb���rc���r0���rq���rl���ru���ry���r{���r���r���r���r���r���-���s:����������������>�$(�F���4�w�~��������7��7��7������E��E��E������ �� �� �02��2��2��;?�$(�#J��#J��#J��#J�J8��8��8�$��$��$� ����������&��&��&�9��9��9�9��9��9�:��:��:��:��:r���r���r6���)r���� __future__r���r!����blinker� raven.confr���� raven.baser����raven.handlers.loggingr����raven.utils.compatr����raven.utils.encodingr����raven.utils.confr ���� Namespace� raven_signals�signalr ���r����objectr���r���r���r����<module>r�������s��������'��&��&��&��&��&������������$��$��$��$��$��$��������������0��0��0��0��0��0��'��'��'��'��'��'��+��+��+��+��+��+��,��,��,��,��,��,��"��!�#�#� �"�)�)�*>�?�?����������$s:��s:��s:��s:��s:�V��s:��s:��s:��s:��s:r���