mirror of
https://git.anonymousland.org/anonymousland/synapse.git
synced 2025-05-03 07:15:32 -04:00
as_user->app_service, less redundant comments, better positioned comments
This commit is contained in:
parent
8bfd01f619
commit
f09db236b1
3 changed files with 11 additions and 14 deletions
|
@ -19,7 +19,7 @@ from collections import namedtuple
|
|||
|
||||
|
||||
Requester = namedtuple("Requester",
|
||||
["user", "access_token_id", "is_guest", "device_id", "as_user"])
|
||||
["user", "access_token_id", "is_guest", "device_id", "app_service"])
|
||||
"""
|
||||
Represents the user making a request
|
||||
|
||||
|
@ -29,12 +29,12 @@ Attributes:
|
|||
request, or None if it came via the appservice API or similar
|
||||
is_guest (bool): True if the user making this request is a guest user
|
||||
device_id (str|None): device_id which was set at authentication time
|
||||
as_user (ApplicationService|None): the AS requesting on behalf of the user
|
||||
app_service (ApplicationService|None): the AS requesting on behalf of the user
|
||||
"""
|
||||
|
||||
|
||||
def create_requester(user_id, access_token_id=None, is_guest=False,
|
||||
device_id=None, as_user=None):
|
||||
device_id=None, app_service=None):
|
||||
"""
|
||||
Create a new ``Requester`` object
|
||||
|
||||
|
@ -44,14 +44,14 @@ def create_requester(user_id, access_token_id=None, is_guest=False,
|
|||
request, or None if it came via the appservice API or similar
|
||||
is_guest (bool): True if the user making this request is a guest user
|
||||
device_id (str|None): device_id which was set at authentication time
|
||||
as_user (ApplicationService|None): the AS requesting on behalf of the user
|
||||
app_service (ApplicationService|None): the AS requesting on behalf of the user
|
||||
|
||||
Returns:
|
||||
Requester
|
||||
"""
|
||||
if not isinstance(user_id, UserID):
|
||||
user_id = UserID.from_string(user_id)
|
||||
return Requester(user_id, access_token_id, is_guest, device_id, as_user)
|
||||
return Requester(user_id, access_token_id, is_guest, device_id, app_service)
|
||||
|
||||
|
||||
def get_domain_from_id(string):
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue