From 7535a92f686355f3a26562cadaa9ceab27545db0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Micha=C3=ABl=20Arnauts?= Date: Mon, 21 Dec 2020 17:40:17 +0100 Subject: [PATCH] Don't show the password in the debug log (#24) --- resources/lib/streamz/util.py | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/resources/lib/streamz/util.py b/resources/lib/streamz/util.py index 9ba8198..7da2390 100644 --- a/resources/lib/streamz/util.py +++ b/resources/lib/streamz/util.py @@ -143,7 +143,12 @@ def _request(method, url, params=None, form=None, data=None, token=None, profile :rtype: requests.Response """ if form or data: - _LOGGER.debug('Sending %s %s: %s', method, url, form or data) + # Make sure we don't log the password + debug_data = dict() + debug_data.update(form or data) + if 'password' in debug_data: + debug_data['password'] = '**redacted**' + _LOGGER.debug('Sending %s %s: %s', method, url, debug_data) else: _LOGGER.debug('Sending %s %s', method, url)