also redact __str__ of ApplicationService used for logging

pull/3349/head
Michael Telatynski 2018-06-06 10:35:29 +01:00
parent 330432031b
commit 592c162516
No known key found for this signature in database
GPG Key ID: 3F879DA5AD802A5E
1 changed files with 5 additions and 1 deletions

View File

@ -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,)