bgddlZddlmZddlmZddlmZmZddlm Z ddl m Z m Z ddl mZerddlmZmZmZdd lmZ dd lmZmZn#e $r e d wxYw ddlZn#e$r e d wxYwd ZGddeZdZdZdS)N)deepcopy) TYPE_CHECKING)Hub_should_send_default_pii) DidNotEnable)SOURCE_FOR_STYLETRANSACTION_SOURCE_ROUTE)transaction_from_function)AnyCallableDict)Scope)StarletteIntegrationStarletteRequestExtractorzStarlette is not installedzFastAPI is not installedzgeneric FastAPI requestc(eZdZdZedZdS)FastApiIntegrationfastapic"tdSN)patch_get_request_handlerV/opt/cloudlinux/venv/lib64/python3.11/site-packages/sentry_sdk/integrations/fastapi.py setup_oncezFastApiIntegration.setup_once"s "#####rN)__name__ __module__ __qualname__ identifier staticmethodrrrrrrs2J$$\$$$rrcJd}|dkr.|jd}|rt|pd}n7|dkr1|jd}|rt|dd}||}|st}t }n t |}|||dS)Nendpointurlroutepath)source)scopegetr getattr_DEFAULT_TRANSACTION_NAMEr rset_transaction_name)r'transaction_stylerequestnamer"r$r%r&s r _set_transaction_name_and_sourcer/(s DJ&&=$$Z00  =,X66<"D e # # !!'**  5&$//D 5()!"34 tF33333rcVtjjfd}|tj_dS)Nc|d}|r3|j,tj|js|jfd}||_|i|fd}|S)N dependantctj}|5}|j|j|i|cdddS#1swxYwYdSr)rcurrentconfigure_scopeprofileupdate_active_thread_id)argskwargshub sentry_scopeold_calls r _sentry_callzTpatch_get_request_handler.._sentry_get_request_handler.._sentry_callOsk((**5l#+7$,DDFFF#8T4V44555555555555555555s(AAAcKtj}|t}| |i|d{VS|5}|d}t ||j|t|}|d{Vfd}tj |_ | |||dddn #1swxYwY |i|d{VS)Nrcfd}|S)Nc|di}r,dvrtr d|d<dvr d|d<t||d<|S)Nr-cookiesdata)r(rr)eventhint request_infoinfos revent_processorzpatch_get_request_handler.._sentry_get_request_handler.._sentry_app.._make_request_event_processor..event_processornst(-yyB'?'? D(D005M5O5O0:>y/ Y 7%~~7;F| V 4+3L+A+Ai($ rr)req integrationrGrFs r_make_request_event_processorzzpatch_get_request_handler.._sentry_get_request_handler.._sentry_app.._make_request_event_processorls$ % % % % %+*r) rr4get_integrationrr5r/r,rextract_request_infor_nameadd_event_processor) r8r9r:rIr;r- extractorrJrFold_apps @r _sentry_appzSpatch_get_request_handler.._sentry_get_request_handler.._sentry_app[s+C--.@AAK"$Wd5f555555555$$&& ,q'0 +"?6g>> &;;========+++++$&8%B "0011';GG;               B!$1&11111111 1sA=CCC)r(callasyncioiscoroutinefunction)r8r9r2r=rQrPr<old_get_request_handlers @@r_sentry_get_request_handlerz>patch_get_request_handler.._sentry_get_request_handlerEsJJ{++  **/ ??+!~H 5 5 5 5 5*IN))4:6::( 2( 2( 2( 2( 2Tr)rroutingget_request_handler)rVrUs @rrrAs@%oA@@@@@D+FGO'''r)rScopyrsentry_sdk._typesrsentry_sdk.hubrrsentry_sdk.integrationsrsentry_sdk.tracingrr sentry_sdk.utilsr typingr r r sentry_sdk.scoper!sentry_sdk.integrations.starletterrr ImportErrorr*rr/rrrrrcs++++++88888888000000IIIIIIII666666'**********&&&&&&5555 ,3 4 4453NNNN333 ,1 2 2236$$$$$-$$$4442FFFFFFFFFFsA AA##A4