0iddlZddlmZddlmZddlZddlmZddlm Z ddl m Z m Z ddl mZddlmZerdd lmZmZmZdd lmZ dd lmZmZ ddlZdZGddeZdZdZy#e$r ed wxYw#e$r ed wxYw)N)deepcopy)wraps) DidNotEnable)should_send_default_pii)SOURCE_FOR_STYLETransactionSource)transaction_from_function) TYPE_CHECKING)AnyCallableDict)Event)StarletteIntegrationStarletteRequestExtractorzStarlette is not installedzFastAPI is not installedzgeneric FastAPI requestc eZdZdZedZy)FastApiIntegrationfastapictyN)patch_get_request_handlerN/opt/hc_python/lib/python3.12/site-packages/sentry_sdk/integrations/fastapi.py setup_oncezFastApiIntegration.setup_once%s  "#rN)__name__ __module__ __qualname__ identifier staticmethodrrrrrr"sJ$$rrc<d}|dk(r-|jjd}|rCt|xsd}n3|dk(r.|jjd}|rt|dd}||}|st}t j }n t|}|j||y)Nendpointurlroutepath)source) scopegetr getattr_DEFAULT_TRANSACTION_NAMErROUTErset_transaction_name)r'transaction_stylerequestnamer"r$r%r&s r _set_transaction_name_and_sourcer0+s DJ&==$$Z0 ,X6<"D e # !!'* 5&$/D ("((!"34 tF3rcntjjfd}|tj_y)Nc|jd}|rQ|jEtj|js&|jt fd}||_|i|fd}|S)N dependantctj}|j|jjtj}|j |j j |i|Sr) sentry_sdkget_current_scope transactionupdate_active_threadget_isolation_scopeprofileupdate_active_thread_id)argskwargs current_scope sentry_scopeold_calls r _sentry_callzTpatch_get_request_handler.._sentry_get_request_handler.._sentry_callRsm!+ < < >  ,,8!--BBD)==? ''3 ((@@B000rcKtjjt}||i|d{S|d}t tj |j |tj}t|}|jd{fd}tj|_ |j||||i|d{S77H7w)Nrcfd}|S)Nc|jdi}r"dvrtrd|d<dvrd|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_processorts]$)99Y#;L$,1H1J6:9oL3!T>37._sentry_get_request_handler.._sentry_app.._make_request_event_processorrs !'&r) r5 get_clientget_integrationrr0r6r-r9rextract_request_infor_nameadd_event_processor) r<r=rMr.r? extractorrNrJold_apps @r _sentry_appzSpatch_get_request_handler.._sentry_get_request_handler.._sentry_appcs$//1AABTUK"$d5f5551gG ,,,. 0M0Mw &99;L1':I"7799D '$"4!>!>L   , ,-g{C !$1&11 1E6:22s55C+C%A$C+C'AC+ C)!C+'C+)C+)r(callasyncioiscoroutinefunctionr)r<r=r3rArVrUr@old_get_request_handlers @@r_sentry_get_request_handlerz>patch_get_request_handler.._sentry_get_request_handlerHsuJJ{+ *// ? ~~H 8_ 1 1*IN)4:6:& 2Pr)rroutingget_request_handler)r[rZs @rrrDs)%ooAACJ+FGOO'r)rXcopyr functoolsrr5sentry_sdk.integrationsrsentry_sdk.scopersentry_sdk.tracingrrsentry_sdk.utilsr typingr r r r sentry_sdk._typesr!sentry_sdk.integrations.starletterrr ImportErrorr*rr0rrrrrhs04B6 **'53 6$-$42IF]5 3 445 3 1 223sA)A:)A7:B