Merge pull request #783 from yalh76/token

adding token to not be logged
This commit is contained in:
Bram 2019-08-20 21:18:48 +02:00 committed by GitHub
commit 3d7c3d13de
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -315,7 +315,7 @@ class RedactingFormatter(Formatter):
try:
# This matches stuff like db_pwd=the_secret or admin_password=other_secret
# (the secret part being at least 3 chars to avoid catching some lines like just "db_pwd=")
match = re.search(r'(pwd|pass|password|secret|key)=(\S{3,})$', record.strip())
match = re.search(r'(pwd|pass|password|secret|key|token)=(\S{3,})$', record.strip())
if match and match.group(2) not in self.data_to_redact:
self.data_to_redact.append(match.group(2))
except Exception as e: