|
61 | 61 | "HTTPError"
|
62 | 62 | ]
|
63 | 63 |
|
64 |
| -SENSITIVE_KEYS = ["password", "token", "Authorization"] |
| 64 | +SENSITIVE_KEYS = ['Authorization', 'Cookie', 'action.email.auth_password', 'auth', 'auth_password', 'clear_password', 'clientId', |
| 65 | + 'crc-salt', 'encr_password', 'oldpassword', 'passAuth', 'password', 'session', 'suppressionKey', |
| 66 | + 'token'] |
| 67 | + |
65 | 68 | # If you change these, update the docstring
|
66 | 69 | # on _authority as well.
|
67 | 70 | DEFAULT_HOST = "localhost"
|
@@ -90,7 +93,8 @@ def mask_sensitive_data(data):
|
90 | 93 | except Exception as ex:
|
91 | 94 | return data
|
92 | 95 |
|
93 |
| - if not isinstance(data, dict): |
| 96 | + # json.loads will return "123"(str) as 123(int), so return the data |
| 97 | + if isinstance(data, int): |
94 | 98 | return data
|
95 | 99 | mdata = {}
|
96 | 100 | for k, v in data.items():
|
@@ -863,8 +867,7 @@ def request(self, path_segment, method="GET", headers=None, body={},
|
863 | 867 |
|
864 | 868 | all_headers = headers + self.additional_headers + self._auth_headers
|
865 | 869 | logger.debug("%s request to %s (headers: %s, body: %s)",
|
866 |
| - method, path, str(all_headers), mask_sensitive_data(body)) |
867 |
| - |
| 870 | + method, path, str(mask_sensitive_data(dict(all_headers))), mask_sensitive_data(body)) |
868 | 871 | if body:
|
869 | 872 | body = _encode(**body)
|
870 | 873 |
|
|
0 commit comments