@@ -66,7 +66,6 @@ def __init__(
6666 recursive : bool = False ,
6767 send_default_pii : bool = False ,
6868 pii_denylist : "Optional[List[str]]" = None ,
69- remove_user_ip_address : bool = False ,
7069 ) -> None :
7170 """
7271 A scrubber that goes through the event payload and removes sensitive data configured through denylists.
@@ -75,7 +74,6 @@ def __init__(
7574 :param recursive: Whether to scrub the event payload recursively, default False.
7675 :param send_default_pii: Whether pii is sending is on, pii fields are not scrubbed.
7776 :param pii_denylist: The denylist to use for scrubbing when pii is not sent, defaults to DEFAULT_PII_DENYLIST.
78- :param remove_user_ip_address: Whether to remove ``user.ip_address`` instead of replacing it with ``[Filtered]``.
7977 """
8078 self .denylist = DEFAULT_DENYLIST .copy () if denylist is None else denylist
8179
@@ -87,7 +85,6 @@ def __init__(
8785
8886 self .denylist = [x .lower () for x in self .denylist ]
8987 self .recursive = recursive
90- self .remove_user_ip_address = remove_user_ip_address
9188
9289 def scrub_list (self , lst : object ) -> None :
9390 """
@@ -141,11 +138,7 @@ def scrub_user(self, event: "Event") -> None:
141138 with capture_internal_exceptions ():
142139 if "user" in event :
143140 user = event ["user" ]
144- if (
145- "ip_address" in self .denylist
146- and self .remove_user_ip_address
147- and isinstance (user , dict )
148- ):
141+ if "ip_address" in self .denylist and isinstance (user , dict ):
149142 user .pop ("ip_address" , None )
150143 self .scrub_dict (user )
151144
0 commit comments