summary refs log tree commit diff
diff options
context:
space:
mode:
-rw-r--r--synapse/handlers/identity.py2
-rw-r--r--synapse/rest/client/v2_alpha/account.py7
-rw-r--r--tests/rest/client/test_identity.py2
3 files changed, 6 insertions, 5 deletions
diff --git a/synapse/handlers/identity.py b/synapse/handlers/identity.py

index b4c6e94777..f39803629e 100644 --- a/synapse/handlers/identity.py +++ b/synapse/handlers/identity.py
@@ -388,7 +388,7 @@ class IdentityHandler(BaseHandler): @defer.inlineCallbacks def bulk_lookup_3pid(self, id_server, threepids): - """Looks up a 3pid in the passed identity server. + """Looks up given 3pids in the passed identity server. Args: id_server (str): The server name (including port, if required) diff --git a/synapse/rest/client/v2_alpha/account.py b/synapse/rest/client/v2_alpha/account.py
index f1037ce115..08079a9bc6 100644 --- a/synapse/rest/client/v2_alpha/account.py +++ b/synapse/rest/client/v2_alpha/account.py
@@ -15,6 +15,7 @@ # See the License for the specific language governing permissions and # limitations under the License. import logging +import re from six.moves import http_client @@ -482,11 +483,10 @@ class ThreepidDeleteRestServlet(RestServlet): class ThreepidLookupRestServlet(RestServlet): - PATTERNS = client_v2_patterns("/account/3pid/lookup$") + PATTERNS = [re.compile("^/_matrix/client/unstable/account/3pid/lookup$")] def __init__(self, hs): super(ThreepidLookupRestServlet, self).__init__() - self.config = hs.config self.auth = hs.get_auth() self.identity_handler = hs.get_handlers().identity_handler @@ -514,11 +514,10 @@ class ThreepidLookupRestServlet(RestServlet): class ThreepidBulkLookupRestServlet(RestServlet): - PATTERNS = client_v2_patterns("/account/3pid/bulk_lookup$") + PATTERNS = [re.compile("^/_matrix/client/unstable/account/3pid/bulk_lookup$")] def __init__(self, hs): super(ThreepidBulkLookupRestServlet, self).__init__() - self.config = hs.config self.auth = hs.get_auth() self.identity_handler = hs.get_handlers().identity_handler diff --git a/tests/rest/client/test_identity.py b/tests/rest/client/test_identity.py
index 7edcfa8f67..b942f1ffe6 100644 --- a/tests/rest/client/test_identity.py +++ b/tests/rest/client/test_identity.py
@@ -26,6 +26,7 @@ from tests import unittest class IdentityDisabledTestCase(unittest.HomeserverTestCase): + """Tests that 3PID lookup attempts fail when the HS's config disallows them.""" servlets = [ account.register_servlets, @@ -104,6 +105,7 @@ class IdentityDisabledTestCase(unittest.HomeserverTestCase): class IdentityEnabledTestCase(unittest.HomeserverTestCase): + """Tests that 3PID lookup attempts succeed when the HS's config allows them.""" servlets = [ account.register_servlets,