summary refs log tree commit diff
path: root/synapse/types.py
diff options
context:
space:
mode:
authorErik Johnston <erik@matrix.org>2016-10-27 11:02:30 +0100
committerErik Johnston <erik@matrix.org>2016-10-27 11:02:30 +0100
commit45bdacd9a75c7e32b0b8708ae58fb9e661376bfd (patch)
tree0118fd2870598a004d7439f67e21c8651f425643 /synapse/types.py
parentFixup change log (diff)
parentMerge pull request #1098 from matrix-org/markjh/bearer_token (diff)
downloadsynapse-45bdacd9a75c7e32b0b8708ae58fb9e661376bfd.tar.xz
Merge branch 'develop' of github.com:matrix-org/synapse into release-v0.18.2
Diffstat (limited to 'synapse/types.py')
-rw-r--r--synapse/types.py11
1 files changed, 7 insertions, 4 deletions
diff --git a/synapse/types.py b/synapse/types.py

index 1694af1250..ffab12df09 100644 --- a/synapse/types.py +++ b/synapse/types.py
@@ -18,8 +18,9 @@ from synapse.api.errors import SynapseError from collections import namedtuple -Requester = namedtuple("Requester", - ["user", "access_token_id", "is_guest", "device_id"]) +Requester = namedtuple("Requester", [ + "user", "access_token_id", "is_guest", "device_id", "app_service", +]) """ Represents the user making a request @@ -29,11 +30,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 + 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): + device_id=None, app_service=None): """ Create a new ``Requester`` object @@ -43,13 +45,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 + 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) + return Requester(user_id, access_token_id, is_guest, device_id, app_service) def get_domain_from_id(string):