Skip to content
This repository has been archived by the owner on Mar 26, 2024. It is now read-only.

Commit

Permalink
Redo client IP tracking removal to appease sytest
Browse files Browse the repository at this point in the history
  • Loading branch information
Fizzadar committed Jan 29, 2024
1 parent c097143 commit d555581
Showing 1 changed file with 6 additions and 4 deletions.
10 changes: 6 additions & 4 deletions synapse/api/auth/internal.py
Original file line number Diff line number Diff line change
Expand Up @@ -115,10 +115,7 @@ async def _wrapped_get_user_by_req(
Once get_user_by_req has set up the opentracing span, this does the actual work.
"""
try:
# Beep: don't care about client IPs in synapse since hungry proxies (so IP is hungry)
ip_addr = ""
# ip_addr = request.get_client_ip_if_available()

ip_addr = request.get_client_ip_if_available()
user_agent = get_request_user_agent(request)

access_token = self.get_access_token_from_request(request)
Expand Down Expand Up @@ -157,6 +154,11 @@ async def _wrapped_get_user_by_req(
errcode=Codes.EXPIRED_ACCOUNT,
)

# Beep: don't care about client IPs in synapse since hungry proxies (so IP is hungry),
# if check here to appease sytest.
if not requester.user.to_string().startswith("@__ANON__"):
ip_addr = ""

if ip_addr and (
not requester.app_service or self._track_appservice_user_ips
):
Expand Down

0 comments on commit d555581

Please sign in to comment.