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
Package registry
Container Registry
Model registry
Operate
Terraform modules
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
Timo Ley
synapse
Commits
88e03da3
Commit
88e03da3
authored
9 years ago
by
Daniel Wagner-Hall
Browse files
Options
Downloads
Patches
Plain Diff
Minor docs cleanup
parent
9dba8132
No related branches found
No related tags found
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
synapse/api/auth.py
+7
-2
7 additions, 2 deletions
synapse/api/auth.py
synapse/types.py
+2
-1
2 additions, 1 deletion
synapse/types.py
with
9 additions
and
3 deletions
synapse/api/auth.py
+
7
−
2
View file @
88e03da3
...
...
@@ -44,6 +44,11 @@ class Auth(object):
def
check
(
self
,
event
,
auth_events
):
"""
Checks if this event is correctly authed.
Args:
event: the event being checked.
auth_events (dict: event-key -> event): the existing room state.
Returns:
True if the auth checks pass.
"""
...
...
@@ -319,7 +324,7 @@ class Auth(object):
Returns:
tuple : of UserID and device string:
User ID object of the user making the request
Client
ID
object of the client instance the user is using
Client
Info
object of the client instance the user is using
Raises:
AuthError if no user by that token exists or the token is invalid.
"""
...
...
@@ -352,7 +357,7 @@ class Auth(object):
)
return
except
KeyError
:
pass
# normal users won't have th
is
query parameter set
pass
# normal users won't have th
e user_id
query parameter set
.
user_info
=
yield
self
.
get_user_by_token
(
access_token
)
user
=
user_info
[
"
user
"
]
...
...
This diff is collapsed.
Click to expand it.
synapse/types.py
+
2
−
1
View file @
88e03da3
...
...
@@ -178,7 +178,7 @@ class RoomStreamToken(namedtuple("_StreamToken", "topological stream")):
Live tokens start with an
"
s
"
followed by the
"
stream_ordering
"
id of the
event it comes after. Historic tokens start with a
"
t
"
followed by the
"
topological_ordering
"
id of the event it comes after, foll
e
wed by
"
-
"
,
"
topological_ordering
"
id of the event it comes after, foll
o
wed by
"
-
"
,
followed by the
"
stream_ordering
"
id of the event it comes after.
"""
__slots__
=
[]
...
...
@@ -211,4 +211,5 @@ class RoomStreamToken(namedtuple("_StreamToken", "topological stream")):
return
"
s%d
"
%
(
self
.
stream
,)
# token_id is the primary key ID of the access token, not the access token itself.
ClientInfo
=
namedtuple
(
"
ClientInfo
"
,
(
"
device_id
"
,
"
token_id
"
))
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