HI.ddlZddlZddlmZddlmZmZddlmZddl m Z m Z m Z m Z ddlmZmZddlmZmZddlmZdd lmZer6dd lmZdd lmZdd lmZdd lmZddlmZddlmZddlm Z m!Z!ddlm"Z"m#Z#m$Z$ ddl%m&Z&m'Z(ddl)m*Z*ddl+m,Z,ddl-m.Z.n#e/$r edwxYwGddeZ0dZ1dZ2GddeZ3dS)N) isawaitable)urlparsereraise)Hub)capture_internal_exceptionsevent_from_exceptionHAS_REAL_CONTEXTVARSCONTEXTVARS_ERROR_MESSAGE) Integration DidNotEnable)RequestExtractor_filter_headers) ignore_logger)MYPY)Any)Callable)Optional)Union)Tuple)Dict)RequestRequestParameters)EventEventProcessorHint)Sanic __version__)SanicException)Router) ErrorHandlerzSanic not installedc(eZdZdZedZdS)SanicIntegrationsaniccJ ttttjd}n<#t t f$r(tdtwxYw|dkrtdtstdtztj drtdtjfd}|t_tjfd }|t_t"jfd }|t"_dS) N.zUnparsable Sanic version: {})rzSanic 0.8 or newer required.zUThe sanic integration for Sentry requires Python 3.7+ or the aiocontextvars package.z0.8.rootcKtj}|t ||g|Ri|St j|}t|5}|5}||t|dddn #1swxYwY||g|Ri|}t|r|d{V}|cdddS#1swxYwYdSN) rcurrentget_integrationr"weakrefrefconfigure_scopeclear_breadcrumbsadd_event_processor_make_request_processorr) selfrequestargskwargshub weak_requestscoperesponseold_handle_requests }/builddir/build/BUILD/imunify360-venv-2.6.2/opt/imunify360/venv/lib/python3.11/site-packages/sentry_sdk/integrations/sanic.pysentry_handle_requestz:SanicIntegration.setup_once..sentry_handle_requestLs+C""#344<))$I$III&III";w//LS S((**Ue++-----.El.S.STTTUUUUUUUUUUUUUUU.-dGMdMMMfMMx((.%-~~~~~~H s6C//7B2& C/2B6 6C/9B6 :(C//C36C3c4||}tj}|tdt 5|5}|dj|_dddn #1swxYwYdddn #1swxYwY|SNr)rr*r+r"rr.__name__ transaction)r2r3rvr6r8old_router_gets r;sentry_router_getz6SanicIntegration.setup_once..sentry_router_getcs g..B+C""#344@022;;,,..;%,.qEN);;;;;;;;;;;;;;;;;;;;;;;;;;;;;;Is6B A6* B 6A: :B =A: >B  BBct|||dStjtSfd}|S)NcK ||}t|r|d{V}|S#t$r/tj}t |t |YdSwxYwr))r Exceptionsysexc_info_capture_exceptionr)r3 exceptionr9rHold_error_handlers r;sentry_wrapped_error_handlerzfSanicIntegration.setup_once..sentry_error_handler_lookup..sentry_wrapped_error_handler|s '00)DDH"8,,2)1>>>>>>#O ''' #|~~H&x000X&&&&& 's$*5A#"A#)rIrr*r+r")r2rJrLrKold_error_handler_lookups @r;sentry_error_handler_lookupz@SanicIntegration.setup_once..sentry_error_handler_lookupqsn y ) ) ) 8 8y I I  (t{**+;<<D(( ' ' ' ' '0 /)tuplemapint SANIC_VERSIONsplit TypeError ValueErrorr formatr r startswithrrhandle_requestrgetr lookup)versionr<rCrNrMr:rBs @@@r; setup_oncezSanicIntegration.setup_once+sb UC]%8%=%=>>??GG:& U U U=DD]SSTT T U V  =>> ># 24MN   #F + + " & ! ! !"1     & 5     ' #/#6  0 0 0 0 08: s 4:9A3N)r? __module__ __qualname__ identifier staticmethodr]rOr;r"r"(s7Ja:a:\a:a:a:rOr"ctj}|t}|dS|j}t 5t ||jddd\}}|||ddddS#1swxYwYdS)Nr#F)typehandled)client_options mechanism)hint) rr*r+r"clientrroptions capture_event)rJr6 integrationrieventrhs r;rIrIs +C%%&677KZF $ & &,,* !>&599   t %d+++ ,,,,,,,,,,,,,,,,,,s5BB Bcfd}|S)Nc& |r#t|ddtrdSn#t$rYnwxYw}||St5t |}|||d}t j|j}|j d|j |j |d<|j |d<|j |d<d|ji|d <tt!|j|d <dddn #1swxYwY|S) NrHrr3z://url query_stringmethod REMOTE_ADDRenvheaders) issubclassrKeyErrorrSanicRequestExtractorextract_into_eventrurlsplitrpschemenetlocpathqueryrr remote_addrrdictru)rmrhr3 extractor request_infourlpartsr7s r;sanic_processorz0_make_request_processor..sanic_processors   4 #3A#6GG t    D ,.. ?L ( * * M M-g66I  ( ( / / / +L(55H #L  ,4>L (%,^L "#0'2E"FL &5d7?6K6K&L&LL #! M M M M M M M M M M M M M M M$ s#) 66B%DD  D rb)r7rs` r;r1r1s%B rOc>eZdZdZdZdZdZdZdZdZ dZ d S) rxcP|jjdSt|jjSr>)r3bodylenr2s r;content_lengthz$SanicRequestExtractor.content_lengths% <  $14<$%%%rOc4t|jjSr))rr3cookiesrs r;rzSanicRequestExtractor.cookiessDL()))rOc|jjSr))r3rrs r;raw_datazSanicRequestExtractor.raw_data |  rOc|jjSr))r3formrs r;rzSanicRequestExtractor.formrrOctr))NotImplementedErrorrs r;is_jsonzSanicRequestExtractor.is_jsons!###rOc|jjSr))r3jsonrs r;rzSanicRequestExtractor.jsonrrOc|jjSr))r3filesrs r;rzSanicRequestExtractor.filess |!!rOc.t|jpdS)Nrb)rr)r2files r; size_of_filez"SanicRequestExtractor.size_of_files49?###rON) r?r^r_rrrrrrrrrbrOr;rxrxs&&& ***!!!!!!$$$!!!"""$$$$$rOrx)4rGr,inspectrsentry_sdk._compatrrsentry_sdk.hubrsentry_sdk.utilsrrr r sentry_sdk.integrationsr r $sentry_sdk.integrations._wsgi_commonr rsentry_sdk.integrations.loggingrsentry_sdk._typesrtypingrrrrrr sanic.requestrrrrrr#rrrSsanic.exceptionsr sanic.routerrsanic.handlersr ImportErrorr"rIr1rxrbrOr;rs 00000000 >=======RRRRRRRR999999"""""" >88888888==========.99999999//////######+++++++... ,, - --.e:e:e:e:e:{e:e:e:P,,,&###L!$!$!$!$!$,!$!$!$!$!$s >BB*