summary refs log tree commit diff
path: root/synapse/appservice/__init__.py
diff options
context:
space:
mode:
authorRichard van der Hoff <1389908+richvdh@users.noreply.github.com>2018-06-06 10:58:07 +0100
committerGitHub <noreply@github.com>2018-06-06 10:58:07 +0100
commitad459a106cb9c7c51aefdc8b59d14ab549c7b271 (patch)
treecf7a160ca0b25d834fa0440f3f7e847f1d370a0a /synapse/appservice/__init__.py
parentMerge pull request #3347 from krombel/py3_extend_tox_2 (diff)
parentalso redact __str__ of ApplicationService used for logging (diff)
downloadsynapse-ad459a106cb9c7c51aefdc8b59d14ab549c7b271.tar.xz
Merge pull request #3349 from t3chguy/redact_as_request_token
Redact AS tokens in log (fixes to #3327)
Diffstat (limited to 'synapse/appservice/__init__.py')
-rw-r--r--synapse/appservice/__init__.py6
1 files changed, 5 insertions, 1 deletions
diff --git a/synapse/appservice/__init__.py b/synapse/appservice/__init__.py
index 5fdb579723..d1c598622a 100644
--- a/synapse/appservice/__init__.py
+++ b/synapse/appservice/__init__.py
@@ -292,4 +292,8 @@ class ApplicationService(object):
         return self.rate_limited
 
     def __str__(self):
-        return "ApplicationService: %s" % (self.__dict__,)
+        # copy dictionary and redact token fields so they don't get logged
+        dict_copy = self.__dict__.copy()
+        dict_copy["token"] = "<redacted>"
+        dict_copy["hs_token"] = "<redacted>"
+        return "ApplicationService: %s" % (dict_copy,)