Skip to content
This repository was archived by the owner on Apr 26, 2024. It is now read-only.

Commit 02632b3

Browse files
Stabilise MSC3231 (Token Based Registration) (#11867)
1 parent b3d155a commit 02632b3

File tree

8 files changed

+28
-9
lines changed

8 files changed

+28
-9
lines changed

changelog.d/11867.feature

+5
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
Stabilize [MSC3231](https://github.com/matrix-org/matrix-doc/pull/3231).
2+
3+
Client implementations using `m.login.registration_token` should switch to the stable identifiers:
4+
* `org.matrix.msc3231.login.registration_token` in query parameters and request/response bodies becomes `m.login.registration_token`.
5+
* `/_matrix/client/unstable/org.matrix.msc3231/register/org.matrix.msc3231.login.registration_token/validity` becomes `/_matrix/client/v1/register/m.login.registration_token/validity`.

docs/modules/password_auth_provider_callbacks.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -148,7 +148,7 @@ Here's an example featuring all currently supported keys:
148148
"address": "33123456789",
149149
"validated_at": 1642701357084,
150150
},
151-
"org.matrix.msc3231.login.registration_token": "sometoken", # User has registered through the flow described in MSC3231
151+
"m.login.registration_token": "sometoken", # User has registered through a registration token
152152
}
153153
```
154154

docs/upgrade.md

+15
Original file line numberDiff line numberDiff line change
@@ -84,6 +84,21 @@ process, for example:
8484
wget https://packages.matrix.org/debian/pool/main/m/matrix-synapse-py3/matrix-synapse-py3_1.3.0+stretch1_amd64.deb
8585
dpkg -i matrix-synapse-py3_1.3.0+stretch1_amd64.deb
8686
```
87+
# Upgrading to v1.(next)
88+
89+
## Stablisation of MSC3231
90+
91+
The unstable validity-check endpoint for the
92+
[Registration Tokens](https://spec.matrix.org/v1.2/client-server-api/#get_matrixclientv1registermloginregistration_tokenvalidity)
93+
feature has been stabilised and moved from:
94+
95+
`/_matrix/client/unstable/org.matrix.msc3231/register/org.matrix.msc3231.login.registration_token/validity`
96+
97+
to:
98+
99+
`/_matrix/client/v1/register/m.login.registration_token/validity`
100+
101+
Please update any relevant reverse proxy or firewall configurations appropriately.
87102

88103
# Upgrading to v1.53.0
89104

docs/workers.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -241,7 +241,7 @@ expressions:
241241
# Registration/login requests
242242
^/_matrix/client/(api/v1|r0|v3|unstable)/login$
243243
^/_matrix/client/(r0|v3|unstable)/register$
244-
^/_matrix/client/unstable/org.matrix.msc3231/register/org.matrix.msc3231.login.registration_token/validity$
244+
^/_matrix/client/v1/register/m.login.registration_token/validity$
245245

246246
# Event sending requests
247247
^/_matrix/client/(api/v1|r0|v3|unstable)/rooms/.*/redact

synapse/api/constants.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -81,7 +81,7 @@ class LoginType:
8181
TERMS: Final = "m.login.terms"
8282
SSO: Final = "m.login.sso"
8383
DUMMY: Final = "m.login.dummy"
84-
REGISTRATION_TOKEN: Final = "org.matrix.msc3231.login.registration_token"
84+
REGISTRATION_TOKEN: Final = "m.login.registration_token"
8585

8686

8787
# This is used in the `type` parameter for /register when called by

synapse/handlers/ui_auth/__init__.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -38,4 +38,4 @@ class UIAuthSessionDataConstants:
3838
# used during registration to store the registration token used (if required) so that:
3939
# - we can prevent a token being used twice by one session
4040
# - we can 'use up' the token after registration has successfully completed
41-
REGISTRATION_TOKEN = "org.matrix.msc3231.login.registration_token"
41+
REGISTRATION_TOKEN = "m.login.registration_token"

synapse/rest/client/register.py

+3-4
Original file line numberDiff line numberDiff line change
@@ -368,7 +368,7 @@ class RegistrationTokenValidityRestServlet(RestServlet):
368368
369369
Example:
370370
371-
GET /_matrix/client/unstable/org.matrix.msc3231/register/org.matrix.msc3231.login.registration_token/validity?token=abcd
371+
GET /_matrix/client/v1/register/m.login.registration_token/validity?token=abcd
372372
373373
200 OK
374374
@@ -378,9 +378,8 @@ class RegistrationTokenValidityRestServlet(RestServlet):
378378
"""
379379

380380
PATTERNS = client_patterns(
381-
f"/org.matrix.msc3231/register/{LoginType.REGISTRATION_TOKEN}/validity",
382-
releases=(),
383-
unstable=True,
381+
f"/register/{LoginType.REGISTRATION_TOKEN}/validity",
382+
releases=("v1",),
384383
)
385384

386385
def __init__(self, hs: "HomeServer"):

tests/rest/client/test_register.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -1154,7 +1154,7 @@ def test_background_job(self):
11541154

11551155
class RegistrationTokenValidityRestServletTestCase(unittest.HomeserverTestCase):
11561156
servlets = [register.register_servlets]
1157-
url = "/_matrix/client/unstable/org.matrix.msc3231/register/org.matrix.msc3231.login.registration_token/validity"
1157+
url = "/_matrix/client/v1/register/m.login.registration_token/validity"
11581158

11591159
def default_config(self):
11601160
config = super().default_config()

0 commit comments

Comments
 (0)