@@ -87,6 +87,16 @@ Sending vs receiving document data encapsulation
8787 A : Session attestation token. Only available for incoming data
8888 created by other sessions (optional).
8989
90+ Error returns
91+
92+ Calls providing an Iid which fail will receive an Error document with the
93+ following format:
94+
95+ {
96+ "Type": "Error",
97+ "Code": "value_identifying_error",
98+ "Message": "A description of the error condition"
99+ }
90100
91101Special purpose documents for channling
92102
@@ -147,18 +157,115 @@ Special purpose documents for channling
147157 Hello: {
148158 Version: "1.0.0",
149159 Ua: "Test client 1.0",
150- Id: ""
160+ Id: "",
161+ "Credentials": {...}
151162 }
152163 }
153164
154- Hello document is to be send by the client after connection was
155- established.
165+ Hello document is to be send by the client after connection was established.
166+ If an Iid is provided, a Welcome document will be returned if joining the
167+ room with the given Id succeeds. Otherwise an Error document with one of the
168+ error codes listed below will be returned. Note that any previous room will
169+ have been left regardless of whether the response is successful.
156170
157171 Keys under Hello:
158172
159- Version : Channel protocol version (string).
160- Ua : User agent description (string).
161- Id : Room id. The default Room has the empty string Id ("") (string).
173+ Version : Channel protocol version (string).
174+ Ua : User agent description (string).
175+ Id : Room id. The default Room has the empty string Id ("") (string).
176+ Credentials : An optional RoomCredentials document containing room
177+ authentication information. See the Room document for
178+ information on how such credentials should be handled after
179+ a Welcome is received for the requested room. Note that
180+ providing credentials while joining an existing room which
181+ does not require them is an error, such requests should be
182+ retried without credentials. In contrast, joining a
183+ non-existent room with credentials will create the room
184+ using the given credentials. Note that an error with a code
185+ of authorization_not_required or invalid_credentials shall
186+ cause the client to discard any cached room credentials.
187+
188+ Error codes:
189+
190+ default_room_disabled : Joining the room "" is not allowed by this
191+ server.
192+ authorization_required : Joining the given room requires credentials.
193+ authorization_not_required : No credentials should be provided for this
194+ room.
195+ invalid_credentials : The provided credentials are incorrect.
196+ room_join_requires_account : Server configuration requires an
197+ authenticated user account to join this room.
198+
199+ Welcome
200+
201+ {
202+ "Type": "Welcome",
203+ "Welcome": {
204+ "Room": {...},
205+ "Users": []
206+ }
207+ }
208+
209+ Welcome is sent in reply to a successful Hello, and contains all data
210+ needed to set up the initial room connection.
211+
212+ Keys under Welcome:
213+
214+ Room: Contains the current state of the room, see the description of
215+ the Room document for more details.
216+ Users: Contains the user list for the room, see the description of
217+ the Users document for more details.
218+
219+ RoomCredentials
220+
221+ {
222+ "PIN": "my-super-sekrit-code"
223+ }
224+
225+ RoomCredentials contains room authentication information, and is used as a
226+ child document when joining or updating a room.
227+
228+ Keys under RoomCredentials:
229+
230+ PIN : A password string which may be used by clients to authenticate
231+ themselves. Note that acceptable characters for this field may be
232+ constrained by the server based upon its configuration.
233+
234+ Room
235+
236+ {
237+ "Type": "Room",
238+ "Name": "room-name-here"
239+ "Credentials": {...}
240+ }
241+
242+ Clients may send a Room document in order to update all room properties
243+ to the values given in the document. The room name must be given and match
244+ the currently joined room. Successful updates will receive an updated Room
245+ document as a reply, or an Error document if the update fails.
246+
247+ Addtionally, the Room document is included in responses to initial joins
248+ and broadcast when room properties are updated.
249+
250+ Keys under Room:
251+
252+ Name : The human readable ID of the room, currently must be globally
253+ unique.
254+ Credentials : Optional authentication information for the room, see the
255+ documentation of the RoomCredentials document for more
256+ details. This field shall only be present when sending or
257+ receiving an update which alters room authentication data.
258+ It should only be inferred that authentication is not
259+ required if joining a room succeeds without credentials and
260+ no updates containing credentials has been received.
261+ Authentication may be disabled by sending a Room document
262+ containing a RoomCredentials document with only empty
263+ fields. Clients shall discard any cached authentication
264+ information upon receiving such an update.
265+
266+ Error codes:
267+
268+ not_in_room : Clients may only update rooms which they have joined.
162269
163270Peer connection documents
164271
0 commit comments