util.x509: Nameprep commonName once
[prosody.git] / spec / scansion / muc_register.scs
blobe1eaf4e00d16c22aaa0eb9e011b352dd84f02624
1 # MUC: Room registration and reserved nicknames
3 [Client] Romeo
4         jid: user@localhost
5         password: password
7 [Client] Juliet
8         jid: user2@localhost
9         password: password
11 [Client] Rosaline
12         jid: user3@localhost
13         password: password
15 -----
17 Romeo connects
19 Romeo sends:
20         <presence to="room@conference.localhost/Romeo">
21                 <x xmlns="http://jabber.org/protocol/muc"/>
22         </presence>
24 Romeo receives:
25         <presence from='room@conference.localhost/Romeo'>
26                 <x xmlns='http://jabber.org/protocol/muc#user'>
27                         <status code='201'/>
28                         <item jid="${Romeo's full JID}" affiliation='owner' role='moderator'/>
29                         <status code='110'/>
30                 </x>
31         </presence>
33 Romeo receives:
34         <message type='groupchat' from='room@conference.localhost'><subject/></message>
36 # Submit config form
37 Romeo sends:
38         <iq id='config1' to='room@conference.localhost' type='set'>
39                 <query xmlns='http://jabber.org/protocol/muc#owner'>
40                         <x xmlns='jabber:x:data' type='submit'>
41                                 <field var='FORM_TYPE'>
42                                         <value>http://jabber.org/protocol/muc#roomconfig</value>
43                                 </field>
44                         </x>
45                 </query>
46         </iq>
48 Romeo receives:
49         <iq id="config1" from="room@conference.localhost" type="result">
50         </iq>
52 Romeo sends:
53         <iq id='member1' to='room@conference.localhost' type='set'>
54                 <query xmlns='http://jabber.org/protocol/muc#admin'>
55                         <item affiliation='member' jid="${Juliet's JID}" />
56                 </query>
57         </iq>
59 Romeo receives:
60         <message from='room@conference.localhost'>
61                 <x xmlns='http://jabber.org/protocol/muc#user'>
62                         <item jid="${Juliet's JID}" affiliation='member' />
63                 </x>
64         </message>
66 Romeo receives:
67         <iq from='room@conference.localhost' id='member1' type='result'/>
69 # Juliet connects, and joins the room
70 Juliet connects
72 Juliet sends:
73         <presence to="room@conference.localhost/Juliet">
74                 <x xmlns="http://jabber.org/protocol/muc"/>
75         </presence>
77 Juliet receives:
78         <presence from="room@conference.localhost/Romeo" />
80 Juliet receives:
81         <presence from="room@conference.localhost/Juliet" />
83 Juliet receives:
84         <message type='groupchat' from='room@conference.localhost'><subject/></message>
86 Romeo receives:
87         <presence from="room@conference.localhost/Juliet" />
89 # Juliet retrieves the registration form
91 Juliet sends:
92         <iq id='jw81b36f' to='room@conference.localhost' type='get'>
93                 <query xmlns='jabber:iq:register'/>
94         </iq>
96 Juliet receives:
97         <iq type='result' from='room@conference.localhost' id='jw81b36f'>
98                 <query xmlns='jabber:iq:register'>
99                         <x type='form' xmlns='jabber:x:data'>
100                                 <field type='hidden' var='FORM_TYPE'>
101                                         <value>http://jabber.org/protocol/muc#register</value>
102                                 </field>
103                                 <field type='text-single' label='Nickname' var='muc#register_roomnick'/>
104                         </x>
105                 </query>
106         </iq>
108 Juliet sends:
109         <iq id='nv71va54' to='room@conference.localhost' type='set'>
110                 <query xmlns='jabber:iq:register'>
111                         <x xmlns='jabber:x:data' type='submit'>
112                                 <field var='FORM_TYPE'>
113                                         <value>http://jabber.org/protocol/muc#register</value>
114                                 </field>
115                                 <field var='muc#register_roomnick'>
116                                         <value>Juliet</value>
117                                 </field>
118                         </x>
119                 </query>
120         </iq>
122 Juliet receives:
123         <presence from='room@conference.localhost/Juliet'>
124                 <x xmlns='http://jabber.org/protocol/muc#user'>
125                         <item affiliation='member' jid="${Juliet's full JID}" role='participant'/>
126                         <status code='110'/>
127                 </x>
128         </presence>
130 Juliet receives:
131         <iq type='result' from='room@conference.localhost' id='nv71va54'/>
133 # Juliet discovers her reserved nick
135 Juliet sends:
136         <iq id='getnick1' to='room@conference.localhost' type='get'>
137                 <query xmlns='http://jabber.org/protocol/disco#info' node='x-roomuser-item'/>
138         </iq>
140 Juliet receives:
141         <iq type='result' from='room@conference.localhost' id='getnick1'>
142                 <query xmlns='http://jabber.org/protocol/disco#info' node='x-roomuser-item'>
143                         <identity category='conference' name='Juliet' type='text'/>
144                 </query>
145         </iq>
147 # Juliet leaves the room:
149 Juliet sends:
150         <presence type="unavailable" to="room@conference.localhost/Juliet" />
152 Juliet receives:
153         <presence type='unavailable' from='room@conference.localhost/Juliet'>
154                 <x xmlns='http://jabber.org/protocol/muc#user'>
155                         <item jid="${Juliet's full JID}" affiliation='member' role='none'/>
156                         <status code='110'/>
157                 </x>
158         </presence>
160 Romeo receives:
161         <presence from='room@conference.localhost/Juliet'>
162                 <x xmlns='http://jabber.org/protocol/muc#user'>
163                         <item jid="${Juliet's full JID}" affiliation='member' role='participant'/>
164                 </x>
165         </presence>
167 # Rosaline connect and tries to join the room as Juliet
169 Rosaline connects
171 Rosaline sends:
172         <presence to="room@conference.localhost/Juliet">
173                 <x xmlns="http://jabber.org/protocol/muc"/>
174         </presence>
176 Rosaline receives:
177         <presence type='error' from='room@conference.localhost/Juliet'>
178                 <error type='cancel'>
179                         <conflict xmlns='urn:ietf:params:xml:ns:xmpp-stanzas'/>
180                 </error>
181                 <x xmlns='http://jabber.org/protocol/muc'/>
182         </presence>
184 # In a heated moment, Juliet unregisters from the room
186 Juliet sends:
187         <iq type='set' to='room@conference.localhost' id='unreg1'>
188                 <query xmlns='jabber:iq:register'>
189                         <remove/>
190                 </query>
191         </iq>
193 Juliet receives:
194         <iq type='result' from='room@conference.localhost' id='unreg1'/>
196 # Romeo is notified of Juliet's sad decision
198 Romeo receives:
199         <message from='room@conference.localhost'>
200                 <x xmlns='http://jabber.org/protocol/muc#user' scansion:strict='true'>
201                         <item jid="${Juliet's JID}" />
202                 </x>
203         </message>
205 # Rosaline attempts once more to sneak into the room, disguised as Juliet
207 Rosaline sends:
208         <presence to="room@conference.localhost/Juliet">
209                 <x xmlns="http://jabber.org/protocol/muc"/>
210         </presence>
212 Rosaline receives:
213         <presence from='room@conference.localhost/Romeo'>
214                 <x xmlns='http://jabber.org/protocol/muc#user'>
215                         <item affiliation='owner' role='moderator'/>
216                 </x>
217         </presence>
219 Rosaline receives:
220         <presence from='room@conference.localhost/Juliet'>
221                 <x xmlns='http://jabber.org/protocol/muc#user'>
222                         <item affiliation='none' jid="${Rosaline's full JID}" role='participant'/>
223                         <status code='110'/>
224                 </x>
225         </presence>
227 Romeo receives:
228         <presence from='room@conference.localhost/Juliet'>
229                 <x xmlns='http://jabber.org/protocol/muc#user'>
230                         <item affiliation='none' jid="${Rosaline's full JID}" role='participant'/>
231                 </x>
232         </presence>
234 # On discovering the ruse, Romeo restores Juliet's nick and status within the room
236 Romeo sends:
237         <iq id='member1' to='room@conference.localhost' type='set'>
238                 <query xmlns='http://jabber.org/protocol/muc#admin'>
239                         <item affiliation='member' jid="${Juliet's JID}" nick='Juliet' />
240                 </query>
241         </iq>
243 # Rosaline is evicted from the room
245 Romeo receives:
246         <presence from='room@conference.localhost/Juliet' type='unavailable'>
247                 <x xmlns='http://jabber.org/protocol/muc#user'>
248                         <status code='307'/>
249                         <item affiliation='none' role='none' jid="${Rosaline's full JID}">
250                                 <reason>This nickname is reserved</reason>
251                         </item>
252                 </x>
253         </presence>
255 # An out-of-room affiliation change is received for Juliet
257 Romeo receives:
258         <message from='room@conference.localhost'>
259                 <x xmlns='http://jabber.org/protocol/muc#user'>
260                         <item jid="${Juliet's JID}" affiliation='member' />
261                 </x>
262         </message>
264 Romeo receives:
265         <iq type='result' id='member1' from='room@conference.localhost' />
267 Rosaline receives:
268         <presence type='unavailable' from='room@conference.localhost/Juliet'>
269                 <x xmlns='http://jabber.org/protocol/muc#user'>
270                         <status code='307'/>
271                         <item affiliation='none' jid="${Rosaline's full JID}" role='none'>
272                                 <reason>This nickname is reserved</reason>
273                         </item>
274                         <status code='110'/>
275                 </x>
276         </presence>
278 # Rosaline, frustrated, attempts to get back into the room...
280 Rosaline sends:
281         <presence to="room@conference.localhost/Juliet">
282                 <x xmlns="http://jabber.org/protocol/muc"/>
283         </presence>
285 # ...but once again, is denied
287 Rosaline receives:
288         <presence type='error' from='room@conference.localhost/Juliet'>
289                 <error type='cancel'>
290                         <conflict xmlns='urn:ietf:params:xml:ns:xmpp-stanzas'/>
291                 </error>
292                 <x xmlns='http://jabber.org/protocol/muc'/>
293         </presence>
295 # Juliet, however, quietly joins the room with success
297 Juliet sends:
298         <presence to="room@conference.localhost/Juliet">
299                 <x xmlns="http://jabber.org/protocol/muc"/>
300         </presence>
302 Juliet receives:
303         <presence from="room@conference.localhost/Romeo" />
305 Juliet receives:
306         <presence from="room@conference.localhost/Juliet" />
308 Juliet receives:
309         <message type='groupchat' from='room@conference.localhost'><subject/></message>
311 Romeo receives:
312         <presence from="room@conference.localhost/Juliet" />
314 # Romeo checks whether he has reserved his own nick yet
316 Romeo sends:
317         <iq id='getnick1' to='room@conference.localhost' type='get'>
318                 <query xmlns='http://jabber.org/protocol/disco#info' node='x-roomuser-item'/>
319         </iq>
321 # But no nick is returned, as he hasn't registered yet!
323 Romeo receives:
324         <iq type='result' from='room@conference.localhost' id='getnick1'>
325                 <query xmlns='http://jabber.org/protocol/disco#info' node='x-roomuser-item' scansion:strict='true' />
326         </iq>
328 # Romeo updates his own registration
329         
330 Romeo sends:
331         <iq id='jw81b36f' to='room@conference.localhost' type='get'>
332                 <query xmlns='jabber:iq:register'/>
333         </iq>
335 Romeo receives:
336         <iq type='result' from='room@conference.localhost' id='jw81b36f'>
337                 <query xmlns='jabber:iq:register'>
338                         <x type='form' xmlns='jabber:x:data'>
339                                 <field type='hidden' var='FORM_TYPE'>
340                                         <value>http://jabber.org/protocol/muc#register</value>
341                                 </field>
342                                 <field type='text-single' label='Nickname' var='muc#register_roomnick'/>
343                         </x>
344                 </query>
345         </iq>
347 Romeo sends:
348         <iq id='nv71va54' to='room@conference.localhost' type='set'>
349                 <query xmlns='jabber:iq:register'>
350                         <x xmlns='jabber:x:data' type='submit'>
351                                 <field var='FORM_TYPE'>
352                                         <value>http://jabber.org/protocol/muc#register</value>
353                                 </field>
354                                 <field var='muc#register_roomnick'>
355                                         <value>Romeo</value>
356                                 </field>
357                         </x>
358                 </query>
359         </iq>
361 Romeo receives:
362         <presence from='room@conference.localhost/Romeo'>
363                 <x xmlns='http://jabber.org/protocol/muc#user'>
364                         <item affiliation='owner' jid="${Romeo's full JID}" role='moderator'/>
365                         <status code='110'/>
366                 </x>
367         </presence>
369 Romeo receives:
370         <iq type='result' from='room@conference.localhost' id='nv71va54'/>
372 Juliet receives:
373         <presence from='room@conference.localhost/Romeo'>
374                 <x xmlns='http://jabber.org/protocol/muc#user'>
375                         <item role='moderator' xmlns='http://jabber.org/protocol/muc#user' affiliation='owner'/>
376                 </x>
377         </presence>
379 # Romeo discovers his reserved nick
381 Romeo sends:
382         <iq id='getnick1' to='room@conference.localhost' type='get'>
383                 <query xmlns='http://jabber.org/protocol/disco#info' node='x-roomuser-item'/>
384         </iq>
386 Romeo receives:
387         <iq type='result' from='room@conference.localhost' id='getnick1'>
388                 <query xmlns='http://jabber.org/protocol/disco#info' node='x-roomuser-item'>
389                         <identity category='conference' name='Romeo' type='text'/>
390                 </query>
391         </iq>
393 # To check the status of the room is as expected, Romeo requests the member list
395 Romeo sends:
396         <iq id='member3' to='room@conference.localhost' type='get'>
397                 <query xmlns='http://jabber.org/protocol/muc#admin'>
398                         <item affiliation='member'/>
399                 </query>
400         </iq>
402 Romeo receives:
403         <iq from='room@conference.localhost' type='result' id='member3'>
404                 <query xmlns='http://jabber.org/protocol/muc#admin'>
405                         <item jid="${Juliet's JID}" affiliation='member' nick='Juliet'/>
406                 </query>
407         </iq>
409 Juliet sends:
410         <presence type="unavailable" to="room@conference.localhost/Juliet" />
412 Juliet receives:
413         <presence from='room@conference.localhost/Juliet' type='unavailable' />
415 Romeo receives:
416         <presence type='unavailable' from='room@conference.localhost/Juliet' />
418 # Rosaline joins as herself
420 Rosaline sends:
421         <presence to="room@conference.localhost/Rosaline">
422                 <x xmlns="http://jabber.org/protocol/muc"/>
423         </presence>
425 Rosaline receives:
426         <presence from="room@conference.localhost/Romeo" />
428 Rosaline receives:
429         <presence from="room@conference.localhost/Rosaline" />
431 Rosaline receives:
432         <message type='groupchat' from='room@conference.localhost'><subject/></message>
434 Romeo receives:
435         <presence from='room@conference.localhost/Rosaline'>
436                 <x xmlns='http://jabber.org/protocol/muc#user'>
437                         <item jid="${Rosaline's full JID}" affiliation='none' role='participant'/>
438                 </x>
439         </presence>
441 # Rosaline tries to register her own nickname, but unaffiliated
442 # registration is disabled by default
444 Rosaline sends:
445         <iq id='reg990' to='room@conference.localhost' type='get'>
446                 <query xmlns='jabber:iq:register'/>
447         </iq>
449 Rosaline receives:
450         <iq type='error' from='room@conference.localhost' id='reg990'>
451                 <error type='auth'>
452                         <registration-required xmlns='urn:ietf:params:xml:ns:xmpp-stanzas'/>
453                 </error>
454         </iq>
456 Rosaline sends:
457         <iq id='reg991' to='room@conference.localhost' type='set'>
458                 <query xmlns='jabber:iq:register'>
459                         <x xmlns='jabber:x:data' type='submit'>
460                                 <field var='FORM_TYPE'>
461                                         <value>http://jabber.org/protocol/muc#register</value>
462                                 </field>
463                                 <field var='muc#register_roomnick'>
464                                         <value>Romeo</value>
465                                 </field>
466                         </x>
467                 </query>
468         </iq>
470 Rosaline receives:
471         <iq id='reg991' type='error'>
472                 <error type='auth'>
473                         <registration-required xmlns='urn:ietf:params:xml:ns:xmpp-stanzas'/>
474                 </error>
475         </iq>
477 # Romeo reserves her nickname for her
479 Romeo sends:
480         <iq id='member2' to='room@conference.localhost' type='set'>
481                 <query xmlns='http://jabber.org/protocol/muc#admin'>
482                         <item affiliation='member' jid="${Rosaline's JID}" nick='Rosaline' />
483                 </query>
484         </iq>
486 Romeo receives:
487         <presence from='room@conference.localhost/Rosaline'>
488                 <x xmlns='http://jabber.org/protocol/muc#user'>
489                         <item affiliation='member' role='participant' jid="${Rosaline's full JID}">
490                                 <actor jid="${Romeo's full JID}" nick='Romeo'/>
491                         </item>
492                 </x>
493         </presence>
495 Romeo receives:
496         <iq type='result' id='member2' from='room@conference.localhost' />
498 Rosaline receives:
499         <presence from='room@conference.localhost/Rosaline'>
500                 <x xmlns='http://jabber.org/protocol/muc#user'>
501                         <item affiliation='member' role='participant' jid="${Rosaline's full JID}">
502                                 <actor nick='Romeo' />
503                         </item>
504                         <status xmlns='http://jabber.org/protocol/muc#user' code='110'/>
505                 </x>
506         </presence>
508 # Romeo sets their their own nickname via admin query (see #1273)
509 Romeo sends:
510         <iq to="room@conference.localhost" id="reserve" type="set">
511                 <query xmlns="http://jabber.org/protocol/muc#admin">
512                         <item nick="Romeo" affiliation="owner" jid="${Romeo's JID}"/>
513                 </query>
514         </iq>
516 Romeo receives:
517         <presence from="room@conference.localhost/Romeo">
518                 <x xmlns="http://jabber.org/protocol/muc#user">
519                         <item xmlns="http://jabber.org/protocol/muc#user" role="moderator" jid="${Romeo's full JID}" affiliation="owner">
520                                 <actor xmlns="http://jabber.org/protocol/muc#user" nick="Romeo"/>
521                         </item>
522                         <status xmlns="http://jabber.org/protocol/muc#user" code="110"/>
523                 </x>
524         </presence>
526 Romeo receives:
527         <iq from="room@conference.localhost" id="reserve" type="result"/>