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

MSC3074: Proposal for URIs conforming to RFC 3986 syntax. #3074

Closed
wants to merge 1 commit into from

Conversation

alexmingoia
Copy link

@alexmingoia alexmingoia commented Mar 25, 2021

MSC 3074: Change Matrix URIs to conform to standard RFC 3986 syntax

I propose changing Matrix URLs to conform to standard URI syntax described in RFC 3986.

The Problem

Currently, Matrix URI syntax places resource information before the authority (host), in violation of the syntax described by RFC 3986 Section 3: Syntax. Because of this, URI parsing modules for all major languages do not work for Matrix URIs. For example, parsing the host using nodejs require('url').parse('matrix://r/roomAlias:matrix.org') does not work.

The Solution

Change the Matrix URI syntax to conform to RFC 3986 Syntax:

RFC 3986 URI Syntax:

scheme:[//authority]path[?query][#fragment] where authority = [userinfo@]host[:port]

Example of Matrix URIs using RFC 3986 Syntax:

User URLs: @user:matrix.org -> user@matrix.org
Room Alias URLs: #roomAlias:matrix.org -> matrix.org/rooms/roomAlias
Room ID URLs: !roomId:matrix.org -> matrix.org/rooms?id=roomId
Event URLs: $eventId:matrix.org -> matrix.org/events/eventId
Group URLs: +groupId:matrix.org -> matrix.org/groups/groupId

Benefits

  • Improved library support: All major languages have URI parsers that conform to RFC 3986, so using standard URI syntax alleviates the need for custom Matrix URI parsing code. For example, parsing the host would no longer require code customized for Matrix URIs.
  • Improved interoperability: Developers and applications expect URIs to conform to the standard syntax. For example, many applications display only the host of a URL in certain contexts, which would work out-of-the-box for URIs conforming to the standard.
  • Builds on Internet standards: The RFC 3986 syntax is widely deployed, followed by HTTP, Git, XMPP, etc. As Matrix seeks to be an Internet standard, it should follow other Internet standards where possible.

Common Objections

  1. Matrix URIs do conform to standard syntax, because there is no authority.

    Matrix URIs include authority (host) information for users and room aliases, which should come after the scheme in the standard. Currently, Matrix URIs put authority information after resource information.

  2. This would be a big change, as Matrix URIs are widespread in Matrix code.

    Yes, but the sooner this is done the less work it will be. All change in federated standards takes a lot of time and work. I don't think changes should be evaluated solely on this criteria.

Related MSCs

#2312 should be considered alongside this proposal

@alexmingoia alexmingoia changed the title Proposal for URIs conforming to RFC 3986 syntax. MSC3074: Proposal for URIs conforming to RFC 3986 syntax. Mar 25, 2021
@turt2live turt2live added kind:maintenance MSC which clarifies/updates existing spec proposal-in-review proposal A matrix spec change proposal labels Mar 25, 2021
@alexmingoia
Copy link
Author

I'm closing following the results of discussion in the Matrix URI scheme chat, and because there's another proposal covering Matrix URIs.

@turt2live turt2live added abandoned A proposal where the author/shepherd is not responsive and removed proposal-in-review labels Mar 25, 2021
@astrojuanlu
Copy link

and because there's another proposal covering Matrix URIs.

Which one?

@Cadair
Copy link
Contributor

Cadair commented Mar 29, 2021

#2312

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
abandoned A proposal where the author/shepherd is not responsive kind:maintenance MSC which clarifies/updates existing spec proposal A matrix spec change proposal
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants