|
| 1 | +# MSC4383: Client-Server Discovery of Server Version |
| 2 | + |
| 3 | +### Motivation |
| 4 | + |
| 5 | +Client applications utilizing the Matrix SDK[^6], a Client-Server[^7] library, have been observed |
| 6 | +making requests to `GET /_matrix/federation/v1/version`[^2]. It is the only known example of a |
| 7 | +cross-interface request to have any possible[^5] use to any implementation[^3], motivating this |
| 8 | +proposal to reestablish a properly clean partition between client and federation interfaces. |
| 9 | + |
| 10 | +Such cross-interface requests are problematic: the partition in the `/_matrix` URL hierarchy is |
| 11 | +understood by site-administrators to allow for distinct middleware configurations. Sites commonly |
| 12 | +employ WAF rules covering the client and federation hierarchies with source and destination |
| 13 | +assumptions. Some sites disable the entire federation portion, rendering the status quo as unreliable. |
| 14 | + |
| 15 | +This proposal reestablishes the partition between client-server and server-server by simply offering |
| 16 | +the same version data over both. With the adoption of this proposal, no need for cross-interface |
| 17 | +requests will be known to remain. |
| 18 | + |
| 19 | +### Proposal |
| 20 | + |
| 21 | +An object is added to the top-level of `GET /_matrix/client/versions`[^1] named `server` with |
| 22 | +parity to the eponymous object returned by `GET /_matrix/federation/v1/version`[^2]. |
| 23 | + |
| 24 | +Example of the `server` object: |
| 25 | + |
| 26 | +``` |
| 27 | + "server": { |
| 28 | + "name": "My_Homeserver_Implementation", |
| 29 | + "version": "ArbitraryVersionNumber" |
| 30 | + } |
| 31 | +``` |
| 32 | + |
| 33 | +Example of a full response: |
| 34 | +``` |
| 35 | +{ |
| 36 | + "server": { |
| 37 | + "name": "My_Homeserver_Implementation", |
| 38 | + "version": "ArbitraryVersionNumber" |
| 39 | + }, |
| 40 | + "unstable_features": { |
| 41 | + "org.example.my_feature": true |
| 42 | + }, |
| 43 | + "versions": [ |
| 44 | + "r0.0.1", |
| 45 | + "v1.1" |
| 46 | + ] |
| 47 | +} |
| 48 | +``` |
| 49 | + |
| 50 | +##### Unstable prefix |
| 51 | + |
| 52 | +| Stable identifier | Purpose | Unstable identifier | |
| 53 | +| --- | --- | ---| |
| 54 | +| `server` | Server information | `net.zemos.msc4383.server` | |
| 55 | + |
| 56 | +### Alternatives |
| 57 | + |
| 58 | +MSC2301[^4] enriches the discovery information, including some identifying information about the |
| 59 | +server, though specific formal vendor and semantic version information appears avoided |
| 60 | +(see: potential issues). |
| 61 | + |
| 62 | +### Potential Issues |
| 63 | + |
| 64 | +Server vendor and version information has been considered counter-productive to the motivations |
| 65 | +of Matrix as a unifying communication standard. Matrix believes any use of implementation |
| 66 | +knowledge as a condition in its applications always represents an accidental failure of its |
| 67 | +implementations or the standard binding them; the solution to such problems is thus found in |
| 68 | +cooperation, community and conformity, precluding the need for bug-for-bug conditions and |
| 69 | +workarounds. This MSC has the option of including a normative statement which inhibits the use |
| 70 | +of vendor information to determine functionality. |
| 71 | + |
| 72 | +### Security Concerns |
| 73 | + |
| 74 | +The federation endpoint is the only location which presently reveals this information. |
| 75 | +Site-administrators which have taken some measure to hide, or obscure, or modify it (i.e. with a |
| 76 | +proxy) will have to note their implementation's new exposure of it when upgrading. |
| 77 | + |
| 78 | + |
| 79 | +[^1]: https://spec.matrix.org/v1.16/client-server-api/#api-versions |
| 80 | + |
| 81 | +[^2]: https://spec.matrix.org/v1.16/server-server-api/#server-implementation |
| 82 | + |
| 83 | +[^3]: https://github.com/matrix-org/matrix-rust-sdk/blob/d228bde8ef51a98da10a6b7d4b9f3e5b8f49ad3c/crates/matrix-sdk/src/client/mod.rs#L581-L616 |
| 84 | + |
| 85 | +[^4]: https://github.com/matrix-org/matrix-spec-proposals/pull/2301 |
| 86 | + |
| 87 | +[^5]: Server version information can provide useful context in logs and may be essential for |
| 88 | +effective crash reports. |
| 89 | + |
| 90 | +[^6]: https://github.com/matrix-org/matrix-rust-sdk |
| 91 | + |
| 92 | +[^7]: https://spec.matrix.org/v1.16/client-server-api/ |
0 commit comments