You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@allura.apache.org by je...@apache.org on 2015/05/27 13:58:14 UTC
[42/50] [abbrv] allura git commit: [#7868] ticket:776 Don't log phone
number and API credentials
[#7868] ticket:776 Don't log phone number and API credentials
Project: http://git-wip-us.apache.org/repos/asf/allura/repo
Commit: http://git-wip-us.apache.org/repos/asf/allura/commit/9f8684f8
Tree: http://git-wip-us.apache.org/repos/asf/allura/tree/9f8684f8
Diff: http://git-wip-us.apache.org/repos/asf/allura/diff/9f8684f8
Branch: refs/heads/ib/7868
Commit: 9f8684f87a0624db063de9ed22d02d89b07c1b8e
Parents: 554a4a8
Author: Igor Bondarenko <je...@gmail.com>
Authored: Mon May 25 16:26:43 2015 +0000
Committer: Igor Bondarenko <je...@gmail.com>
Committed: Mon May 25 16:26:43 2015 +0000
----------------------------------------------------------------------
Allura/allura/lib/phone/nexmo.py | 8 ++++++--
1 file changed, 6 insertions(+), 2 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/allura/blob/9f8684f8/Allura/allura/lib/phone/nexmo.py
----------------------------------------------------------------------
diff --git a/Allura/allura/lib/phone/nexmo.py b/Allura/allura/lib/phone/nexmo.py
index c9e2a32..feb6896 100644
--- a/Allura/allura/lib/phone/nexmo.py
+++ b/Allura/allura/lib/phone/nexmo.py
@@ -56,8 +56,12 @@ class NexmoPhoneService(PhoneService):
url += '/'
url = urljoin(url, 'json')
headers = {'Content-Type': 'application/json'}
- params = json.dumps(self.add_common_params(params), sort_keys=True)
- log.info('PhoneService (nexmo) request: %s %s', url, params)
+ params = self.add_common_params(params)
+ log_params = dict(params, api_key='...', api_secret='...')
+ if 'number' in log_params:
+ log_params['number'] = '...'
+ params = json.dumps(params, sort_keys=True)
+ log.info('PhoneService (nexmo) request: %s %s', url, log_params)
try:
resp = requests.post(url, data=params, headers=headers)
log.info('PhoneService (nexmo) response: %s', resp.content)