summary refs log tree commit diff
diff options
context:
space:
mode:
authorDaniel Wagner-Hall <dawagner@gmail.com>2016-01-14 11:06:43 +0000
committerDaniel Wagner-Hall <dawagner@gmail.com>2016-01-14 11:06:43 +0000
commitd14fcfd24aaa44a2e56a76d75c8eff9c89eaee3c (patch)
treeb22e98f644c4da49e88f737a51e020f964aca1de
parentMerge pull request #494 from matrix-org/daniel/2 (diff)
parentRequire AS users to be registered before use (diff)
downloadsynapse-d14fcfd24aaa44a2e56a76d75c8eff9c89eaee3c.tar.xz
Merge pull request #487 from matrix-org/daniel/forceregistration
Require AS users to be registered before use
-rw-r--r--synapse/api/auth.py5
1 files changed, 5 insertions, 0 deletions
diff --git a/synapse/api/auth.py b/synapse/api/auth.py
index 876869bb74..e36313e2fb 100644
--- a/synapse/api/auth.py
+++ b/synapse/api/auth.py
@@ -528,6 +528,11 @@ class Auth(object):
                             403,
                             "Application service cannot masquerade as this user."
                         )
+                    if not (yield self.store.get_user_by_id(user_id)):
+                        raise AuthError(
+                            403,
+                            "Application service has not registered this user"
+                        )
 
                 if not user_id:
                     raise KeyError