|
| 1 | +# MSC4189: Allowing guests to access uploaded media |
| 2 | + |
| 3 | +[MSC3916](https://github.com/matrix-org/matrix-spec-proposals/blob/main/proposals/3916-authentication-for-media.md) |
| 4 | +introduced new endpoints which require clients to provide a valid access token in order to access |
| 5 | +media. The MSC failed to specify [guest access](https://spec.matrix.org/v1.11/client-server-api/#guest-access) |
| 6 | +requirements for the new endpoints. |
| 7 | + |
| 8 | +This MSC specifies the missing guest access requirements on the new endpoints. |
| 9 | + |
| 10 | +## Proposal |
| 11 | + |
| 12 | +The following endpoints explicitly permit guest access, joining the |
| 13 | +[list of other endpoints](https://spec.matrix.org/v1.11/client-server-api/#client-behaviour-13) |
| 14 | +already in the specification: |
| 15 | + |
| 16 | +* [`GET /_matrix/client/v1/media/download/{serverName}/{mediaId}`](https://spec.matrix.org/v1.11/client-server-api/#get_matrixclientv1mediadownloadservernamemediaid) |
| 17 | +* [`GET /_matrix/client/v1/media/download/{serverName}/{mediaId}/{fileName}`](https://spec.matrix.org/v1.11/client-server-api/#get_matrixclientv1mediadownloadservernamemediaidfilename) |
| 18 | +* [`GET /_matrix/client/v1/media/thumbnail/{serverName}/{mediaId}`](https://spec.matrix.org/v1.11/client-server-api/#get_matrixclientv1mediathumbnailservernamemediaid) |
| 19 | + |
| 20 | +The rationale for the above endpoints is that being able to see events without the associated media |
| 21 | +isn't very useful. |
| 22 | + |
| 23 | +For clarity, the following endpoints are *not* added to the guest access list, as their prior (now |
| 24 | +deprecated) versions are not already included. A future MSC may change this with sufficient rationale. |
| 25 | +Note that guests cannot currently *upload* files, but can send messages/events. |
| 26 | + |
| 27 | +* [`GET /_matrix/client/v1/media/config`](https://spec.matrix.org/v1.11/client-server-api/#get_matrixclientv1mediaconfig) |
| 28 | +* [`GET /_matrix/client/v1/media/preview_url`](https://spec.matrix.org/v1.11/client-server-api/#get_matrixclientv1mediapreview_url) |
| 29 | + |
| 30 | +## Potential issues |
| 31 | + |
| 32 | +This MSC fixes an issue where guests cannot download images/files. |
| 33 | + |
| 34 | +## Alternatives |
| 35 | + |
| 36 | +None applicable. |
| 37 | + |
| 38 | +## Security considerations |
| 39 | + |
| 40 | +This MSC does not materially increase the threat profile for guests: guests could already download |
| 41 | +media using the unauthenticated endpoints. |
| 42 | + |
| 43 | +## Unstable prefix |
| 44 | + |
| 45 | +Prefixed endpoints are excessive for this MSC. Implementations can enable guest access on the existing |
| 46 | +endpoints safely, or continue to respond with "guest access forbidden" errors. No `/versions` flag |
| 47 | +is specified for feature detection: clients with guest access tokens should expect failure until a |
| 48 | +server advertises a specification version containing this MSC. Clients should continue trying to make |
| 49 | +requests for the best user experience. |
| 50 | + |
| 51 | +## Dependencies |
| 52 | + |
| 53 | +This MSC has no dependencies. |
0 commit comments