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
2e36689d
Commit
2e36689d
authored
9 years ago
by
Daniel Wagner-Hall
Browse files
Options
Downloads
Plain Diff
Merge pull request #553 from matrix-org/daniel/accesstokenlogging
Log more diagnostics for unrecognised access tokens
parents
a644ac6d
2df6114b
Branches
Branches containing commit
Tags
Tags containing commit
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
synapse/api/auth.py
+2
-0
2 additions, 0 deletions
synapse/api/auth.py
with
2 additions
and
0 deletions
synapse/api/auth.py
+
2
−
0
View file @
2e36689d
...
@@ -696,6 +696,7 @@ class Auth(object):
...
@@ -696,6 +696,7 @@ class Auth(object):
def
_look_up_user_by_access_token
(
self
,
token
):
def
_look_up_user_by_access_token
(
self
,
token
):
ret
=
yield
self
.
store
.
get_user_by_access_token
(
token
)
ret
=
yield
self
.
store
.
get_user_by_access_token
(
token
)
if
not
ret
:
if
not
ret
:
logger
.
warn
(
"
Unrecognised access token - not in store: %s
"
%
(
token
,))
raise
AuthError
(
raise
AuthError
(
self
.
TOKEN_NOT_FOUND_HTTP_STATUS
,
"
Unrecognised access token.
"
,
self
.
TOKEN_NOT_FOUND_HTTP_STATUS
,
"
Unrecognised access token.
"
,
errcode
=
Codes
.
UNKNOWN_TOKEN
errcode
=
Codes
.
UNKNOWN_TOKEN
...
@@ -713,6 +714,7 @@ class Auth(object):
...
@@ -713,6 +714,7 @@ class Auth(object):
token
=
request
.
args
[
"
access_token
"
][
0
]
token
=
request
.
args
[
"
access_token
"
][
0
]
service
=
yield
self
.
store
.
get_app_service_by_token
(
token
)
service
=
yield
self
.
store
.
get_app_service_by_token
(
token
)
if
not
service
:
if
not
service
:
logger
.
warn
(
"
Unrecognised appservice access token: %s
"
%
(
token
,))
raise
AuthError
(
raise
AuthError
(
self
.
TOKEN_NOT_FOUND_HTTP_STATUS
,
self
.
TOKEN_NOT_FOUND_HTTP_STATUS
,
"
Unrecognised access token.
"
,
"
Unrecognised access token.
"
,
...
...
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