Skip to content

Commit

Permalink
Merge pull request #39 from galaxy-genome-annotation/4.2.5
Browse files Browse the repository at this point in the history
Prevent from displaying login/password in the logs
  • Loading branch information
abretaud committed Aug 19, 2020
2 parents 03e9628 + 6b946ff commit 3733712
Show file tree
Hide file tree
Showing 4 changed files with 14 additions and 3 deletions.
2 changes: 2 additions & 0 deletions README.rst
Original file line number Diff line number Diff line change
Expand Up @@ -85,6 +85,8 @@ Or with the Arrow client:
History
-------

- 4.2.5
- Prevent from displaying login/password in the logs
- 4.2.4
- Remove unused dependency
- 4.2.3
Expand Down
11 changes: 10 additions & 1 deletion apollo/client.py
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,11 @@ def post(self, client_method, data, post_params=None, is_json=True, files=None,
else:
raise Exception("You must add credentials yourself")

# We don't want username+password in the logs
data_log = dict(data)
data_log['username'] = 'XXXXXXXXX'
data_log['password'] = 'XXXXXXXXX'

if autoconvert_to_json:
headers = {
'Content-Type': 'application/json'
Expand All @@ -55,8 +60,12 @@ def post(self, client_method, data, post_params=None, is_json=True, files=None,
curl_command = ['curl', url]
for (k, v) in headers.items():
curl_command += ['-H', quote('%s: %s' % (k, v))]

curl_command_log = curl_command + ['-d', quote(json.dumps(data_log))]

curl_command += ['-d', quote(json.dumps(data))]
log.info(' '.join(curl_command))

log.info(' '.join(curl_command_log))

resp = requests.post(url, data=data, headers=headers, verify=self.__verify,
params=post_params, allow_redirects=False,
Expand Down
2 changes: 1 addition & 1 deletion arrow/__init__.py
Original file line number Diff line number Diff line change
@@ -1 +1 @@
__version__ = '4.2.4'
__version__ = '4.2.5'
2 changes: 1 addition & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@

setup(
name="apollo",
version='4.2.4',
version='4.2.5',
description="Apollo API library",
long_description=readme,
author="Helena Rasche;Anthony Bretaudeau;Nathan Dunn",
Expand Down

0 comments on commit 3733712

Please sign in to comment.