Skip to content

Commit

Permalink
updated regex for finding JWT
Browse files Browse the repository at this point in the history
  • Loading branch information
staaldraad committed Oct 2, 2024
1 parent b627070 commit dd4cdc1
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion realtime/logging_util.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,11 @@
import logging
import re

redact = r"(eyJh\w*\.)(\w*)\."
# redaction regex for detecting JWT tokens
# <header>.<payload>.<signature>
# character set [a-zA-Z0-9_-]
# \w covers [a-zA-Z0-9]
redact = r"(eyJh[-_\w]*\.)([-_\w]*)\."


class TokenMaskingFilter(logging.Filter):
Expand Down

0 comments on commit dd4cdc1

Please sign in to comment.