comparison xmpp/xep-proto-privileged-component.xml @ 31:91d56a6e4b0d

xep: privileged entity update: - giving permission to manage this XEP namespace is forbidden - Added configuration section; with well-defined command node - better specification of persistent permissions - fixed erroneous example (server returns bookmarks) - added special permissions - better specification of <query/> element
author Goffi <goffi@goffi.org>
date Thu, 13 Nov 2014 14:12:19 +0100
parents c6824592e3ef
children a3f262d5b594
comparison
equal deleted inserted replaced
30:b04be960ebdf 31:91d56a6e4b0d
33 <surname>Poisson</surname> 33 <surname>Poisson</surname>
34 <email>goffi@goffi.org</email> 34 <email>goffi@goffi.org</email>
35 <jid>goffi@jabber.fr</jid> 35 <jid>goffi@jabber.fr</jid>
36 </author> 36 </author>
37 <revision> 37 <revision>
38 <version>0.0.3</version>
39 <date>2014-11-13</date>
40 <initials>jp</initials>
41 <remark><ul>
42 <li>giving permission to manage this XEP namespace is forbidden</li>
43 <li>Added configuration section; with well-defined command node</li>
44 <li>better specification of persistent permissions</li>
45 <li>fixed erroneous example (server returns bookmarks)</li>
46 <li>added special permissions</li>
47 <li>better specification of &QUERY; element</li>
48 </ul>
49 </remark>
50 </revision>
51 <revision>
38 <version>0.0.2</version> 52 <version>0.0.2</version>
39 <date>2014-09-17</date> 53 <date>2014-09-17</date>
40 <initials>jp</initials> 54 <initials>jp</initials>
41 <remark><ul> 55 <remark><ul>
42 <li>changed for privileged entity</li> 56 <li>changed for privileged entity</li>
50 <date>2014-05-09</date> 64 <date>2014-05-09</date>
51 <initials>jp</initials> 65 <initials>jp</initials>
52 <remark><p>First draft.</p></remark> 66 <remark><p>First draft.</p></remark>
53 </revision> 67 </revision>
54 </header> 68 </header>
69
55 <section1 topic='Introduction' anchor='intro'> 70 <section1 topic='Introduction' anchor='intro'>
56 <p>XMPP components are used for long through &xep0114;, but are quite limited: they have a restricted access to other entities data, similar to what a client can do. This is sufficient for components like gateways, but very limiting for more complex components like a PubSub service. The goal of this XEP is to allow a component or any entity to have a "privileged" status, and access an other entity data with the same privileges than the entity itself, that means send and receive IQ stanzas on its behalf.</p> 71 <p>XMPP components are used for long through &xep0114;, but are quite limited: they have a restricted access to other entities data, similar to what a client can do. This is sufficient for components like gateways, but very limiting for more complex components like a PubSub service. The goal of this XEP is to allow a component or any entity to have a "privileged" status, and access an other entity data with the same privileges than the entity itself, that means send and receive &IQ; stanzas on its behalf (and in <link url='#special'>some cases</link>, send &MESSAGE; or receive &PRESENCE; stanzas).</p>
57 <p>Privileged entity have numerous advantages, including:</p> 72 <p>Privileged entity have numerous advantages, including:</p>
58 <ul> 73 <ul>
59 <li>a step forward in decentralization: it is possible for an entity to do tasks which were before reserved to server itself. For example, a privileged pubsub component can offer access model based on publisher's roster</li> 74 <li>a step forward in decentralization: it is possible for an entity to do tasks which were before reserved to server itself. For example, a privileged pubsub component can offer access model based on publisher's roster</li>
60 <li>better integration of components: a gateway can add items to an entity roster itself</li> 75 <li>better integration of components: a gateway can add items to an entity roster itself</li>
61 <li>possibility to overpass a server limitation</li> 76 <li>possibility to overpass a server limitation</li>
62 <li>quick development cycle: developers can implement the components they need without waiting for a new server release</li> 77 <li>quick development cycle: developers can implement the components they need without waiting for a new server release</li>
63 <li>server agnostic</li> 78 <li>server agnostic</li>
64 </ul> 79 </ul>
65 </section1> 80 </section1>
81
66 <section1 topic='Requirements' anchor='reqs'> 82 <section1 topic='Requirements' anchor='reqs'>
67 <p>A privileged entity can be used in two modes:</p> 83 <p>A privileged entity can be used in two modes:</p>
68 <ul> 84 <ul>
69 <li><strong>admin</strong> mode, where it is installed by the server administrator</li> 85 <li><strong>admin</strong> mode, where it is installed by the server administrator.</li>
70 <li><strong>client</strong> mode, where it can be installed by any user</li> 86 <li><strong>client</strong> mode, where it can be installed by any user</li>
71 </ul> 87 </ul>
72 <p>In <em>admin</em> mode, the privileged entity MAY be able to emit IQ stanzas in the same way as any entity, including managing roster or accessing persistent storage.</p> 88 <p>In <em>admin</em> mode, the privileged entity MAY be able to emit &IQ; stanzas in the same way as any entity, including managing roster or accessing persistent storage. The privilege mechanism MUST be totally transparent for the managed entities.</p>
73 <p>In <em>client</em> mode, a privileged entity MUST have an explicit autorization for any IQ namespace he wants to use. Client SHOULD be able to check and revoke granted permissions, and if it's not possible, permissions MUST be revoked after a disconnection.</p> 89 <p>In <em>client</em> mode, a privileged entity MUST have an explicit autorization for any &IQ; namespace he wants to use. Client SHOULD be able to check and revoke granted permissions, and if it's not possible, permissions MUST be revoked after a disconnection.</p>
74 </section1> 90 <p>In addition, some <link url='#special'>special permissions</link> can permit to send &MESSAGE; stanzas on behalf of the server or access &PRESENCE; informations</p>
91 </section1>
92
75 <section1 topic='Glossary' anchor='glossary'> 93 <section1 topic='Glossary' anchor='glossary'>
76 <ul> 94 <ul>
77 <li><strong>Privileged entity</strong> — the entity which has or wants a privileged status.</li> 95 <li><strong>Privileged entity</strong> — the entity which has or wants a privileged status.</li>
78 <li><strong>Managed entity</strong> — the entity that the privileged entity wants to manage.</li> 96 <li><strong>Managed entity</strong> — the entity that the privileged entity wants to manage.</li>
79 </ul> 97 </ul>
80 </section1> 98 </section1>
99
81 <section1 topic='Admin Mode Use Cases' anchor='admin_usecases'> 100 <section1 topic='Admin Mode Use Cases' anchor='admin_usecases'>
82 101
83 <section2 topic='Permission Request Use Case' anchor='admin_perm'> 102 <section2 topic='Permission Request Use Case' anchor='admin_perm'>
84 <section3 topic='Entity request privileged status of admin' anchor='req_status'> 103 <section3 topic='Entity request privileged status of admin' anchor='req_status'>
85 <p>Once the privileged entity is authentified and stream is started, the entity can request its privileged status. It do it by sending an IQ stanza with <strong>'urn:xmpp:privilege:0'</strong> namespace</p> 104 <p>Once the privileged entity is authentified and stream is started, the entity can request its privileged status. It do it by sending an &IQ; stanza with <strong>'urn:xmpp:privilege:0'</strong> namespace</p>
86 <p>Namespace permissions are asked with a &lt;perm/&gt; element, which MUST contain a 'namespace' attribute set to the requested namespace and a 'type' attribute which can be:</p> 105 <p>The &QUERY; element MUST have a "request" type and MAY have a 'privilege' attribute with the value "admin". Namespace permissions are asked with a &lt;perm/&gt; element, which MUST contain a 'namespace' attribute set to the requested namespace and a 'type' attribute which can be:</p>
87 <ul> 106 <ul>
88 <li><strong>get</strong> — the entity wants to send &IQ; stanza of type <em>'get'</em></li> 107 <li><strong>get</strong> — the entity wants to send &IQ; stanza of type <em>'get'</em></li>
89 <li><strong>set</strong> — the entity wants to send &IQ; stanza of type <em>'set'</em></li> 108 <li><strong>set</strong> — the entity wants to send &IQ; stanza of type <em>'set'</em></li>
90 <li><strong>both</strong> — the entity wants to send &IQ; stanza of type <em>'get'</em> and <em>'set'</em></li> 109 <li><strong>both</strong> — the entity wants to send &IQ; stanza of type <em>'get'</em> and <em>'set'</em></li>
91 </ul> 110 </ul>
97 </query> 116 </query>
98 </iq> 117 </iq>
99 ]]></example> 118 ]]></example>
100 </section3> 119 </section3>
101 <section3 topic='Server Accept Admin Privilege' anchor='accept_status'> 120 <section3 topic='Server Accept Admin Privilege' anchor='accept_status'>
102 <p>If the server accept the privileged status (e.g.: admin status specified in configuration), it MUST return an IQ result stanza, with allowed permissions in &lt;perm/&gt; elements:</p> 121 <p>If the server accept the privileged status (e.g.: admin status specified in configuration), it MUST return an &IQ; result stanza with a "allowed" &QUERY; type, and allowed permissions in &lt;perm/&gt; elements:</p>
103 <example caption='Server accept admin privilege'><![CDATA[ 122 <example caption='Server accept admin privilege'><![CDATA[
104 <iq from='capulet.net' to='pubsub.capulet.net' type='result' id='privilege1'> 123 <iq from='capulet.net' to='pubsub.capulet.net' type='result' id='privilege1'>
105 <query xmlns='urn:xmpp:privilege:0' 124 <query xmlns='urn:xmpp:privilege:0'
106 type='allowed'> 125 type='allowed'>
107 <perm namespace='jabber:iq:roster' type='both'/> 126 <perm namespace='jabber:iq:roster' type='both'/>
121 </iq> 140 </iq>
122 ]]></example> 141 ]]></example>
123 </section3> 142 </section3>
124 </section2> 143 </section2>
125 144
126 <section2 topic='Privileged Entity Send IQ Stanzas' anchor='priv_iq_admin'> 145 <section2 topic='Privileged Entity Send &IQ; Stanzas' anchor='priv_iq_admin'>
127 <p>Sending an IQ stanzas is done by sending the stanza the way it would be done by the managed entity, except that its jid is in the 'to' attribute. In the following example, the PubSub service want to know juliet's roster because she own a node with access model based on publiser's roster:</p> 146 <p>Sending an &IQ; stanzas is done by sending the stanza the way it would be done by the managed entity, except that its jid is in the 'to' attribute. In the following example, the PubSub service want to know juliet's roster because she own a node with access model based on publiser's roster:</p>
128 <example caption='Privileged Entity Send A Roster Stanza'><![CDATA[ 147 <example caption='Privileged Entity Send A Roster Stanza'><![CDATA[
129 <iq id='roster1' 148 <iq id='roster1'
130 xmlns='urn:xmpp:privilege:0' 149 xmlns='urn:xmpp:privilege:0'
131 to='juliet@example.com' 150 to='juliet@example.com'
132 type='get' 151 type='get'
136 ]]></example> 155 ]]></example>
137 156
138 <p>The server then answer normaly, as it would have done with the managed entity:</p> 157 <p>The server then answer normaly, as it would have done with the managed entity:</p>
139 <example caption='Server Answer To Privileged Entity'><![CDATA[ 158 <example caption='Server Answer To Privileged Entity'><![CDATA[
140 <iq id='roster1' 159 <iq id='roster1'
160 from='juliet@example.com'
141 to='pubsub.capulet.net' 161 to='pubsub.capulet.net'
142 type='result'> 162 type='result'>
143 <query xmlns='jabber:iq:roster' ver='ver7'> 163 <query xmlns='jabber:iq:roster' ver='ver7'>
144 <item jid='nurse@example.com'/> 164 <item jid='nurse@example.com'/>
145 <item jid='romeo@example.net'/> 165 <item jid='romeo@example.net'/>
157 </pubsub> 177 </pubsub>
158 </iq> 178 </iq>
159 ]]></example> 179 ]]></example>
160 <p>and server answer:</p> 180 <p>and server answer:</p>
161 181
162 <example caption='Server Return Bookmarks'><![CDATA[ 182 <example caption='Server Returns Bookmarks'><![CDATA[
163 <iq id='bookmark1' 183 <iq id='bookmark1'
164 to='pubsub.capulet.net' 184 to='sync.capulet.net'
165 type='result'> 185 type='result'>
166 <pubsub xmlns='http://jabber.org/protocol/pubsub'> 186 <pubsub xmlns='http://jabber.org/protocol/pubsub'>
167 <items node='storage:bookmarks'> 187 <items node='storage:bookmarks'>
168 <item id='current'> 188 <item id='current'>
169 <storage xmlns='storage:bookmarks'> 189 <storage xmlns='storage:bookmarks'>
170 <conference name='The Play&apos;s the Thing' 190 <conference name='The Play&apos;s the Thing'
171 autojoin='true' 191 autojoin='true'
172 jid='theplay@conference.shakespeare.lit'> 192 jid='theplay@conference.shakespeare.lit'>
173 <nick>JC</nick> 193 <nick>JC</nick>
174 </conference> 194 </conference>
175 </storage> 195 </storage>
178 </pubsub> 198 </pubsub>
179 </iq> 199 </iq>
180 ]]></example> 200 ]]></example>
181 </section2> 201 </section2>
182 </section1> 202 </section1>
183
184 203
185 <section1 topic='Client Mode Use Cases' anchor='client_usecases'> 204 <section1 topic='Client Mode Use Cases' anchor='client_usecases'>
186 <section2 topic='Permission Request Use Case' anchor='client_perm'> 205 <section2 topic='Permission Request Use Case' anchor='client_perm'>
187 <p>In <em>client</em> mode, the privileged entity is not certified by the server administrator, so the permissions MUST be <strong>explicitly</strong> allowed by the managed entity. This is initiated by the privileged entity (it can be after an interaction with a managed entity, like a subscription). It's done in the same way as for <em>admin</em> mode with the following exceptions:</p> 206 <p>In <em>client</em> mode, the privileged entity is not certified by the server administrator, so the permissions MUST be <strong>explicitly</strong> allowed by the managed entity. This is initiated by the privileged entity (it can be after an interaction with a managed entity, like a subscription). It's done in the same way as for <em>admin</em> mode with the following exceptions:</p>
188 <ol> 207 <ol>
238 <option label='Read only (get)'><value>get</value></option> 257 <option label='Read only (get)'><value>get</value></option>
239 </field> 258 </field>
240 </x> 259 </x>
241 </message> 260 </message>
242 ]]></example> 261 ]]></example>
243 <p>The server SHOULD include a warning message, SHOULD translate the namespace to human friendly names (and MAY keep the original namespace in addition) and MUST set the default value to '<strong>none</strong>' (permission refused). The server SHOULD use namespace as field var, so a client can use it to have a customized display.</p> 262 <p>The server SHOULD include a warning message, SHOULD translate the namespace to human friendly names (and MAY keep the original namespace in addition) and MUST set the default value to "<strong>none</strong>" (permission refused). The server SHOULD use namespace as field var, so a client can use it to have a customized display.</p>
244 <p>The client can then answer to the form:</p> 263 <p>The client can then answer to the form:</p>
245 <example caption='Client Answer To The Form'><![CDATA[ 264 <example caption='Client Answer To The Form'><![CDATA[
246 <message from='juliet@capulet.net' to='capulet.net'> 265 <message from='juliet@capulet.net' to='capulet.net'>
247 <x xmlns='jabber:x:data' type='submit'> 266 <x xmlns='jabber:x:data' type='submit'>
248 <field var='FORM_TYPE'> 267 <field var='FORM_TYPE'>
266 </query> 285 </query>
267 </iq> 286 </iq>
268 ]]></example> 287 ]]></example>
269 <p>The privileged entity can now act according to permission granted to him.</p> 288 <p>The privileged entity can now act according to permission granted to him.</p>
270 </section2> 289 </section2>
271 <section2 topic='Privileged Entity Send IQ Stanzas' anchor='priv_iq_client'> 290 <section2 topic='Privileged Entity Send &IQ; Stanzas' anchor='priv_iq_client'>
272 <p>sending IQ stanza is done in the exact same way as for <link url='#priv_iq_admin'>admin mode</link>. If an entity want to sent a non authorized IQ, it get a &forbidden; error:</p> 291 <p>sending &IQ; stanza is done in the exact same way as for <link url='#priv_iq_admin'>admin mode</link>. If an entity want to sent a non authorized &IQ;, it get a &forbidden; error:</p>
273 <example caption='Entity Request bookmarks'><![CDATA[ 292 <example caption='Entity Request bookmarks'><![CDATA[
274 <iq to='juliet@capulet.lit' type='get' id='bookmark1'> 293 <iq to='juliet@capulet.lit' type='get' id='bookmark1'>
275 <pubsub xmlns='http://jabber.org/protocol/pubsub'> 294 <pubsub xmlns='http://jabber.org/protocol/pubsub'>
276 <items node='storage:bookmarks'/> 295 <items node='storage:bookmarks'/>
277 </pubsub> 296 </pubsub>
284 <forbidden xmlns='urn:ietf:params:xml:ns:xmpp-stanzas'/> 303 <forbidden xmlns='urn:ietf:params:xml:ns:xmpp-stanzas'/>
285 </error> 304 </error>
286 </iq> 305 </iq>
287 ]]></example> 306 ]]></example>
288 </section2> 307 </section2>
289 308 </section1>
290 </section1> 309
310 <section1 topic='Special permissions' anchor='special'>
311 <p>In some case, an entity may need extra permission beyond what &IQ; stanzas can do. An entity may want to send &MESSAGE; stanzas on behalf of the server, or get &PRESENCE; informations. The special permissions manage these cases with some restrictions.</p>
312
313 <section2 topic='message permission' anchor='message'>
314 <p>With some namespaces it can be desirable to send notifications (e.g. PEP service), so the privileged entity must be able to send &MESSAGE; stanzas. To do this, it MUST request it by using a &lt;perm/&gt; element with the special "message" namespace attribute and a 'type' attribute with the value "outgoing" (any other type MUST be rejected with a &forbidden; error).</p>
315 <p>A privileged entity can then send message on the behalf either of the server or of a bare jid of the server, using &xep0297;, with the following restrictions:</p>
316 <ol>
317 <li>forwarded &MESSAGE; 'type' attribute has the value of "headline"</li>
318 <li>forwarded &MESSAGE; 'from' attribute MUST be a bare jid from the server, no resource is allowed</li>
319 <li>in client mode, the forwarded &MESSAGE; 'from' attribute can only be one of a managed entity which has explicitly accepted the delegation</li>
320 </ol>
321 <p>If any of this rules is violated, the server MUST return a &lt;not-authorized/&gt; stream error and close the connection, as explained in &rfc6120; section 4.9.3.12.</p>
322 <p>In the following example, pubsub.capulet.lit ask for pubsub and outgoing messages permission</p>
323 <example caption='entity asks for outgoing messages permission'><![CDATA[
324 <iq from='pubsub.capulet.net' type='get' id='privilege1'>
325 <query xmlns='urn:xmpp:privilege:0' type='request' privilege='admin'>
326 <perm namespace='message' type='outgoing'/>
327 <perm namespace='http://jabber.org/protocol/pubsub' type='both'/>
328 </query>
329 </iq>
330 ]]></example>
331
332 <example caption='server accept permissions'><![CDATA[
333 <iq from='capulet.net' to='pubsub.capulet.net' type='result' id='privilege1'>
334 <query xmlns='urn:xmpp:privilege:0' type='allowed'>
335 <perm namespace='message' type='outgoing'/>
336 <perm namespace='http://jabber.org/protocol/pubsub' type='both'/>
337 </query>
338 </iq>
339 ]]></example>
340 <p>Now that <em>pubsub.capulet.lit</em> is allowed, it can send messages using &lt;forwarded/&gt; elements.</p>
341 <example caption='privileged entity send a notificaction message'><![CDATA[
342 <message from='pubsub.capulet.lit' to='capulet.lit' id='notif1'>
343 <forwarded xmlns='urn:xmpp:forward:0'>
344 <message from='juliet@capulet.lit'
345 id='foo'
346 to='romeo@montague.lit/orchard'
347 type='headline'
348 xmlns='jabber:client'>
349 <event xmlns='http://jabber.org/protocol/pubsub#event'>
350 <items node='http://jabber.org/protocol/tune'>
351 <item>
352 <tune xmlns='http://jabber.org/protocol/tune'>
353 <artist>Gerald Finzi</artist>
354 <length>255</length>
355 <source>Music for "Love's Labors Lost" (Suite for small orchestra)</source>
356 <title>Introduction (Allegro vigoroso)</title>
357 <track>1</track>
358 </tune>
359 </item>
360 </items>
361 </event>
362 <delay xmlns='urn:xmpp:delay' stamp='2014-11-25T14:34:32Z'/>
363 </message>
364 </forwarded>
365 </message>
366 ]]></example>
367 <p>The server see that forwarded message type is '<em>headline</em>', that <em>juliet@capulet.lit</em> is a bare jid of the server, and that outgoing message permission was granted in admin mode (so all bare jids from server are allowed); it can now send the notification:</p>
368 <example caption='server send the notification as if it was originating from him'><![CDATA[
369 <message from='juliet@capulet.lit'
370 id='bar'
371 to='romeo@montague.lit/orchard'
372 type='headline'>
373 <event xmlns='http://jabber.org/protocol/pubsub#event'>
374 <items node='http://jabber.org/protocol/tune'>
375 <item>
376 <tune xmlns='http://jabber.org/protocol/tune'>
377 <artist>Gerald Finzi</artist>
378 <length>255</length>
379 <source>Music for "Love's Labors Lost" (Suite for small orchestra)</source>
380 <title>Introduction (Allegro vigoroso)</title>
381 <track>1</track>
382 </tune>
383 </item>
384 </items>
385 </event>
386 <delay xmlns='urn:xmpp:delay' stamp='2014-11-25T14:34:32Z'/>
387 </message>
388 ]]></example>
389 </section2>
390
391 <section2 topic='Managed Entity Presence' anchor='managed_ent_presence'>
392 <p>It can be often desirable for a privileged entity to have presence information of the managed entities (e.g. to know when to send it notificiations). As privileges must be transparent for the managed entity (in admin mode), this presence has to be sent by the server without modifying managed entity roster.</p>
393 <p>To do this, the privileged entity MUST ask for presence information when requesting privileges, using a special "presence" namespace attribute and a 'type' attribute with the value "managed_entity".</p><p>If the delegation is granted, the server MUST use a directed presence, as specified in &rfc6121; section 4.6 on the behalf of managed entity each time its presence information change.</p><p>This privilege MUST NOT be requested in client mode, and the server MUST reject the permission by setting the allowed type to "none". If an entity need presence information in client mode, it SHOULD request it using the normal &PRESENCE; subscription mechanism.</p>
394 <example caption='privileged entity asks for pusub privilege with presence'><![CDATA[
395 <iq from='pubsub.capulet.net' type='get' id='privilege1'>
396 <query xmlns='urn:xmpp:privilege:0' type='request' privilege='admin'>
397 <perm namespace='presence' type='managed_entity'/>
398 <perm namespace='http://jabber.org/protocol/pubsub' type='both'/>
399 </query>
400 </iq>
401 ]]></example>
402
403 <example caption='server accept privileges'><![CDATA[
404 <iq from='capulet.net' to='pubsub.capulet.net' type='result' id='privilege1'>
405 <query xmlns='urn:xmpp:privilege:0' type='allowed'>
406 <perm namespace='presence' type='managed_entity'/>
407 <perm namespace='http://jabber.org/protocol/pubsub' type='both'/>
408 </query>
409 </iq>
410 ]]></example>
411
412 <example caption='server receive new presence from juliet'><![CDATA[
413 <presence from='juliet@capulet.lit/balcony'
414 id='presence1'
415 xml:lang='en'>
416 <show>chat</show>
417 <status>Staying on the balcony</status>
418 </presence>
419 ]]></example>
420 <example caption='server redirect presence to privileged entity'><![CDATA[
421 <presence from='juliet@capulet.lit/balcony'
422 to='pubsub.capulet.lit'
423 id='presence1'
424 xml:lang='en'>
425 <show>chat</show>
426 <status>Staying on the balcony</status>
427 </presence>
428 ]]></example>
429 </section2>
430
431 <section2 topic='Roster Presence' anchor='roster_presence'>
432 <p>In addition to "<link url='#managed_ent_presence'>managed entity presence</link>", a privileged entity may need to know when a contact in managed entity roster is online (for example, it's necessary for a PEP service because of the presence default access model).</p>
433 <p>In this case, privileged entity MUST ask for presence information when requesting privileges, using a special "presence" namespace attribute (as in previous section) and a 'type' attribute with the value "roster". Furthermore, the privileged entity MUST have read permission on roster namespace (i.e. 'type' attribute in allowed &lt;perm&gt; of namespace <em>jabber:iq:roster</em> MUST have a value of either <strong>get</strong> or <strong>both</strong>).</p>
434 <p>If the delegation is granted, the server MUST send to the privileged entity every presence information that the managing entity is receiving.</p><p>The server MUST reject the permission if the privileged entity doesn't have read permission on roster namespace.</p>
435 <p>Note: this permission should be given carefully, as it give access to presence of potentially a lot of entities to the privileged entity (see <link url='#security'>security considerations</link>). If allowed in client mode, server SHOULD display an extra warning when requesting permissions to the managed entity.</p>
436 <example caption='privileged entity asks for pusub privilege with presence roster'><![CDATA[
437 <iq from='pubsub.capulet.net' type='get' id='privilege1'>
438 <query xmlns='urn:xmpp:privilege:0' type='request' privilege='admin'>
439 <perm namespace='presence' type='roster'/>
440 <perm namespace='http://jabber.org/protocol/pubsub' type='both'/>
441 <perm namespace='jabber:iq:roster' type='get'/>
442 </query>
443 </iq>
444 ]]></example>
445 <p>Note the presence of <em>jabber:iq:roster</em> permission request.</p>
446
447 <example caption='server accept privileges'><![CDATA[
448 <iq from='capulet.net' to='pubsub.capulet.net' type='result' id='privilege1'>
449 <query xmlns='urn:xmpp:privilege:0' type='allowed'>
450 <perm namespace='presence' type='roster'/>
451 <perm namespace='http://jabber.org/protocol/pubsub' type='both'/>
452 <perm namespace='jabber:iq:roster' type='get'/>
453 </query>
454 </iq>
455 ]]></example>
456
457 <example caption="server receive new presence from Romeo, which is in Juliet's roster"><![CDATA[
458 <presence from='romeo@montaigu.lit/orchard'/>
459 ]]></example>
460 <example caption='server send the presence as usually, but also to the privileged entity'><![CDATA[
461 <presence from='romeo@montaigu.lit/orchard'
462 to='juliet@capulet.lit'/>
463 <presence from='romeo@montaigu.lit/orchard'
464 to='pubsub.capulet.lit'/>
465 ]]></example>
466 </section2>
467 </section1>
468
469 <section1 topic='Configuration' anchor='configuration'>
470 <p>Server SHOULD provide a way to clients to check already granted permission, and revoke them by using &xep0050; on the well-defined command node of <strong>'urn:xmpp:privilege:0#configure'</strong>.</p>
471 <p>If present, the configurations commands MUST allow at least to check permissions granted to a privileged entity, and to revoke them. A server MAY offer an option to keep permission from one session to an other (see <link url='#rules'>business rules</link>).</p>
472 </section1>
473
291 <section1 topic='Discovering Support' anchor='disco'> 474 <section1 topic='Discovering Support' anchor='disco'>
292 <p>If a server or an entity supports the entity privilege protocol, it MUST report that fact by including a service discovery feature of "urn:xmpp:privilege:0" in response to a &xep0030; information request:</p> 475 <p>If a server or an entity supports the entity privilege protocol, it MUST report that fact by including a service discovery feature of "urn:xmpp:privilege:0" in response to a &xep0030; information request:</p>
293 <example caption="Service Discovery information request"><![CDATA[ 476 <example caption="Service Discovery information request"><![CDATA[
294 <iq from='pubsub.capulet.net' 477 <iq from='pubsub.capulet.net'
295 id='disco1' 478 id='disco1'
309 ... 492 ...
310 </query> 493 </query>
311 </iq> 494 </iq>
312 ]]></example> 495 ]]></example>
313 </section1> 496 </section1>
497
314 <section1 topic='Business Rules' anchor='rules'> 498 <section1 topic='Business Rules' anchor='rules'>
315 <ol> 499 <ol>
316 <li>Server MAY keep permission granted to an entity by a client from one session to an other, but if it do so, it MUST provide a way to client to check already granted permission, and revoke them (possibly using &xep0050;).</li> 500 <li>In client mode, server MAY keep permission granted to an entity by a client from one session to an other, but if it do so, it MUST provide configuration like explained in the <link url='#configuration'>suitable section</link>. If server offer this feature, it SHOULD add a field directly in configuration commands.</li>
317 <li>If a client can't check or revoke permission (e.g. it doesn't support &xep0050;), the server MUST NOT keep granted permission from one session to an other, and permission will be asked on each new session.</li> 501 <li>If a client can't check or revoke permission (i.e. it doesn't support &xep0050;) when granting permissions, the server MUST NOT keep granted permissions from one session to an other, and permissions will be asked on each new session.</li>
318 <li>If permissions are changed during a session, server MUST notify privileged entity of the new permissions, like in <link url='#client_perm'>permission request use case</link> </li> 502 <li>If permissions are changed during a session, server MUST notify privileged entity of the new permissions, like in <link url='#client_perm'>permission request use case</link></li>
503 <li>A server MUST NOT grant permission for this XEP namespace (<strong>'urn:xmpp:privilege:0'</strong>)</li>
319 </ol> 504 </ol>
320 </section1> 505 </section1>
506
321 <section1 topic='Implementation Notes' anchor='impl'> 507 <section1 topic='Implementation Notes' anchor='impl'>
322 <p>As admin mode is far more easy to implement than client mode, a server MAY choose to only implement the former</p> 508 <p>As admin mode is far more easy to implement than client mode, a server MAY choose to only implement the former</p>
323 </section1> 509 </section1>
510
324 <section1 topic='Security Considerations' anchor='security'> 511 <section1 topic='Security Considerations' anchor='security'>
325 <ol> 512 <ol>
326 <li>Privileged entity nearly have the same possibility as the server itself, <em>admin</em> permission should be granted carefuly, only if you absolutely trust the entity.</li> 513 <li>Privileged entity nearly have the same possibility as the server itself, <em>admin</em> permission should be granted carefuly, only if you absolutely trust the entity.</li>
327 <li>A server MAY choose to filter allowed namespaces, to avoid giving dangerous permissions. In this case, it MUST always set the allowed type of filtered namespaces to <strong>none</strong></li> 514 <li>A server MAY choose to filter allowed namespaces, to avoid giving dangerous permissions. In this case, it MUST always set the allowed type of filtered namespaces to "<strong>none</strong>"</li>
515 <li><link url='#roster_presence'>Roster presence</link> is particulary sensitive, because if an entity accept this permission, it give presence information from its whole roster. For this reason, a server MAY choose to forbid its use in client mode (by always setting the allowed type to "<strong>none</strong>"). A server SHOULD at least disallow it in default configuration.</li>
328 516
329 <li>In case of filtering, a whitelist system is more secure and SHOULD be prefered to a blacklist (idealy, configuration would allow no filtering, whitelist filtering and blacklist filtering)</li> 517 <li>In case of filtering, a whitelist system is more secure and SHOULD be prefered to a blacklist (idealy, configuration would allow no filtering, whitelist filtering and blacklist filtering)</li>
330 </ol> 518 </ol>
331 </section1> 519 </section1>
520
332 <section1 topic='IANA Considerations' anchor='iana'> 521 <section1 topic='IANA Considerations' anchor='iana'>
333 <p>This document requires no interaction with &IANA;.</p> 522 <p>This document requires no interaction with &IANA;.</p>
334 </section1> 523 </section1>
524
335 <section1 topic='XMPP Registrar Considerations' anchor='registrar'> 525 <section1 topic='XMPP Registrar Considerations' anchor='registrar'>
336 <section2 topic='Protocol Namespaces' anchor='ns'> 526 <section2 topic='Protocol Namespaces' anchor='ns'>
337 <p>The &REGISTRAR; includes 'urn:xmpp:privilege:0' in its registry of protocol namespaces (see &NAMESPACES;).</p> 527 <p>The &REGISTRAR; includes 'urn:xmpp:privilege:0' in its registry of protocol namespaces (see &NAMESPACES;).</p>
338 <ul> 528 <ul>
339 <li>urn:xmpp:privilege:0</li> 529 <li>urn:xmpp:privilege:0</li>
341 </section2> 531 </section2>
342 <section2 topic='Protocol Versioning' anchor='registrar-versioning'> 532 <section2 topic='Protocol Versioning' anchor='registrar-versioning'>
343 &NSVER; 533 &NSVER;
344 </section2> 534 </section2>
345 </section1> 535 </section1>
536
346 <section1 topic='XML Schema' anchor='schema'> 537 <section1 topic='XML Schema' anchor='schema'>
347 <code><![CDATA[ 538 <code><![CDATA[
348 <?xml version='1.0' encoding='UTF-8'?> 539 <?xml version='1.0' encoding='UTF-8'?>
349 540
350 <xs:schema 541 <xs:schema
387 </xs:element> 578 </xs:element>
388 579
389 </xs:schema> 580 </xs:schema>
390 ]]></code> 581 ]]></code>
391 </section1> 582 </section1>
583
392 <section1 topic='Acknowledgements' anchor='acks'> 584 <section1 topic='Acknowledgements' anchor='acks'>
393 <p>Thanks to Sergey Dobrov, Dave Cridland and Steven Lloyd Watkin for their feedbacks.</p> 585 <p>Thanks to Sergey Dobrov, Dave Cridland, Steven Lloyd Watkin, Lance Stout and Johannes Hund for their feedbacks.</p>
394 </section1> 586 <p>The client mode permission mechanism is inspired from &xep0321; permission request.</p>
587 </section1>
588
395 </xep> 589 </xep>