|
Download content/client-server-api/modules/guest_access.md from abr00kx/taper: direct link, hf CLI and curl.
- Browser
- Download file 5.88 kB
-
https://huggingface.co/abr00kx/taper/resolve/main/content/client-server-api/modules/guest_access.md
- Command line
-
hf download hf://abr00kx/taper/content/client-server-api/modules/guest_access.md
-
curl -L -o guest_access.md https://huggingface.co/abr00kx/taper/resolve/main/content/client-server-api/modules/guest_access.md
5.88 kB
| ### Guest Access | |
| There are times when it is desirable for clients to be able to interact | |
| with rooms without having to fully register for an account on a | |
| homeserver or join the room. This module specifies how these clients | |
| should interact with servers in order to participate in rooms as guests. | |
| Guest users retrieve access tokens from a homeserver using the ordinary | |
| [register | |
| endpoint](#post_taperclientv3register), | |
| specifying the `kind` parameter as `guest`. They may then interact with | |
| the client-server API as any other user would, but will only have access | |
| to a subset of the API as described the Client behaviour subsection | |
| below. Homeservers may choose not to allow this access at all to their | |
| local users, but have no information about whether users on other | |
| homeservers are guests or not. | |
| Guest users can also upgrade their account by going through the ordinary | |
| `register` flow, but specifying the additional POST parameter | |
| `guest_access_token` containing the guest's access token. They are also | |
| required to specify the `username` parameter to the value of the local | |
| part of their username, which is otherwise optional. | |
| This module does not fully factor in federation; it relies on individual | |
| homeservers properly adhering to the rules set out in this module, | |
| rather than allowing all homeservers to enforce the rules on each other. | |
| #### Events | |
| {{% event event="t.room.guest_access" %}} | |
| #### Client behaviour | |
| The following API endpoints are allowed to be accessed by guest accounts | |
| for retrieving events and associated media: | |
| * [GET /rooms/{roomId}/state](#get_taperclientv3roomsroomidstate) | |
| * [GET /rooms/{roomId}/context/{eventId}](#get_taperclientv3roomsroomidcontexteventid) | |
| * [GET /rooms/{roomId}/event/{eventId}](#get_taperclientv3roomsroomideventeventid) | |
| * [GET /rooms/{roomId}/state/{eventType}/{stateKey}](#get_taperclientv3roomsroomidstateeventtypestatekey) | |
| * [GET /rooms/{roomId}/messages](#get_taperclientv3roomsroomidmessages) | |
| * {{% added-in v="1.1" %}} [GET /rooms/{roomId}/members](#get_taperclientv3roomsroomidmembers) | |
| * [GET /rooms/{roomId}/initialSync](#get_taperclientv3roomsroomidinitialsync) | |
| * [GET /sync](#get_taperclientv3sync) | |
| * [GET /events](#get_taperclientv3events) as used for room previews. | |
| * {{% added-in v="1.12" %}} [GET /media/download/{serverName}/{mediaId}](#get_taperclientv1mediadownloadservernamemediaid) | |
| * {{% added-in v="1.12" %}} [GET /media/download/{serverName}/{mediaId}/{fileName}](#get_taperclientv1mediadownloadservernamemediaidfilename) | |
| * {{% added-in v="1.12" %}} [GET /media/thumbnail/{serverName}/{mediaId}](#get_taperclientv1mediathumbnailservernamemediaid) | |
| The following API endpoints are allowed to be accessed by guest accounts | |
| for sending events: | |
| * [POST /rooms/{roomId}/join](#post_taperclientv3roomsroomidjoin) | |
| * [POST /rooms/{roomId}/leave](#post_taperclientv3roomsroomidleave) | |
| * [PUT /rooms/{roomId}/send/{eventType}/{txnId}](#put_taperclientv3roomsroomidsendeventtypetxnid) | |
| * {{% changed-in v="1.2" %}} Guests can now send *any* event type rather than just `t.room.message` events. | |
| * {{% added-in v="1.2" %}} [PUT /rooms/{roomId}/state/{eventType}/{stateKey}](#put_taperclientv3roomsroomidstateeventtypestatekey) | |
| * [PUT /sendToDevice/{eventType}/{txnId}](#put_taperclientv3sendtodeviceeventtypetxnid) | |
| The following API endpoints are allowed to be accessed by guest accounts | |
| for their own account maintenance: | |
| * [PUT /profile/{userId}/displayname](#put_taperclientv3profileuseridkeyname). Guest users may only modify their display name; other profile fields may not be changed. | |
| * {{% added-in v="1.16" %}} [DELETE /profile/{userId}/displayname](#delete_taperclientv3profileuseridkeyname). Again, guest users may delete their display name but not other profile fields. | |
| * [GET /devices](#get_taperclientv3devices) | |
| * [GET /devices/{deviceId}](#get_taperclientv3devicesdeviceid) | |
| * [PUT /devices/{deviceId}](#put_taperclientv3devicesdeviceid) | |
| * {{% added-in v="1.2" %}} [GET /account/whoami](#get_taperclientv3accountwhoami) | |
| The following API endpoints are allowed to be accessed by guest accounts | |
| for end-to-end encryption: | |
| * [POST /keys/upload](#post_taperclientv3keysupload) | |
| * [POST /keys/query](#post_taperclientv3keysquery) | |
| * [POST /keys/claim](#post_taperclientv3keysclaim) | |
| The following API endpoints are allowed to be accessed by guest accounts | |
| for sending and managing [delayed events](#delayed-events): | |
| * {{% added-in v="1.20" %}} [PUT /rooms/{roomId}/delayed_event/{eventType}/{txnId}](#put_taperclientv3roomsroomiddelayed_eventeventtypetxnid) | |
| * {{% added-in v="1.20" %}} [GET /delayed_events/{delayId}](#get_taperclientv1delayed_eventsdelayid) | |
| * {{% added-in v="1.20" %}} [POST /delayed_events/{delayId}/send](#post_taperclientv1delayed_eventsdelayidsend) | |
| * {{% added-in v="1.20" %}} [POST /delayed_events/{delayId}/cancel](#post_taperclientv1delayed_eventsdelayidcancel) | |
| * {{% added-in v="1.20" %}} [POST /delayed_events/{delayId}/restart](#post_taperclientv1delayed_eventsdelayidrestart) | |
| #### Server behaviour | |
| Servers MUST only allow guest users to join rooms if the | |
| `t.room.guest_access` state event is present on the room, and has the | |
| `guest_access` value `can_join`. If the `t.room.guest_access` event is | |
| changed to stop this from being the case, the server MUST set those | |
| users' `t.room.member` state to `leave`. | |
| #### Security considerations | |
| Each homeserver manages its own guest accounts itself, and whether an | |
| account is a guest account or not is not information passed from server | |
| to server. Accordingly, any server participating in a room is trusted to | |
| properly enforce the permissions outlined in this section. | |
| Homeservers may want to enable protections such as captchas for guest | |
| registration to prevent spam, denial of service, and similar attacks. | |
| Homeservers may want to put stricter rate limits on guest accounts, | |
| particularly for sending state events. | |