o
    #if                     @   sd   d dl mZmZmZ d dlmZ er$d dlmZ d dlmZ d dlm	Z	 g dZ
G dd deZd	S )
    )capture_internal_exceptionsAnnotatedValueiter_event_frames)TYPE_CHECKING)Event)List)Optional)$passwordpasswdsecretapi_keyapikeyauthcredentials	mysql_pwd
privatekeyprivate_keytoken
ip_addresssession	csrftoken	sessionidremote_addrx_csrftokenx_forwarded_for
set_cookiecookieauthorization	x_api_keyr   	x_real_ipaiohttp_sessionzconnect.sid
csrf_tokencsrf_csrf_csrf_token	PHPSESSID_sessionsymfonyuser_session_xsrfz
XSRF-TOKENc                   @   s^   e Zd ZdddZdd Zdd Zd	d
 Zdd Zdd Zdd Z	dd Z
dd Zdd ZdS )EventScrubberNFc                 C   s.   |d u rt n|| _dd | jD | _|| _d S )Nc                 S   s   g | ]}|  qS  )lower).0xr+   r+   L/var/www/html/corbot_env/lib/python3.10/site-packages/sentry_sdk/scrubber.py
<listcomp>>   s    z*EventScrubber.__init__.<locals>.<listcomp>)DEFAULT_DENYLISTdenylist	recursive)selfr2   r3   r+   r+   r/   __init__;   s   
zEventScrubber.__init__c                 C   s0   t |tsdS |D ]}| | | | q	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)r4   lstvr+   r+   r/   r9   A   s   

zEventScrubber.scrub_listc                 C   sd   t |tsdS | D ]$\}}t |tr"| | jv r"t ||< q| jr/| 	| | 
| q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)r6   dictitemsstrr,   r2   r   +substituted_because_contains_sensitive_datar3   r8   r9   )r4   dkr;   r+   r+   r/   r8   P   s   


zEventScrubber.scrub_dictc                 C   s   t  J d|v r=d|d v r| |d d  d|d v r&| |d d  d|d v rE| |d d  W d    d S W d    d S W d    d S 1 sPw   Y  d S )Nrequestheaderscookiesdatar   r8   r4   eventr+   r+   r/   scrub_requestd   s   "zEventScrubber.scrub_requestc                 C   R   t   d|v r| |d  W d    d S W d    d S 1 s"w   Y  d S )NextrarF   rG   r+   r+   r/   scrub_extrao      "zEventScrubber.scrub_extrac                 C   rJ   )NuserrF   rG   r+   r+   r/   
scrub_useru   rM   zEventScrubber.scrub_userc                 C   s   t  7 d|v r"d|d v r*|d d D ]}d|v r!| |d  qW d    d S W d    d S W d    d S 1 s=w   Y  d S )NbreadcrumbsvaluesrE   rF   )r4   rH   valuer+   r+   r/   scrub_breadcrumbs{   s   "zEventScrubber.scrub_breadcrumbsc                 C   sP   t   t|D ]}d|v r| |d  qW d    d S 1 s!w   Y  d S )Nvars)r   r   r8   )r4   rH   framer+   r+   r/   scrub_frames   s   "zEventScrubber.scrub_framesc                 C   sh   t  ' d|v r|d D ]}d|v r| |d  qW d    d S W d    d S 1 s-w   Y  d S )NspansrE   rF   )r4   rH   spanr+   r+   r/   scrub_spans   s   "zEventScrubber.scrub_spansc                 C   s@   |  | | | | | | | | | | | d S )N)rI   rL   rO   rS   rV   rY   rG   r+   r+   r/   scrub_event   s   




zEventScrubber.scrub_event)NF)__name__
__module____qualname__r5   r9   r8   rI   rL   rO   rS   rV   rY   rZ   r+   r+   r+   r/   r*   :   s    
	r*   N)sentry_sdk.utilsr   r   r   sentry_sdk._typesr   r   typingr   r   r1   objectr*   r+   r+   r+   r/   <module>   s    ,