Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Stabilise token authenticated registration support #2181

Merged
merged 2 commits into from
Apr 9, 2022

Conversation

govynnus
Copy link
Contributor

@govynnus govynnus commented Feb 16, 2022

Token authenticated registration was added to the Matrix specification in v1.2:
https://spec.matrix.org/v1.2/client-server-api/#token-authenticated-registration

Signed-off-by: Callum Brown [email protected]


Here's what your changelog entry will look like:

✨ Features

  • Stabilise token authenticated registration support (#2181). Contributed by @govynnus.

Token authenticated registration was added to the Matrix specification in v1.2:
https://spec.matrix.org/v1.2/client-server-api/#token-authenticated-registration

Signed-off-by: Callum Brown <[email protected]>
Copy link
Member

@turt2live turt2live left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for taking a look at this! Do you have a link to when servers have implemented the stable version so we can evaluate the risk of this change landing?

@govynnus
Copy link
Contributor Author

I believe Synapse is the only server implementing this, and there is a release candidate (1.53.0rc1) which uses the stable version:
https://github.com/matrix-org/synapse/blob/develop/CHANGES.md#synapse-1530rc1-2022-02-15

Ruma has also made the change, but I don't think it's released yet:
ruma/ruma@f631685

@turt2live
Copy link
Member

It looks a bit too early for us to drop backwards compatibility with the unstable version then. Our options are to continue supporting both types, or wait until 1.53 has received sufficient enough installs to be safe for us to transition (about 3 months).

@govynnus
Copy link
Contributor Author

Ok.
How would supporting both types work?

Also, Synapse 1.53.0.rc1 does not maintain backwards compatibility, so without support for the stable version the functionality will break for matrix-js-sdk users of updated servers.

@turt2live
Copy link
Member

The server doesn't need to maintain backwards compatibility in this case, but we as a client won't know what version of the server we're talking to so need to handle the case where legacy servers offer the unstable flows.

We've implicitly made the decision to support the unstable identifiers by implementing it, so need to maintain that until servers have upgraded enough where it's reasonable for us to remove the backwards compatibility ourselves.

Usually we avoid this problem entirely by not using enums (because they can't support stable and unstable at the same time), but given we don't really have a choice we end up with UnstableRegistrationToken and RegistrationToken, then annotate and document the differences between the flows.

@govynnus
Copy link
Contributor Author

Ok, thanks

Servers are not yet widely updated with support for the stable
version of the registration token UIA type.
Clients should check if the authentication type is either
`RegistrationToken` or `UnstableRegistrationToken`.

Signed-off-by: Callum Brown <[email protected]>
@govynnus
Copy link
Contributor Author

How does that look?

@turt2live turt2live self-requested a review February 18, 2022 18:47
@govynnus
Copy link
Contributor Author

@turt2live Hi, any chance you could have a look at this this week?

Copy link
Member

@turt2live turt2live left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks!

@turt2live turt2live merged commit 378802a into matrix-org:develop Apr 9, 2022
su-ex added a commit to SchildiChat/matrix-js-sdk that referenced this pull request Apr 30, 2022
* Add MatrixClient.doesServerSupportLogoutDevices() for MSC2457 ([\matrix-org#2297](matrix-org#2297)).
* Live location sharing - expose room liveBeaconIds ([\matrix-org#2296](matrix-org#2296)).
* Support for MSC2457 logout_devices param for setPassword() ([\matrix-org#2285](matrix-org#2285)).
* Stabilise token authenticated registration support ([\matrix-org#2181](matrix-org#2181)). Contributed by @govynnus.
* Live location sharing - Aggregate beacon locations on beacons ([\matrix-org#2268](matrix-org#2268)).
* Prevent duplicated re-emitter setups in event-mapper ([\matrix-org#2293](matrix-org#2293)).
* Make self membership less prone to races ([\matrix-org#2277](matrix-org#2277)). Fixes element-hq/element-web#21661.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants