summary refs log tree commit diff
path: root/synapse/server.py
diff options
context:
space:
mode:
authorMark Haines <mjark@negativecurvature.net>2015-04-28 11:00:27 +0100
committerMark Haines <mjark@negativecurvature.net>2015-04-28 11:00:27 +0100
commit9182f876645a27eb9599c99963876b12067fe93a (patch)
tree158a1e1213f73f2395389d5a861b5eb07f8eb36f /synapse/server.py
parentMerge pull request #133 from matrix-org/invite_power_level (diff)
parentAdd commentage. (diff)
downloadsynapse-9182f876645a27eb9599c99963876b12067fe93a.tar.xz
Merge pull request #126 from matrix-org/csauth
Client / Server Auth Refactor
Diffstat (limited to 'synapse/server.py')
-rw-r--r--synapse/server.py10
1 files changed, 10 insertions, 0 deletions
diff --git a/synapse/server.py b/synapse/server.py
index 0bd87bdd77..af87dab12c 100644
--- a/synapse/server.py
+++ b/synapse/server.py
@@ -65,6 +65,7 @@ class BaseHomeServer(object):
         'replication_layer',
         'datastore',
         'handlers',
+        'v1auth',
         'auth',
         'rest_servlet_factory',
         'state_handler',
@@ -181,6 +182,15 @@ class HomeServer(BaseHomeServer):
     def build_auth(self):
         return Auth(self)
 
+    def build_v1auth(self):
+        orf = Auth(self)
+        # Matrix spec makes no reference to what HTTP status code is returned,
+        # but the V1 API uses 403 where it means 401, and the webclient
+        # relies on this behaviour, so V1 gets its own copy of the auth
+        # with backwards compat behaviour.
+        orf.TOKEN_NOT_FOUND_HTTP_STATUS = 403
+        return orf
+
     def build_state_handler(self):
         return StateHandler(self)