New upstream version 1.15.1
Andrej Shadura
3 years ago
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 | ||
0 | 10 | Synapse 1.15.0 (2020-06-11) |
1 | 11 | =========================== |
2 | 12 |
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 | ||
0 | 6 | matrix-synapse-py3 (1.15.0) stable; urgency=medium |
1 | 7 | |
2 | 8 | * New synapse release 1.15.0. |
35 | 35 | except ImportError: |
36 | 36 | pass |
37 | 37 | |
38 | __version__ = "1.15.0" | |
38 | __version__ = "1.15.1" | |
39 | 39 | |
40 | 40 | if bool(os.environ.get("SYNAPSE_TEST_PATCH_LOG_CONTEXTS", False)): |
41 | 41 | # We import here so that we don't have to install a bunch of deps when |
125 | 125 | 'errcode' property for more information on the reason for failure |
126 | 126 | |
127 | 127 | Returns: |
128 | Deferred[str]: user_id | |
128 | defer.Deferred[str]: user_id | |
129 | 129 | """ |
130 | 130 | return defer.ensureDeferred( |
131 | 131 | self._hs.get_registration_handler().register_user( |
148 | 148 | Returns: |
149 | 149 | defer.Deferred[tuple[str, str]]: Tuple of device ID and access token |
150 | 150 | """ |
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 | ) | |
155 | 157 | ) |
156 | 158 | |
157 | 159 | def record_user_external_id( |
681 | 681 | |
682 | 682 | |
683 | 683 | class ThreepidAddRestServlet(RestServlet): |
684 | PATTERNS = client_patterns("/account/3pid/add$", releases=(), unstable=True) | |
684 | PATTERNS = client_patterns("/account/3pid/add$") | |
685 | 685 | |
686 | 686 | def __init__(self, hs): |
687 | 687 | super(ThreepidAddRestServlet, self).__init__() |
732 | 732 | |
733 | 733 | |
734 | 734 | class ThreepidBindRestServlet(RestServlet): |
735 | PATTERNS = client_patterns("/account/3pid/bind$", releases=(), unstable=True) | |
735 | PATTERNS = client_patterns("/account/3pid/bind$") | |
736 | 736 | |
737 | 737 | def __init__(self, hs): |
738 | 738 | super(ThreepidBindRestServlet, self).__init__() |
761 | 761 | |
762 | 762 | |
763 | 763 | class ThreepidUnbindRestServlet(RestServlet): |
764 | PATTERNS = client_patterns("/account/3pid/unbind$", releases=(), unstable=True) | |
764 | PATTERNS = client_patterns("/account/3pid/unbind$") | |
765 | 765 | |
766 | 766 | def __init__(self, hs): |
767 | 767 | 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") |