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

Stabilise MSC3231 (Token Based Registration) #11867

Merged
merged 8 commits into from
Feb 4, 2022
Merged
Show file tree
Hide file tree
Changes from 4 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions changelog.d/11867.feature
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Stabilize MSC3231.
ShadowJonathan marked this conversation as resolved.
Show resolved Hide resolved
ShadowJonathan marked this conversation as resolved.
Show resolved Hide resolved
2 changes: 1 addition & 1 deletion docs/modules/password_auth_provider_callbacks.md
Original file line number Diff line number Diff line change
Expand Up @@ -148,7 +148,7 @@ Here's an example featuring all currently supported keys:
"address": "33123456789",
"validated_at": 1642701357084,
},
"org.matrix.msc3231.login.registration_token": "sometoken", # User has registered through the flow described in MSC3231
"m.login.registration_token": "sometoken", # User has registered through registration tokens
ShadowJonathan marked this conversation as resolved.
Show resolved Hide resolved
}
```

Expand Down
2 changes: 1 addition & 1 deletion docs/workers.md
Original file line number Diff line number Diff line change
Expand Up @@ -241,7 +241,7 @@ expressions:
# Registration/login requests
^/_matrix/client/(api/v1|r0|v3|unstable)/login$
^/_matrix/client/(r0|v3|unstable)/register$
^/_matrix/client/unstable/org.matrix.msc3231/register/org.matrix.msc3231.login.registration_token/validity$
^/_matrix/client/v1/register/m.login.registration_token/validity$

# Event sending requests
^/_matrix/client/(api/v1|r0|v3|unstable)/rooms/.*/redact
Expand Down
2 changes: 1 addition & 1 deletion synapse/api/constants.py
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,7 @@ class LoginType:
TERMS: Final = "m.login.terms"
SSO: Final = "m.login.sso"
DUMMY: Final = "m.login.dummy"
REGISTRATION_TOKEN: Final = "org.matrix.msc3231.login.registration_token"
REGISTRATION_TOKEN: Final = "m.login.registration_token"


# This is used in the `type` parameter for /register when called by
Expand Down
2 changes: 1 addition & 1 deletion synapse/handlers/ui_auth/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -38,4 +38,4 @@ class UIAuthSessionDataConstants:
# used during registration to store the registration token used (if required) so that:
# - we can prevent a token being used twice by one session
# - we can 'use up' the token after registration has successfully completed
REGISTRATION_TOKEN = "org.matrix.msc3231.login.registration_token"
REGISTRATION_TOKEN = "m.login.registration_token"
ShadowJonathan marked this conversation as resolved.
Show resolved Hide resolved
7 changes: 3 additions & 4 deletions synapse/rest/client/register.py
Original file line number Diff line number Diff line change
Expand Up @@ -368,7 +368,7 @@ class RegistrationTokenValidityRestServlet(RestServlet):

Example:

GET /_matrix/client/unstable/org.matrix.msc3231/register/org.matrix.msc3231.login.registration_token/validity?token=abcd
GET /_matrix/client/v1/register/m.login.registration_token/validity?token=abcd

200 OK

Expand All @@ -378,9 +378,8 @@ class RegistrationTokenValidityRestServlet(RestServlet):
"""

PATTERNS = client_patterns(
f"/org.matrix.msc3231/register/{LoginType.REGISTRATION_TOKEN}/validity",
releases=(),
unstable=True,
f"/register/{LoginType.REGISTRATION_TOKEN}/validity",
releases=("v1",),
)

def __init__(self, hs: "HomeServer"):
Expand Down
2 changes: 1 addition & 1 deletion tests/rest/client/test_register.py
Original file line number Diff line number Diff line change
Expand Up @@ -1154,7 +1154,7 @@ def test_background_job(self):

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

def default_config(self):
config = super().default_config()
Expand Down