summary refs log tree commit diff
path: root/synapse
diff options
context:
space:
mode:
authorMichael Telatynski <7t3chguy@gmail.com>2018-06-06 10:35:29 +0100
committerMichael Telatynski <7t3chguy@gmail.com>2018-06-06 10:35:29 +0100
commit592c16251614da7e055b3d864a5885c20cfd3cd0 (patch)
tree5f896ba28064331cda53ea34cf02e47067803b8a /synapse
parentredact_uri in two missed log paths (diff)
downloadsynapse-592c16251614da7e055b3d864a5885c20cfd3cd0.tar.xz
also redact __str__ of ApplicationService used for logging
Diffstat (limited to 'synapse')
-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,)