Skip to content

Commit 037ebbf

Browse files
committed
Be even clearer about the authority part
1 parent 9dd0854 commit 037ebbf

File tree

1 file changed

+43
-42
lines changed

1 file changed

+43
-42
lines changed

proposals/2312-matrix-uri.md

Lines changed: 43 additions & 42 deletions
Original file line numberDiff line numberDiff line change
@@ -195,21 +195,23 @@ hyperlinks to Matrix URIs.
195195

196196
#### Authority
197197

198-
The authority part will eventually be used to indicate access to a Matrix
199-
resource (such as a room or a user) specifically through a given server,
200-
addressing a case described in
201-
[matrix-org/matrix-doc#2309](https://github.com/matrix-org/matrix-doc/issues/2309).
198+
Basing on
199+
[the definition in RFC 3986](https://tools.ietf.org/html/rfc3986#section-3.2),
200+
this MSC restricts the authority part to never have a userinfo component,
201+
partially to prevent confusion concerned with the `@` character that has its
202+
own meaning in Matrix, but also because this component has historically been
203+
a popular target of abuse.
202204
```text
203205
authority = host [ ":" port ]
204206
```
207+
Further definition of syntax or semantics for the authority part is left for
208+
future MSCs. Clients MUST parse the authority part as per RFC 3986 (i.e.
209+
the presence of an authority part MUST NOT break URI parsing) but SHOULD NOT
210+
use data from the authority part other than for experiments or research.
205211

206-
Here's an example of a Matrix URI with an authority part
207-
(the authority part is `example.org:682` here):
208-
`matrix://example.org:682/roomid/Internal_Room_Id:example2.org`.
209-
210-
The authority part, as defined above, is reserved for future MSCs.
211-
Clients SHOULD NOT use data from the authority part other than for
212-
experimental or further research purposes.
212+
The authority part may eventually be used to indicate access to a Matrix
213+
resource (such as a room or a user) specifically through a given entity.
214+
See "Ideas for further evolution".
213215

214216
#### Path
215217
This MSC restricts
@@ -330,12 +332,12 @@ means performing an action on a URI with no `action` in the query.
330332
The routing query (`via=`) indicates servers that are likely involved in
331333
the room (see also
332334
[the feature of matrix.to](https://matrix.org/docs/spec/appendices#routing)).
333-
It is proposed to use the routing query to be used not only for resolving
335+
In the meantime, it is proposed that this routing query be used not only with
334336
room ids in a public federation but also when a URI refers to a resource in
335337
a non-public Matrix network (see the question about closed federations in
336338
"Discussion points and tradeoffs"). Note that `authority` in the definition
337-
above is only a part of the grammar as defined in the respective section;
338-
it is not proposed here to generate or read the authority part of the URI.
339+
above is only a part of the _query parameter_ grammar; it is not proposed here
340+
to generate or interpret the _authority part_ of the URI.
339341

340342
Clients MAY introduce and recognise custom query items, according to
341343
the following rules:
@@ -352,7 +354,7 @@ the following rules:
352354
action should be respected as much as possible. Client authors SHOULD strive
353355
for consistent experience across their and 3rd party clients, anticipating
354356
that the same user may happen to have both their client and a 3rd party one.
355-
357+
356358
Client authors are strongly encouraged to standardise custom query elements
357359
that gain adoption by submitting an MSC defining them in a way compatible
358360
across the client ecosystem.
@@ -497,33 +499,33 @@ extensions. Here are a few ideas:
497499
* Bring tangible semantics to the authority part. The main purpose of
498500
the authority part,
499501
[as per RFC 3986](https://tools.ietf.org/html/rfc3986#section-3.2),
500-
is to identify the authority governing the namespace for the rest
501-
of the URI. This MSC restates the RFC definitions for
502-
[`host`](https://tools.ietf.org/html/rfc3986#section-3.2.2) and
503-
[`port`](https://tools.ietf.org/html/rfc3986#section-3.2.3) but
504-
doesn't go further, calling for a separate MSC that would define semantics of
505-
the `host:port` pair. RFC 3986 also includes provisions for user
506-
information but this MSC explicitly excludes them from the authority grammar,
507-
on the grounds that user information has historically been a vector of
508-
widespread abuse. If providing a user identity via the authority part is
509-
found to be of value (with alleviated security concerns) in some case,
510-
a separate MSC should both re-add it to the grammar of the authority part
511-
and define how to construct, parse, and use it.
502+
is to identify the entity governing the namespace for the rest of the URI.
503+
The current MSC rules out the userinfo component but leaves it to a separate
504+
MSC to define semantics of the remaining`host[:port]` piece.
512505

513506
Importantly, future MSCs are advised against using the authority part for
514507
_routing over federation_ (the case for `via=` query items), as it would be
515508
against the spirit of RFC 3986. The authority part can be used in cases when
516509
a given Matrix entity is only available from certain servers (the case of
517-
closed federations or non-federating servers). A request to the server
518-
resolved from the authority part means that the client should be, as the name
519-
implies, _authorised_ by the authority server to access the requested
520-
resource. That, in turn, implies that the resource is either available
521-
to guests on the authority server, or the end user must be authenticated
522-
(and their access rights checked) by (or on behalf of) _that server_ in order
523-
to access the resource. While being a part of the original proposal,
510+
closed federations or non-federating servers).
511+
512+
While being a part of the original proposal in an attempt to address
513+
[the respective case](https://github.com/matrix-org/matrix-doc/issues/2309),
524514
the definition of the authority semantics has been dropped as a result of
525-
[the discussion](https://github.com/matrix-org/matrix-doc/pull/2312#discussion_r348960282)
526-
(also referred to in the previous section).
515+
[the subsequent discussion](https://github.com/matrix-org/matrix-doc/pull/2312#discussion_r348960282).
516+
A further MSC may approach the same case (and/or others) and define the
517+
meaning of the authority part (either on the client- or even on
518+
the server-side - provided that using Matrix URIs on the server-side brings
519+
some other value along the way). This might not necessarily be actual DNS
520+
hostnames even - one (quite far-fetched for now) idea to entertain might be
521+
introducing some decentralised system of "network names" in order to equalise
522+
"public" and "non-public" federations.
523+
524+
Along the same lines, if providing any part of user credentials via
525+
the authority part is found to be of considerable value in some case,
526+
a separate MSC could both reinstate it in the grammar and define how
527+
to construct, parse, and use it - provided that the same MSC addresses
528+
the security concerns associated with such URIs.
527529

528530
* One could conceive a URI mapping of avatars in the form of
529531
`matrix:u/uid:matrix.org/avatar/room:matrix.org`
@@ -583,10 +585,9 @@ further discussion should happen in GitHub comments.
583585
they know the URI is not going to be used outside this federation.
584586
Clients can facilitate that by having an option to always add or omit
585587
the authority part in generated URIs for a given user account.~~
586-
Use `via=` in order to point to a homeserver in the closed federation.
587-
The authority part may eventually be used for that but further discussion
588-
is needed on how clients should support it without compromising privacy
589-
(see [the discussion on the issue](https://github.com/matrix-org/matrix-doc/pull/2312#discussion_r348960282)).
588+
As of now, use `via=` in order to point to a homeserver in the closed
589+
federation. The authority part may eventually be used for that (or for some
590+
other case - see the previous section).
590591

591592

592593
### Alternatives
@@ -737,8 +738,8 @@ is taken to not make essential parts of the URI omittable to avoid
737738
even accidental misrepresentation of a local resource for a remote one
738739
in Matrix and vice versa.
739740

740-
The MSC intentionally doesn't support conveying any kind of user
741-
information in URIs.
741+
As mentioned in the authority part section, the MSC intentionally doesn't
742+
support conveying any kind of user information in URIs.
742743

743744
The MSC strives to not be prescriptive in treating URIs except the `action`
744745
query parameter. Actions without user confirmation may lead to unintended

0 commit comments

Comments
 (0)