Skip to content
This repository was archived by the owner on Apr 26, 2024. It is now read-only.

Commit 3596575

Browse files
committed
Add some better comments on what we're trying to check for
1 parent c0909de commit 3596575

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

synapse/rest/client/v1/room.py

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -29,8 +29,6 @@
2929
SynapseError,
3030
)
3131
from synapse.api.filtering import Filter
32-
33-
3432
from synapse.appservice import ApplicationService
3533
from synapse.events.utils import format_event_for_client_v2
3634
from synapse.http.servlet import (
@@ -398,13 +396,16 @@ async def _create_requester_from_app_service(
398396
Requester object
399397
"""
400398

399+
# It's ok if the app service is trying to use the sender from their registration
401400
if app_service.sender == user_id:
402401
pass
402+
# Check to make sure the app service is allowed to control the user
403403
elif not app_service.is_interested_in_user(user_id):
404404
raise AuthError(
405405
403,
406406
"Application service cannot masquerade as this user (%s)." % user_id,
407407
)
408+
# Check to make sure the user is already registered on the homeserver
408409
elif not (await self.store.get_user_by_id(user_id)):
409410
raise AuthError(
410411
403, "Application service has not registered this user (%s)" % user_id

0 commit comments

Comments
 (0)