summary refs log tree commit diff
path: root/synapse/rest
diff options
context:
space:
mode:
authorDavid Baker <dave@matrix.org>2015-04-17 13:44:12 +0100
committerDavid Baker <dave@matrix.org>2015-04-17 13:44:12 +0100
commit94e1e58b4de00ea92fa60d6fc7970dafa9ebce2a (patch)
tree4044a33ee4bcad6772d7f0f8cefb5d6a3634b393 /synapse/rest
parentNeed to yield the username check, otherwise very very weird things happen. (diff)
downloadsynapse-94e1e58b4de00ea92fa60d6fc7970dafa9ebce2a.tar.xz
password -> account servlet and add start of an 'add 3pid' endpoint
Diffstat (limited to 'synapse/rest')
-rw-r--r--synapse/rest/client/v2_alpha/__init__.py4
-rw-r--r--synapse/rest/client/v2_alpha/account.py (renamed from synapse/rest/client/v2_alpha/password.py)15
2 files changed, 17 insertions, 2 deletions
diff --git a/synapse/rest/client/v2_alpha/__init__.py b/synapse/rest/client/v2_alpha/__init__.py
index 86e4bc729e..28d95b2729 100644
--- a/synapse/rest/client/v2_alpha/__init__.py
+++ b/synapse/rest/client/v2_alpha/__init__.py
@@ -16,7 +16,7 @@
 from . import (
     sync,
     filter,
-    password,
+    account,
     register,
     auth
 )
@@ -35,6 +35,6 @@ class ClientV2AlphaRestResource(JsonResource):
     def register_servlets(client_resource, hs):
         sync.register_servlets(hs, client_resource)
         filter.register_servlets(hs, client_resource)
-        password.register_servlets(hs, client_resource)
+        account.register_servlets(hs, client_resource)
         register.register_servlets(hs, client_resource)
         auth.register_servlets(hs, client_resource)
diff --git a/synapse/rest/client/v2_alpha/password.py b/synapse/rest/client/v2_alpha/account.py
index cb0c8cfb55..0f3b12880c 100644
--- a/synapse/rest/client/v2_alpha/password.py
+++ b/synapse/rest/client/v2_alpha/account.py
@@ -75,5 +75,20 @@ class PasswordRestServlet(RestServlet):
         return 200, {}
 
 
+class AddThreepidRestServlet(RestServlet):
+    PATTERN = client_v2_pattern("/account/3pid")
+
+    @defer.inlineCallbacks
+    def on_POST(self, request):
+        body = parse_json_dict_from_request(request)
+
+        if 'threePidCreds' not in body:
+            raise SynapseError(400, "Missing param", Codes.MISSING_PARAM)
+
+        auth_user, client = yield self.auth.get_user_by_req(request)
+
+
+
+
 def register_servlets(hs, http_server):
     PasswordRestServlet(hs).register(http_server)