You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@allura.apache.org by br...@apache.org on 2015/05/28 22:13:23 UTC

[21/26] 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/1f8d1329
Tree: http://git-wip-us.apache.org/repos/asf/allura/tree/1f8d1329
Diff: http://git-wip-us.apache.org/repos/asf/allura/diff/1f8d1329

Branch: refs/heads/master
Commit: 1f8d1329931a5519f57f2c256c2182785b08d713
Parents: 53d48fb
Author: Igor Bondarenko <je...@gmail.com>
Authored: Mon May 25 16:26:43 2015 +0000
Committer: Dave Brondsema <db...@slashdotmedia.com>
Committed: Thu May 28 20:11:46 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/1f8d1329/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)