mirror of
https://mau.dev/maunium/synapse.git
synced 2024-11-19 08:24:25 +01:00
Merge pull request #477 from matrix-org/erikj/access_token_log
Don't log urlencoded access_tokens
This commit is contained in:
commit
7a079adc8f
1 changed files with 5 additions and 3 deletions
|
@ -88,6 +88,9 @@ import time
|
||||||
logger = logging.getLogger("synapse.app.homeserver")
|
logger = logging.getLogger("synapse.app.homeserver")
|
||||||
|
|
||||||
|
|
||||||
|
ACCESS_TOKEN_RE = re.compile(r'(\?.*access(_|%5[Ff])token=)[^&]*(.*)$')
|
||||||
|
|
||||||
|
|
||||||
def gz_wrap(r):
|
def gz_wrap(r):
|
||||||
return EncodingResourceWrapper(r, [GzipEncoderFactory()])
|
return EncodingResourceWrapper(r, [GzipEncoderFactory()])
|
||||||
|
|
||||||
|
@ -495,9 +498,8 @@ class SynapseRequest(Request):
|
||||||
)
|
)
|
||||||
|
|
||||||
def get_redacted_uri(self):
|
def get_redacted_uri(self):
|
||||||
return re.sub(
|
return ACCESS_TOKEN_RE.sub(
|
||||||
r'(\?.*access_token=)[^&]*(.*)$',
|
r'\1<redacted>\3',
|
||||||
r'\1<redacted>\2',
|
|
||||||
self.uri
|
self.uri
|
||||||
)
|
)
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue