
    fi                     x    d dl mZmZmZ d dlmZmZmZmZ erd dl	m
Z
 d dlmZ g dZg dZ G d d          Zd	S )
    )capture_internal_exceptionsAnnotatedValueiter_event_frames)TYPE_CHECKINGcastListDict)Event)Optional) passwordpasswdsecretapi_keyapikeyauthcredentials	mysql_pwd
privatekeyprivate_keytokensession	csrftoken	sessionidx_csrftokenx_forwarded_for
set_cookiecookieauthorization	x_api_keyaiohttp_sessionzconnect.sid
csrf_tokencsrf_csrf_csrf_token	PHPSESSID_sessionsymfonyuser_session_xsrfz
XSRF-TOKEN)r   	x_real_ip
ip_addressremote_addrc                   N    e Zd Z	 ddZd Zd Zd Zd Zd Zd	 Z	d
 Z
d Zd ZdS )EventScrubberNFc                     |t                                           n|| _        |s-|t                                          n|}| xj        |z  c_        d | j        D             | _        || _        dS )a
  
        A scrubber that goes through the event payload and removes sensitive data configured through denylists.

        :param denylist: A security denylist that is always scrubbed, defaults to DEFAULT_DENYLIST.
        :param recursive: Whether to scrub the event payload recursively, default False.
        :param send_default_pii: Whether pii is sending is on, pii fields are not scrubbed.
        :param pii_denylist: The denylist to use for scrubbing when pii is not sent, defaults to DEFAULT_PII_DENYLIST.
        Nc                 6    g | ]}|                                 S  )lower).0xs     c/var/www/html/Pagina-Ingenieria-Requisitos/venv/lib/python3.11/site-packages/sentry_sdk/scrubber.py
<listcomp>z*EventScrubber.__init__.<locals>.<listcomp>R   s     :::q:::    )DEFAULT_DENYLISTcopydenylistDEFAULT_PII_DENYLIST	recursive)selfr:   r<   send_default_piipii_denylists        r5   __init__zEventScrubber.__init__>   s}     4<3C(--/// 	*/;/C$))+++  MM\)MM::DM:::"r7   c                     t          |t                    sdS |D ],}|                     |           |                     |           -dS )a*  
        If a list is passed to this method, the method recursively searches the list and any
        nested lists for any dictionaries. The method calls scrub_dict on all dictionaries
        it finds.
        If the parameter passed to this method is not a list, the method does nothing.
        N)
isinstancelist
scrub_dict
scrub_list)r=   lstvs      r5   rE   zEventScrubber.scrub_listU   s[     #t$$ 	F 	 	AOOAOOA	 	r7   c                 X   t          |t                    sdS |                                D ]}\  }}t          |t                    r2|                                | j        v rt          j                    ||<   L| j        r*| 	                    |           | 
                    |           ~dS )a[  
        If a dictionary is passed to this method, the method scrubs the dictionary of any
        sensitive data. The method calls itself recursively on any nested dictionaries (
        including dictionaries nested in lists) if self.recursive is True.
        This method does nothing if the parameter passed to it is not a dictionary.
        N)rB   dictitemsstrr2   r:   r   +substituted_because_contains_sensitive_datar<   rD   rE   )r=   dkrG   s       r5   rD   zEventScrubber.scrub_dictd   s     !T"" 	FGGII 	# 	#DAq !S!! #aggii4=&@&@%QSS! #""""""	# 	#r7   c                 ^   t                      5  d|v rd|d         v r!|                     |d         d                    d|d         v r!|                     |d         d                    d|d         v r!|                     |d         d                    d d d            d S # 1 swxY w Y   d S )Nrequestheaderscookiesdatar   rD   r=   events     r5   scrub_requestzEventScrubber.scrub_requestx   s   (** 	> 	>E!!i 000OOE)$4Y$?@@@i 000OOE)$4Y$?@@@U9---OOE)$4V$<===	> 	> 	> 	> 	> 	> 	> 	> 	> 	> 	> 	> 	> 	> 	> 	> 	> 	>s   BB""B&)B&c                     t                      5  d|v r|                     |d                    d d d            d S # 1 swxY w Y   d S )NextrarT   rU   s     r5   scrub_extrazEventScrubber.scrub_extra   s    (** 	0 	0%g///	0 	0 	0 	0 	0 	0 	0 	0 	0 	0 	0 	0 	0 	0 	0 	0 	0 	0    <A A c                     t                      5  d|v r|                     |d                    d d d            d S # 1 swxY w Y   d S )NuserrT   rU   s     r5   
scrub_userzEventScrubber.scrub_user   s    (** 	/ 	/f...	/ 	/ 	/ 	/ 	/ 	/ 	/ 	/ 	/ 	/ 	/ 	/ 	/ 	/ 	/ 	/ 	/ 	/r[   c                    t                      5  d|v rUt          |d         t                    s:d|d         v r0|d         d         D ]!}d|v r|                     |d                    "d d d            d S # 1 swxY w Y   d S )NbreadcrumbsvaluesrS   )r   rB   r   rD   )r=   rV   values      r5   scrub_breadcrumbszEventScrubber.scrub_breadcrumbs   s    (** 	; 	;%%"5#7HH; E-$888!&}!5h!? ; ;!U?? OOE&M:::	; 	; 	; 	; 	; 	; 	; 	; 	; 	; 	; 	; 	; 	; 	; 	; 	; 	;s   AA66A:=A:c                     t                      5  t          |          D ]!}d|v r|                     |d                    "	 d d d            d S # 1 swxY w Y   d S )Nvars)r   r   rD   )r=   rV   frames      r5   scrub_frameszEventScrubber.scrub_frames   s    (** 	3 	3*511 3 3U??OOE&M2223	3 	3 	3 	3 	3 	3 	3 	3 	3 	3 	3 	3 	3 	3 	3 	3 	3 	3s   2AAAc                    t                      5  d|v rZt          t          t          t          t
          f                  |d                   D ]!}d|v r|                     |d                    "d d d            d S # 1 swxY w Y   d S )NspansrS   )r   r   r   r	   rK   objectrD   )r=   rV   spans      r5   scrub_spanszEventScrubber.scrub_spans   s    (** 	6 	6% d3;&7!8%.II 6 6D~~V555		6 	6 	6 	6 	6 	6 	6 	6 	6 	6 	6 	6 	6 	6 	6 	6 	6 	6s   AA;;A?A?c                    |                      |           |                     |           |                     |           |                     |           |                     |           |                     |           d S )N)rW   rZ   r^   rc   rg   rl   rU   s     r5   scrub_eventzEventScrubber.scrub_event   s~    5!!!u%%%%   r7   )NFFN)__name__
__module____qualname__r@   rE   rD   rW   rZ   r^   rc   rg   rl   rn   r1   r7   r5   r.   r.   =   s        SW# # # #.  # # #(	> 	> 	>0 0 0/ / /
; 
; 
;3 3 36 6 6         r7   r.   N)sentry_sdk.utilsr   r   r   typingr   r   r   r	   sentry_sdk._typesr
   r   r8   r;   r.   r1   r7   r5   <module>ru      s             3 2 2 2 2 2 2 2 2 2 2 2  ''''''% % % N   t  t  t  t  t  t  t  t  t  t r7   