This repository has been archived by the owner on Apr 26, 2024. It is now read-only.
-
-
Notifications
You must be signed in to change notification settings - Fork 2.1k
Add ability for access tokens to belong to one user but grant access to another user. #8616
Merged
Merged
Changes from 11 commits
Commits
Show all changes
14 commits
Select commit
Hold shift + click to select a range
bc422e1
Make get_user_by_access_token return a proper type
erikjohnston 17a3d94
Add concept of authenticated_entity vs target_user
erikjohnston 028f04b
Newsfile
erikjohnston 9b72dab
Update synapse/types.py
erikjohnston 66ef6cd
Update docstring
erikjohnston c87bf0d
Update docstring
erikjohnston 6a06304
Pass requester to SynapseRequest
erikjohnston 3286c21
Change log format when puppetting user to use ',' rather than ' as '
erikjohnston acf1314
Add types to create_requester
erikjohnston 6f736b8
Change opentracing to use user_id not target_user
erikjohnston 9d919da
Fix mypy
erikjohnston 49bb079
Review comments
erikjohnston 492e15e
Fix tests by mandating AS have sender.
erikjohnston 05c7f7b
py3.5 syntax
erikjohnston File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
Change schema to support access tokens belonging to one user but granting access to another. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -984,17 +984,17 @@ async def delete_access_token(self, access_token: str): | |
# This might return an awaitable, if it does block the log out | ||
# until it completes. | ||
result = provider.on_logged_out( | ||
user_id=str(user_info["user"]), | ||
device_id=user_info["device_id"], | ||
user_id=user_info.user_id, | ||
device_id=user_info.device_id, | ||
access_token=access_token, | ||
) | ||
if inspect.isawaitable(result): | ||
await result | ||
|
||
# delete pushers associated with this access token | ||
if user_info["token_id"] is not None: | ||
if user_info.token_id is not None: | ||
await self.hs.get_pusherpool().remove_pushers_by_access_token( | ||
str(user_info["user"]), (user_info["token_id"],) | ||
user_info.user_id, (user_info.token_id,) | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. any idea what the There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. The |
||
) | ||
|
||
async def delete_access_tokens_for_user( | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This implies some potential clean-up if each request has a requester on it... (I think we frequently pass the
SynapseRequest
andRequester
into handlers). Nothing to really do here though. Just noting.