From 2a0820b87a920ef200d19c0a37eda15ce846482f Mon Sep 17 00:00:00 2001 From: anxdpanic Date: Thu, 20 Sep 2018 08:37:44 -0400 Subject: [PATCH] redact user ip from token logging --- addon.xml | 4 +--- changelog.txt | 3 +++ resources/lib/twitch/log.py | 1 + 3 files changed, 5 insertions(+), 3 deletions(-) diff --git a/addon.xml b/addon.xml index 98aca86..cf01f1c 100644 --- a/addon.xml +++ b/addon.xml @@ -9,9 +9,7 @@ all -[fix] Python 3 compat. -[add] fast_bread param to usher -[add/upd] helix endpoints +[chg] redact user ip from token logging icon.png diff --git a/changelog.txt b/changelog.txt index 4692bf5..51c9c51 100644 --- a/changelog.txt +++ b/changelog.txt @@ -1,3 +1,6 @@ +2.0.3 +[chg] redact user ip from token logging + 2.0.2 [fix] Python 3 compat. [add] fast_bread param to usher diff --git a/resources/lib/twitch/log.py b/resources/lib/twitch/log.py index 5425012..704d562 100644 --- a/resources/lib/twitch/log.py +++ b/resources/lib/twitch/log.py @@ -23,6 +23,7 @@ def _mask(message): masked_message = re.sub(r'(USER-IP=[\'"])[^\'"]+', r'\1' + mask, masked_message) masked_message = re.sub(r'(["\']client_secret["\']:\s*[\'"])[^\'"]+', r'\1' + mask, masked_message) masked_message = re.sub(r'(client_secret=).+?(&|$|\|)', r'\1' + mask + r'\2', masked_message) + masked_message = re.sub(r'(\\*"user_ip\\*":\\*").+?(\\*")', r'\1' + mask + r'\2', masked_message) return masked_message