From e89ca269e293998813ab6a972c405c572fdd79d9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Micha=C3=ABl=20Arnauts?= Date: Mon, 21 Dec 2020 17:57:59 +0100 Subject: [PATCH] Make sure we don't log the password (#29) --- resources/lib/solocoo/util.py | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/resources/lib/solocoo/util.py b/resources/lib/solocoo/util.py index ef384bc..281dd38 100644 --- a/resources/lib/solocoo/util.py +++ b/resources/lib/solocoo/util.py @@ -279,7 +279,15 @@ def _request(method, url, params=None, form=None, data=None, token_bearer=None, :returns: The HTTP Response object. :rtype: requests.Response """ - _LOGGER.debug('Sending %s %s... (%s)', method, url, form or data) + if 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) if token_bearer: headers = {