관리-도구
편집 파일: scrubber.cpython-38.pyc
U �Mg& � @ s� d dl mZmZmZ d dlmZ erHd dlmZ d dlmZ d dlm Z dddd d ddd ddddddddddddddddddd d!d"d#d$d%g Z dd&d'd(gZG d)d*� d*�Zd+S ),� )�capture_internal_exceptions�AnnotatedValue�iter_event_frames)� TYPE_CHECKING)�Event)�List)�Optional�password�passwd�secretZapi_keyZapikey�auth�credentialsZ mysql_pwdZ privatekeyZprivate_key�token�sessionZ csrftokenZ sessionidZx_csrftokenZx_forwarded_for� set_cookie�cookie� authorizationZ x_api_keyZaiohttp_sessionzconnect.sidZ csrf_tokenZcsrfZ_csrfZ_csrf_tokenZ PHPSESSID�_sessionZsymfonyZuser_sessionZ_xsrfz XSRF-TOKENZ x_real_ip� ip_addressZremote_addrc @ s^ e Zd Zddd�Zdd� Zdd� Zd d � Zdd� Zd d� Zdd� Z dd� Z dd� Zdd� ZdS )� EventScrubberNFc C sX |dkrt �� n|| _|s<|dkr*t�� n|}| j|7 _dd� | jD �| _|| _dS )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 S s g | ]}|� � �qS � )�lower)�.0�xr r �A/opt/hc_python/lib/python3.8/site-packages/sentry_sdk/scrubber.py� <listcomp>S s z*EventScrubber.__init__.<locals>.<listcomp>)�DEFAULT_DENYLIST�copy�denylist�DEFAULT_PII_DENYLIST� recursive)�selfr r Zsend_default_piiZpii_denylistr r r �__init__? s �zEventScrubber.__init__c C s0 t |t�sdS |D ]}| �|� | �|� qdS )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�vr r r r&