summary refs log tree commit diff
diff options
context:
space:
mode:
authorBrendan Abolivier <babolivier@matrix.org>2022-01-14 16:10:08 +0100
committerGitHub <noreply@github.com>2022-01-14 16:10:08 +0100
commitd1fedca096250e04c8f1b7101003f3f4cfddea9a (patch)
treeac286a9a66a50eb4d909c22a4b21a5038fc627f4
parentMerge pull request #118 from matrix-org/babolivier/delete_twisted_trunk_check (diff)
parentFix divergence with mainline in the auth code (diff)
downloadsynapse-d1fedca096250e04c8f1b7101003f3f4cfddea9a.tar.xz
Merge pull request #119 from matrix-org/babolivier/auth_shadow
Fix divergence with mainline in the auth code
-rw-r--r--synapse/api/auth.py10
1 files changed, 4 insertions, 6 deletions
diff --git a/synapse/api/auth.py b/synapse/api/auth.py
index b98b818d18..44883c6663 100644
--- a/synapse/api/auth.py
+++ b/synapse/api/auth.py
@@ -268,12 +268,11 @@ class Auth:
                 403,
                 "Application service cannot masquerade as this user (%s)." % user_id,
             )
-        # Let ASes manipulate nonexistent users (e.g. to shadow-register them)
         # Check to make sure the user is already registered on the homeserver
-        # elif not (await self.store.get_user_by_id(user_id)):
-        #     raise AuthError(
-        #         403, "Application service has not registered this user (%s)" % user_id
-        #     )
+        elif not (await self.store.get_user_by_id(user_id)):
+            raise AuthError(
+                403, "Application service has not registered this user (%s)" % user_id
+            )
 
     async def _get_appservice_user_id(
         self, request: Request
@@ -281,7 +280,6 @@ class Auth:
         app_service = self.store.get_app_service_by_token(
             self.get_access_token_from_request(request)
         )
-
         if app_service is None:
             return None, None