Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
synapse
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Container registry
Model registry
Monitor
Service Desk
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Maunium
synapse
Commits
09503126
Unverified
Commit
09503126
authored
6 years ago
by
Michael Telatynski
Browse files
Options
Downloads
Patches
Plain Diff
Strip `access_token` from outgoing requests using existing regex
parent
a9e97dcd
No related branches found
No related tags found
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
synapse/http/client.py
+6
-1
6 additions, 1 deletion
synapse/http/client.py
with
6 additions
and
1 deletion
synapse/http/client.py
+
6
−
1
View file @
09503126
...
@@ -20,6 +20,7 @@ from synapse.api.errors import (
...
@@ -20,6 +20,7 @@ from synapse.api.errors import (
CodeMessageException
,
MatrixCodeMessageException
,
SynapseError
,
Codes
,
CodeMessageException
,
MatrixCodeMessageException
,
SynapseError
,
Codes
,
)
)
from
synapse.http
import
cancelled_to_request_timed_out_error
from
synapse.http
import
cancelled_to_request_timed_out_error
from
synapse.http.site
import
ACCESS_TOKEN_RE
from
synapse.util.async
import
add_timeout_to_deferred
from
synapse.util.async
import
add_timeout_to_deferred
from
synapse.util.caches
import
CACHE_SIZE_FACTOR
from
synapse.util.caches
import
CACHE_SIZE_FACTOR
from
synapse.util.logcontext
import
make_deferred_yieldable
from
synapse.util.logcontext
import
make_deferred_yieldable
...
@@ -90,7 +91,11 @@ class SimpleHttpClient(object):
...
@@ -90,7 +91,11 @@ class SimpleHttpClient(object):
# counters to it
# counters to it
outgoing_requests_counter
.
labels
(
method
).
inc
()
outgoing_requests_counter
.
labels
(
method
).
inc
()
logger
.
info
(
"
Sending request %s %s
"
,
method
,
uri
)
# log request but strip `access_token` (AS requests for example include this)
logger
.
info
(
"
Sending request %s %s
"
,
method
,
ACCESS_TOKEN_RE
.
sub
(
r
'
\1<redacted>\3
'
,
uri
))
try
:
try
:
request_deferred
=
self
.
agent
.
request
(
request_deferred
=
self
.
agent
.
request
(
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment