Skip to content

Commit

Permalink
Make sure we don't log the password (#29)
Browse files Browse the repository at this point in the history
  • Loading branch information
michaelarnauts authored Dec 21, 2020
1 parent 85b2265 commit e89ca26
Showing 1 changed file with 9 additions and 1 deletion.
10 changes: 9 additions & 1 deletion resources/lib/solocoo/util.py
Original file line number Diff line number Diff line change
Expand Up @@ -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 = {
Expand Down

0 comments on commit e89ca26

Please sign in to comment.