Codebase list matrix-synapse / 9ae4594
New upstream version 1.15.1 Andrej Shadura 3 years ago
7 changed file(s) with 81 addition(s) and 9 deletion(s). Raw diff Collapse all Expand all
0 Synapse 1.15.1 (2020-06-16)
1 ===========================
2
3 Bugfixes
4 --------
5
6 - Fix a bug introduced in v1.15.0 that would crash Synapse on start when using certain password auth providers. ([\#7684](https://github.com/matrix-org/synapse/issues/7684))
7 - Fix a bug introduced in v1.15.0 which meant that some 3PID management endpoints were not accessible on the correct URL. ([\#7685](https://github.com/matrix-org/synapse/issues/7685))
8
9
010 Synapse 1.15.0 (2020-06-11)
111 ===========================
212
0 matrix-synapse-py3 (1.15.1) stable; urgency=medium
1
2 * New synapse release 1.15.1.
3
4 -- Synapse Packaging team <packages@matrix.org> Tue, 16 Jun 2020 10:27:50 +0100
5
06 matrix-synapse-py3 (1.15.0) stable; urgency=medium
17
28 * New synapse release 1.15.0.
3535 except ImportError:
3636 pass
3737
38 __version__ = "1.15.0"
38 __version__ = "1.15.1"
3939
4040 if bool(os.environ.get("SYNAPSE_TEST_PATCH_LOG_CONTEXTS", False)):
4141 # We import here so that we don't have to install a bunch of deps when
125125 'errcode' property for more information on the reason for failure
126126
127127 Returns:
128 Deferred[str]: user_id
128 defer.Deferred[str]: user_id
129129 """
130130 return defer.ensureDeferred(
131131 self._hs.get_registration_handler().register_user(
148148 Returns:
149149 defer.Deferred[tuple[str, str]]: Tuple of device ID and access token
150150 """
151 return self._hs.get_registration_handler().register_device(
152 user_id=user_id,
153 device_id=device_id,
154 initial_display_name=initial_display_name,
151 return defer.ensureDeferred(
152 self._hs.get_registration_handler().register_device(
153 user_id=user_id,
154 device_id=device_id,
155 initial_display_name=initial_display_name,
156 )
155157 )
156158
157159 def record_user_external_id(
681681
682682
683683 class ThreepidAddRestServlet(RestServlet):
684 PATTERNS = client_patterns("/account/3pid/add$", releases=(), unstable=True)
684 PATTERNS = client_patterns("/account/3pid/add$")
685685
686686 def __init__(self, hs):
687687 super(ThreepidAddRestServlet, self).__init__()
732732
733733
734734 class ThreepidBindRestServlet(RestServlet):
735 PATTERNS = client_patterns("/account/3pid/bind$", releases=(), unstable=True)
735 PATTERNS = client_patterns("/account/3pid/bind$")
736736
737737 def __init__(self, hs):
738738 super(ThreepidBindRestServlet, self).__init__()
761761
762762
763763 class ThreepidUnbindRestServlet(RestServlet):
764 PATTERNS = client_patterns("/account/3pid/unbind$", releases=(), unstable=True)
764 PATTERNS = client_patterns("/account/3pid/unbind$")
765765
766766 def __init__(self, hs):
767767 super(ThreepidUnbindRestServlet, self).__init__()
0 # -*- coding: utf-8 -*-
1 # Copyright 2020 The Matrix.org Foundation C.I.C.
2 #
3 # Licensed under the Apache License, Version 2.0 (the "License");
4 # you may not use this file except in compliance with the License.
5 # You may obtain a copy of the License at
6 #
7 # http://www.apache.org/licenses/LICENSE-2.0
8 #
9 # Unless required by applicable law or agreed to in writing, software
10 # distributed under the License is distributed on an "AS IS" BASIS,
11 # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12 # See the License for the specific language governing permissions and
13 # limitations under the License.
14
15 from synapse.module_api import ModuleApi
16
17 from tests.unittest import HomeserverTestCase
18
19
20 class ModuleApiTestCase(HomeserverTestCase):
21 def prepare(self, reactor, clock, homeserver):
22 self.store = homeserver.get_datastore()
23 self.module_api = ModuleApi(homeserver, homeserver.get_auth_handler())
24
25 def test_can_register_user(self):
26 """Tests that an external module can register a user"""
27 # Register a new user
28 user_id, access_token = self.get_success(
29 self.module_api.register(
30 "bob", displayname="Bobberino", emails=["bob@bobinator.bob"]
31 )
32 )
33
34 # Check that the new user exists with all provided attributes
35 self.assertEqual(user_id, "@bob:test")
36 self.assertTrue(access_token)
37 self.assertTrue(self.store.get_user_by_id(user_id))
38
39 # Check that the email was assigned
40 emails = self.get_success(self.store.user_get_threepids(user_id))
41 self.assertEqual(len(emails), 1)
42
43 email = emails[0]
44 self.assertEqual(email["medium"], "email")
45 self.assertEqual(email["address"], "bob@bobinator.bob")
46
47 # Should these be 0?
48 self.assertEqual(email["validated_at"], 0)
49 self.assertEqual(email["added_at"], 0)
50
51 # Check that the displayname was assigned
52 displayname = self.get_success(self.store.get_profile_displayname("bob"))
53 self.assertEqual(displayname, "Bobberino")