comparison xmpp/xep-proto-namespace-delegation.xml @ 30:b04be960ebdf

xep: namespace delegation first draft: this xep provides a way for XMPP server to delegate treatments for a namespace to an other entity
author Goffi <goffi@goffi.org>
date Thu, 13 Nov 2014 14:10:15 +0100
parents
children a3f262d5b594
comparison
equal deleted inserted replaced
29:b27e7f9ad479 30:b04be960ebdf
1 <?xml version='1.0' encoding='UTF-8'?>
2 <!DOCTYPE xep SYSTEM 'xep.dtd' [
3 <!ENTITY % ents SYSTEM 'xep.ent'>
4 %ents;
5 ]>
6 <?xml-stylesheet type='text/xsl' href='xep.xsl'?>
7 <xep>
8 <header>
9 <title>namespace delegation</title>
10 <abstract>This specification provides a way for XMPP server to delegate treatments for a namespace to an other entity</abstract>
11 <legal>
12 <copyright>This XMPP Extension Protocol is copyright (c) 1999 - 2014 by the XMPP Standards Foundation (XSF).</copyright>
13 <permissions>Permission is hereby granted, free of charge, to any person obtaining a copy of this specification (the &quot;Specification&quot;), to make use of the Specification without restriction, including without limitation the rights to implement the Specification in a software program, deploy the Specification in a network service, and copy, modify, merge, publish, translate, distribute, sublicense, or sell copies of the Specification, and to permit persons to whom the Specification is furnished to do so, subject to the condition that the foregoing copyright notice and this permission notice shall be included in all copies or substantial portions of the Specification. Unless separate permission is granted, modified works that are redistributed shall not contain misleading information regarding the authors, title, number, or publisher of the Specification, and shall not claim endorsement of the modified works by the authors, any organization or project to which the authors belong, or the XMPP Standards Foundation.</permissions>
14 <warranty>## NOTE WELL: This Specification is provided on an &quot;AS IS&quot; BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, express or implied, including, without limitation, any warranties or conditions of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A PARTICULAR PURPOSE. In no event shall the XMPP Standards Foundation or the authors of this Specification be liable for any claim, damages, or other liability, whether in an action of contract, tort, or otherwise, arising from, out of, or in connection with the Specification or the implementation, deployment, or other use of the Specification. ##</warranty>
15 <liability>In no event and under no legal theory, whether in tort (including negligence), contract, or otherwise, unless required by applicable law (such as deliberate and grossly negligent acts) or agreed to in writing, shall the XMPP Standards Foundation or any author of this Specification be liable for damages, including any direct, indirect, special, incidental, or consequential damages of any character arising out of the use or inability to use the Specification (including but not limited to damages for loss of goodwill, work stoppage, computer failure or malfunction, or any and all other commercial damages or losses), even if the XMPP Standards Foundation or such author has been advised of the possibility of such damages.</liability>
16 <conformance>This XMPP Extension Protocol has been contributed in full conformance with the XSF's Intellectual Property Rights Policy (a copy of which may be found at &lt;<link url='http://xmpp.org/extensions/ipr-policy.shtml'>http://xmpp.org/extensions/ipr-policy.shtml</link>&gt; or obtained by writing to XSF, P.O. Box 1641, Denver, CO 80201 USA).</conformance>
17 </legal>
18 <number>xxxx</number>
19 <status>ProtoXEP</status>
20 <type>Standards Track</type>
21 <sig>Standards</sig>
22 <approver>Council</approver>
23 <dependencies>
24 <spec>XMPP Core</spec>
25 <spec>XEP-0004</spec>
26 <spec>XEP-0297</spec>
27 </dependencies>
28 <supersedes/>
29 <supersededby/>
30 <shortname>NOT_YET_ASSIGNED</shortname>
31 <author>
32 <firstname>Jérôme</firstname>
33 <surname>Poisson</surname>
34 <email>goffi@goffi.org</email>
35 <jid>goffi@jabber.fr</jid>
36 </author>
37 <revision>
38 <version>0.0.1</version>
39 <date>2014-11-13</date>
40 <initials>jp</initials>
41 <remark><p>First draft.</p></remark>
42 </revision>
43 </header>
44 <section1 topic='Introduction' anchor='intro'>
45 <p>Some XMPP features must be offered by the server itself, or can't be available, that's the case of &xep0163; which is used in several places (e.g. bookmarks storage). But it can be desirable to use an external entity to manage some of these features, because it implements things that the server don't, or because it use a special implementation useful in a particular case. Some people may also want to decentralize a feature on an entity under their control. This XEP try to solve these cases.<br/>Additionaly, a method to do generic treatments (independant of server) on stanza is also provided.</p>
46 <p>This XEP is complementary to priviliged entity XEP (and works in a similar way), although they can be used together or separely</p>
47 <p>Here are some use cases of namespace delegation:</p>
48 <ul>
49 <li>use an external component for a PEP service because the server doesn't implement it or lack some features</li>
50 <li>decentralize a server feature to an entity under client control</li>
51 <li>do a component which react on new user registration, independent of server implementation</li>
52 <li>server agnostic roster filtering</li>
53 </ul>
54 </section1>
55 <section1 topic='Requirements' anchor='reqs'>
56 <p>Namespace delegation can be used in two modes:</p>
57 <ul>
58 <li><strong>admin</strong> mode, where delegation is specified by the server administrator.</li>
59 <li><strong>client</strong> mode, where it can be requested by any user.</li>
60 </ul>
61 <p>In <em>admin</em> mode, the managing entity manage stanza of the delegated namespace for all users registered on the server. The namespace delegation MUST be totally transparent for the managed entities.</p>
62 <p>In <em>client</em> mode, a managing entity MUST have an explicit autorization for any 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>
63 </section1>
64 <section1 topic='Glossary' anchor='glossary'>
65 <ul>
66 <li><strong>Delegated namespace</strong> — the namespace being managed by an external entity.</li>
67 <li><strong>Managing entity</strong> — the entity which actualy manage the delegated namespace.</li>
68 <li><strong>Managed entity</strong> — an entity which wants to have a namespace of its server delegated to a managing entity.</li>
69 </ul>
70 </section1>
71 <section1 topic='Admin Mode Use Cases' anchor='admin_usecases'>
72
73 <section2 topic='Delegation Request Use Case' anchor='admin_perm'>
74 <section3 topic='Entity Request Delegation Of Namespaces' anchor='req_delegation'>
75 <p>Once the managing entity is authentified and stream is started, the entity can request to manage a namespace. It do it by sending an &IQ; stanza with <strong>'urn:xmpp:delegation:0'</strong> namespace. The &QUERY; element MUST have a type of value "request" and MAY have a 'delegation' attribute with the value "admin".</p>
76 <p>Namespace delegations are asked with a &lt;delegate/&gt; element, which MUST contain a 'namespace' attribute set to the requested namespace</p>
77 <p>Only &lt;iq/&gt; stanza namespaces can be delegated.</p>
78 <example caption='entity asks for delegation in admin mode'><![CDATA[
79 <iq from='pubsub.capulet.lit' type='get' id='delegation1'>
80 <query xmlns='urn:xmpp:delegation:0' type='request' delegation='admin'>
81 <delegate namespace='jabber:iq:roster'/>
82 <delegate namespace='http://jabber.org/protocol/pubsub'/>
83 </query>
84 </iq>
85 ]]></example>
86 </section3>
87 <section3 topic='Server Accept Namespace Delegation' anchor='accept_delegation'>
88 <p>If the server accept the delegation (e.g.: namespace mapping specified in configuration), it MUST return an &IQ; result stanza, with allowed delegations in &lt;delegate&gt; elements:</p>
89 <example caption='server accept namespace delegations'><![CDATA[
90 <iq from='capulet.lit' to='pubsub.capulet.lit' type='result' id='delegation1'>
91 <query xmlns='urn:xmpp:delegation:0' type='allowed'>
92 <delegate namespace='jabber:iq:roster'>
93 <delegate namespace='http://jabber.org/protocol/pubsub'>
94 </query>
95 </iq>
96 ]]></example>
97 <p>Note: the granted delegations MAY be different from the requested ones, according to server's configuration.</p>
98 <p>The server MUST then forward all requests done to itself on this namespace to the managing entity, except the request done by the managing entity itself (see below).<br/>
99 The server MUST NOT forward any request done to an other entity than itself or a bare jid with its domain.</p>
100 </section3>
101 <section3 topic='Server Reject Namespace Delegation' anchor='reject_delegation'>
102 <p>If the server reject the delegation, it MUST return a &forbidden; error:</p>
103 <example caption='server reject delegation'><![CDATA[
104 <iq from='capulet.lit' to='pubsub.capulet.lit' type='error' id='delegation1'>
105 <error type='cancel'>
106 <forbidden xmlns='urn:ietf:params:xml:ns:xmpp-stanzas'/>
107 </error>
108 </iq>
109 ]]></example>
110 </section3>
111 </section2>
112
113 <section2 topic='Server Forward Delegated &IQ; Stanza' anchor='stanza_forward'>
114 <p>When a server receives a stanza for a delegated namespace which is either directed to him (no 'to' attribute, or 'to' attribute with its own jid), or directed to the bare jid of the sender (e.g. if 'from' attribute is "<em>juliet@capulet.lit/balcony</em>" and 'to' attribute is "<em>juliet@capulet.lit</em>"), it MUST forward it to the managing entity by replacing the 'to' attribute with the jid of the managing entity:</p>
115 <example caption='juliet send her mood to her sever via pep'><![CDATA[
116 <iq from='juliet@capulet.lit/balcony'
117 id='pep1'
118 type='set'>
119 <pubsub xmlns='http://jabber.org/protocol/pubsub'>
120 <publish node='http://jabber.org/protocol/mood'>
121 <item>
122 <mood xmlns='http://jabber.org/protocol/mood'>
123 <annoyed/>
124 <text>curse my nurse!</text>
125 </mood>
126 </item>
127 </publish>
128 </pubsub>
129 </iq>
130 ]]></example>
131 <p>The server get this stanza, see that this namespace is delegated to <em>pubsub.capulet.lit</em>, so it forward it:</p>
132
133 <example caption='sever delegate the stanza to pubsub.capulet.lit'><![CDATA[
134 <iq from='juliet@capulet.lit/balcony'
135 to='pubsub.capulet.lit'
136 id='delegate1'
137 type='set'>
138 <pubsub xmlns='http://jabber.org/protocol/pubsub'>
139 <publish node='http://jabber.org/protocol/mood'>
140 <item>
141 <mood xmlns='http://jabber.org/protocol/mood'>
142 <annoyed/>
143 <text>curse my nurse!</text>
144 </mood>
145 </item>
146 </publish>
147 </pubsub>
148 </iq>
149 ]]></example>
150
151 <p>The managing entity reply normally to the stanza:</p>
152 <example caption='pubsub.capulet.lit reply to juliet'><![CDATA[
153 <iq from='pubsub.capulet.lit'
154 to='juliet.capulet.lit/balcony'
155 id='delegate1'
156 type='result'>
157 <pubsub xmlns='http://jabber.org/protocol/pubsub' />
158 </iq>
159 ]]></example>
160
161 <p>Then the server MUST change the from field of managing entity to its own field, and send the answer back to Julied with the original &IQ; id</p>
162
163 <example caption='capulet.lit reply to juliet'><![CDATA[
164 <iq from='capulet.lit'
165 to='juliet.capulet.lit/balcony'
166 id='pep1'
167 type='result'>
168 <pubsub xmlns='http://jabber.org/protocol/pubsub' />
169 </iq>
170 ]]></example>
171
172 <p>The workflow is fully transparent for Juliet</p>
173 <section3 topic='Stanzas from managing entity' anchor='managing_entity_stanzas'>
174 <p>If a stanza is sent by the managing entity on a managed namespace, the server MUST NOT forward it. This way, the managing entity can use privileged entity to do special treatments</p>
175 <p>In the following examples, <em>juliet@capulet.lit</em> has its "<em>jabber:iq:roster</em>" namespace delegated to <em>filter.capulet.lit</em>. <em>filter.capulet.lit</em> is a server agnostic component which filter allowed entity (which can be added to a roster), and sort them in enforced groups</p>
176
177 <example caption='Juliet add Romeo to her roster'><![CDATA[
178 <iq from='juliet@capulet.lit/balcony'
179 id='roster1'
180 type='set'>
181 <query xmlns='jabber:iq:roster'>
182 <item jid='romeo@montaigu.lit'
183 name='My Romeo'>
184 </item>
185 </query>
186 </iq>
187 ]]></example>
188
189 <example caption='server forward stanza to managing entity'><![CDATA[
190 <iq from='juliet@capulet.lit/balcony'
191 to='filter.capulet.lit'
192 id='delegate1'
193 type='set'>
194 <query xmlns='jabber:iq:roster'>
195 <item jid='romeo@montaigu.lit'
196 name='My Romeo'>
197 </item>
198 </query>
199 </iq>
200 ]]></example>
201
202 <p><em>filter.capulet.lit</em> accept to add Romeo, but all jids with a <em>montaigu.lit</em> must be in a "Rivals" group, so it first return a success result (romeo is accepted)</p>
203 <example caption='filtering component accept Romeo'><![CDATA[
204 <iq from='filter.capulet.lit'
205 to='juliet@capulet.lit/balcony'
206 id='delegate1'
207 type='result' />
208 ]]></example>
209 <example caption='server forward the result with the initial id'><![CDATA[
210 <iq to='juliet@capulet.lit/balcony'
211 id='roster1'
212 type='result' />
213 ]]></example>
214
215 <p>At this stade, the entity is accepted, but not added to the roster. <em>filter.capulet.lit</em> is also a privileged entity which can manage "<em>jabber:iq:roster</em>", so it use this ability to add romeo with the enforced group:</p>
216 <example caption='filter.capulet.lit use privileged entity to add romeo'><![CDATA[
217 <iq to='juliet@capulet.lit'
218 from='filter.capulet.lit'
219 id='roster2'
220 type='set'>
221 <query xmlns='jabber:iq:roster'>
222 <item jid='romeo@montaigu.lit'
223 name='My Romeo'>
224 <group>Rivals</group>
225 </item>
226 </query>
227 </iq>
228 ]]></example>
229 <p>The namespace is delegated, but as the stanza is from the managing entity, the server manage it normally. The entity is also privileged, so it can change the stanza of Juliet, the server accept:</p>
230
231 <example caption='server accept new entity in roster'><![CDATA[
232 <iq to='filter.capulet.lit'
233 from='juliet@capulet.lit'
234 id='roster2'
235 type='result'/>
236 ]]></example>
237
238 <p>The server will then send the roster pushes (with the enforced group) normally.</p>
239
240 </section3>
241
242 </section2>
243
244
245 </section1>
246
247 <section1 topic='Client Mode Use Cases' anchor='client_usecases'>
248 <section2 topic='Client Delegation Request Use Case' anchor='client_delegation'>
249 <p>In <em>client</em> mode, the managing entity is not certified by the server administrator, so the delegation MUST be <strong>explicitly</strong> allowed by the managed entity. This is initiated by the managing 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>
250 <ol>
251 <li>the delegation type is <em>client</em> instead of <em>admin</em></li>
252 <li>the delegation is done per entity, so the managed entity MUST be specified in a 'to' attribute</li>
253 </ol>
254 <p>If an entity want to manage PEP service for juliet, it can ask the delegation like this:
255 </p>
256 <example caption='managing entity asks for namespace delegation for one particular entity'><![CDATA[
257 <iq from='pubsub.montaigu.lit' to='capulet.lit' type='get' id='delegation1'>
258 <query xmlns='urn:xmpp:delegation:0'
259 type='request'
260 delegation='client'
261 to='juliet@capulet.lit'>
262 <delegate namespace='http://jabber.org/protocol/pubsub'/>
263 </query>
264 </iq>
265 ]]></example>
266 <p>Once received the delegation request, the server ask to the client if it grant access to the requested namespace using &xep0004;. The server use a challenge which it MUST have generated itself.
267 </p>
268 <example caption='server asks user for the namespace delegation'><![CDATA[
269 <message from='capulet.lit' to='juliet@capulet.lit'>
270 <body>
271 pubsub.montaigu.lit wants to manage a feature normally managed by the server.
272 Do you you allow him to manage the following features ?
273
274 Be careful ! According management to entity is a serious thing,
275 think twice that you can trust the entity before doing this.
276 </body>
277 <x xmlns='jabber:x:data' type='form'>
278 <title>Delegation request</title>
279 <instructions>pubsub.montaigu.lit wants to manage the following features:
280 Do you allow it?</instructions>
281 <field type='hidden' var='challenge'><value>5439123</value></field>
282 <field type='hidden' var='FORM_TYPE'>
283 <value>urn:xmpp:delegation:0</value>
284 </field>
285 <field type='list-single'
286 label='Manage PubSub (http://jabber.org/protocol/pubsub)'
287 var='http://jabber.org/protocol/pubsub'>
288 <value>0</value>
289 <option label='No'><value>0</value></option>
290 <option label='Yes'><value>1</value></option>
291 </field>
292 </x>
293 </message>
294 ]]></example>
295 <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>0</strong>' (permission refused). The server SHOULD use namespace as field var, so a client can use it to have a customized display.</p>
296 <p>The client can then answer to the form:</p>
297 <example caption='client answer to the form'><![CDATA[
298 <message from='juliet@capulet.lit' to='capulet.lit'>
299 <x xmlns='jabber:x:data' type='submit'>
300 <field var='FORM_TYPE'>
301 <value></value>
302 </field>
303 <field var='challenge'><value>5439123</value></field>
304 <field var='http://jabber.org/protocol/pubsub'><value>1</value></field>
305 </x>
306 </message>
307 ]]></example>
308 <p>Here juliet accept that <em>pubsub.montaigu.lit</em> manage the PubSub (and then PEP) service.</p>
309 <p>Finaly, the server notify the entity of the delegation granted. For this it use a &QUERY; element with the 'allowed' type, and put the client jid in a 'from' attribute:</p>
310 <example caption='server notify accepted delegations'><![CDATA[
311 <iq from='capulet.lit' to='pubsub.montaigu.lit' type='set' id='delegation2'>
312 <query xmlns='urn:xmpp:delegation:0'
313 type='allowed'
314 from='juliet@capulet.lit'>
315 <delegate namespace='http://jabber.org/protocol/pubsub'/>
316 </query>
317 </iq>
318 ]]></example>
319 <p>The managing entity can now manage the namespace the same way as in <link url='#stanza_forward'>admin mode</link>.</p>
320 </section2>
321
322 </section1>
323
324 <section1 topic='Configuration' anchor='configuration'>
325 <p>Server SHOULD provide a way to clients to check already delegated namespaces, and revoke them by using &xep0050; on the well-defined command node of <strong>'urn:xmpp:delegation:0#configure'</strong>.</p>
326 <p>If present, the configurations commands MUST allow at least to check delegations granted to a managing entity, and to revoke them. A server MAY offer an option to keep delegations from one session to an other (see <link url='#rules'>business rules</link>).</p>
327 </section1>
328
329 <section1 topic='Discovering Support' anchor='disco'>
330 <section2 topic='Announce' anchor='disco_announce'>
331 <p>If a server or an entity supports the namespace delegation protocol, it MUST report that fact by including a service discovery feature of "<em>urn:xmpp:delegation:0</em>" in response to a &xep0030; information request:</p>
332 <example caption="service discovery information request"><![CDATA[
333 <iq from='pubsub.capulet.lit'
334 id='disco1'
335 to='capulet.lit'
336 type='get'>
337 <query xmlns='http://jabber.org/protocol/disco#info'/>
338 </iq>
339 ]]></example>
340 <example caption="service discovery information response"><![CDATA[
341 <iq from='capulet.lit'
342 id='disco1'
343 to='pubsub.capulet.lit'
344 type='result'>
345 <query xmlns='http://jabber.org/protocol/disco#info'>
346 ...
347 <feature var='urn:xmpp:delegation:0'/>
348 ...
349 </query>
350 </iq>
351 ]]></example>
352 </section2>
353 <section2 topic='Nesting' anchor='disco_nesting'>
354 <section3 topic='General Case'>
355 <p>When a server delegate a namespace to a managing entity, the later can have particular features which must be advertised by the former with disco protocol.</p>
356 <p>This is done by using a disco node, which is done in the following way: if pubsub.capulet.int manage pubsub namespace, it MUST report that fact in discovery feature, and have a '<strong>urn:xmpp:delegation:0::http://jabber.org/protocol/pubsub</strong>' node which report features managed.</p><p>The node name is obtained by concatenating this XEP namespace (<strong>urn:xmpp:delegation:0</strong>), a '<strong>::</strong>' separator, and the delegated namespace (here <strong>http://jabber.org/protocol/pubsub</strong>).<br/>The server MUST advertise the result in its own discovery answer, and MUST ignore features of its internal component (here internal PubSub service).</p>
357 <p>In the following example, the capulet.int server delegate it's internal PEP component to pubsub.capulet.int. capulet.int only support REQUIRED PubSub features and auto-create, while pubsub.capulet.int support also REQUIRED PubSub features and publish-options, but not auto-create. <br/>juliet@capulet.int ask its server what it is capable of, she is specially interested in PubSub capabilities.</p>
358 <example caption="Juliet ask her server its available features"><![CDATA[
359 <iq from='juliet@capulet.lit/balcony'
360 id='disco1'
361 to='capulet.lit'
362 type='get'>
363 <query xmlns='http://jabber.org/protocol/disco#info'/>
364 </iq>
365 ]]>
366 </example>
367 <p>Server delegate its PubSub namespace to <em>pubsub.capulet.lit</em>, so it ask its available features for this namespace like this</p>
368 <example caption="capulet.lit request disco infos for pubsub namespace to pubsub.capulet.lit"><![CDATA[
369 <iq from='capulet.lit'
370 id='disco2'
371 to='pubsub.capulet.lit'
372 type='get'>
373 <query xmlns='http://jabber.org/protocol/disco#info'
374 node='urn:xmpp:delegation:0::http://jabber.org/protocol/pubsub'/>
375 </iq>
376 ]]>
377 </example>
378 <p>Note that in real situation, server has probably this information already in cache (see <link url='#impl'>Implementation Notes</link>).<br/>
379 <em>pubsub.capulet.lit</em> return its available features</p>
380 <example caption="pubsub.capulet.lit returns features to nest"><![CDATA[
381 <iq from='pubsub.capulet.lit'
382 id='disco2'
383 to='capulet.lit'
384 type='result'>
385 <query xmlns='http://jabber.org/protocol/disco#info'
386 node='urn:xmpp:delegation:0::http://jabber.org/protocol/pubsub'>
387 <feature var='http://jabber.org/protocol/pubsub'/>
388 <feature var='http://jabber.org/protocol/pubsub#publish'/>
389 <feature var='http://jabber.org/protocol/pubsub#subscribe'/>
390 <feature var='http://jabber.org/protocol/pubsub#publish-options'/>
391 </query>
392 </iq>
393 ]]>
394 </example>
395 <p>Server include the results in its own discovery info results:</p>
396 <example caption="capulet.lit return disco info including features from pubsub.capulet.lit"><![CDATA[
397 <iq from='capulet.lit'
398 id='disco1'
399 to='juliet@capulet.lit/balcony'
400 type='result'>
401 <query xmlns='http://jabber.org/protocol/disco#info'
402 node='urn:xmpp:delegation:0::http://jabber.org/protocol/pubsub'>
403 <feature var='urn:xmpp:delegation:0'/>
404 ...
405 <feature var='http://jabber.org/protocol/pubsub'/>
406 <feature var='http://jabber.org/protocol/pubsub#publish'/>
407 <feature var='http://jabber.org/protocol/pubsub#subscribe'/>
408 <feature var='http://jabber.org/protocol/pubsub#publish-options'/>
409 ...
410 </query>
411 </iq>
412 ]]>
413 </example>
414 <p>Note that '<em>http://jabber.org/protocol/pubsub#auto-create</em>' is not available.</p>
415 </section3>
416 <section3 topic='rediction of bare jid disco info'>
417 <p>As an entity may ask for discovery informations on bare jid, which the server would answer, the managing entity must be able to send this kind of information.</p>
418 <p>To do so, the mechanism is the same as for server features, but the separator is '<strong>:bare:</strong>' instead of '<strong>::</strong>':</p>
419
420 <example caption="Juliet ask features for its own bare jid"><![CDATA[
421 <iq from='juliet@capulet.lit/balcony'
422 id='disco3'
423 to='juliet@capulet.lit'
424 type='get'>
425 <query xmlns='http://jabber.org/protocol/disco#info'/>
426 </iq>
427 ]]>
428 </example>
429 <p>Server delegate its PubSub namespace to <em>pubsub.capulet.lit</em>, so it ask its available features for this namespace like this</p>
430 <example caption="capulet.lit request disco infos for pubsub namespace to pubsub.capulet.lit"><![CDATA[
431 <iq from='capulet.lit'
432 id='disco4'
433 to='pubsub.capulet.lit'
434 type='get'>
435 <query xmlns='http://jabber.org/protocol/disco#info'
436 node='urn:xmpp:delegation:0:bare:http://jabber.org/protocol/pubsub'/>
437 </iq>
438 ]]>
439 </example>
440 <p>As for general case, server has probably <link url='#impl'>this information already in cache</link>.<br/>
441 <em>pubsub.capulet.lit</em> return its available features</p>
442 <example caption="pubsub.capulet.lit returns features to nest"><![CDATA[
443 <iq from='pubsub.capulet.lit'
444 id='disco4'
445 to='capulet.lit'
446 type='result'>
447 <query xmlns='http://jabber.org/protocol/disco#info'
448 node='urn:xmpp:delegation:0:bare:http://jabber.org/protocol/pubsub'>
449 <identity category='pubsub' type='pep'/>
450 <feature var='http://jabber.org/protocol/pubsub#access-presence'/>
451 <feature var='http://jabber.org/protocol/pubsub#auto-create'/>
452 <feature var='http://jabber.org/protocol/pubsub#auto-subscribe'/>
453 <feature var='http://jabber.org/protocol/pubsub#config-node'/>
454 <feature var='http://jabber.org/protocol/pubsub#create-and-configure'/>
455 <feature var='http://jabber.org/protocol/pubsub#create-nodes'/>
456 <feature var='http://jabber.org/protocol/pubsub#filtered-notifications'/>
457 <feature var='http://jabber.org/protocol/pubsub#persistent-items'/>
458 <feature var='http://jabber.org/protocol/pubsub#publish'/>
459 <feature var='http://jabber.org/protocol/pubsub#retrieve-items'/>
460 <feature var='http://jabber.org/protocol/pubsub#subscribe'/>
461 ...
462 </query>
463 </iq>
464 ]]>
465 </example>
466 <p>then the server return the answer to Juliet, as in general case, with requested bare jid in 'from' field.</p>
467 <example caption="capulet.lit return disco info to Juliet"><![CDATA[
468 <iq from='juliet@capulet.lit'
469 id='disco3'
470 to='juliet@capulet.lit/balcony'
471 type='result'>
472 <query xmlns='http://jabber.org/protocol/disco#info'>
473 <identity category='account' type='registered'/>
474 <identity category='pubsub' type='pep'/>
475 <feature var='http://jabber.org/protocol/pubsub#access-presence'/>
476 <feature var='http://jabber.org/protocol/pubsub#auto-create'/>
477 <feature var='http://jabber.org/protocol/pubsub#auto-subscribe'/>
478 <feature var='http://jabber.org/protocol/pubsub#config-node'/>
479 <feature var='http://jabber.org/protocol/pubsub#create-and-configure'/>
480 <feature var='http://jabber.org/protocol/pubsub#create-nodes'/>
481 <feature var='http://jabber.org/protocol/pubsub#filtered-notifications'/>
482 <feature var='http://jabber.org/protocol/pubsub#persistent-items'/>
483 <feature var='http://jabber.org/protocol/pubsub#publish'/>
484 <feature var='http://jabber.org/protocol/pubsub#retrieve-items'/>
485 <feature var='http://jabber.org/protocol/pubsub#subscribe'/>
486 ...
487 </query>
488 </iq>
489 ]]>
490 </example>
491
492 </section3>
493 </section2>
494 </section1>
495
496 <section1 topic='Business Rules' anchor='rules'>
497 <ol>
498 <li>In client mode, server MAY keep delegations 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>
499 <li>If a client can't check or revoke delegations (i.e. it doesn't support &xep0050;) when granting them, the server MUST NOT keep granted delegations from one session to an other, and delegations will be asked on each new session.</li>
500 <li>If delegations are changed during a session, server MUST notify managing entity of the new delegations, like in <link url='#client_delegation'>client delegation request use case</link> </li>
501 <li>The namespace of this XEP (<strong>urn:xmpp:delegation:0</strong>) MUST NOT be delegated. If an entity request it, the server MUST return a &forbidden; error</li>
502 </ol>
503 </section1>
504 <section1 topic='Implementation Notes' anchor='impl'>
505 <ol>
506 <li>As admin mode is far more easy to implement than client mode, and client mode may impact performances, a server MAY choose to only implement the former.</li>
507 <li>Because of the performance impact, a server SHOULD ask for <link url='#disco_nesting'>disco features to nest</link> to managing entity when delegation is accepted, and keep them in cache.</li>
508 </ol>
509 </section1>
510 <section1 topic='Security Considerations' anchor='security'>
511 <ol>
512 <li>Managing entity can manage sensitive data, <em>admin</em> delegation should be granted carefuly, only if you absolutely trust the entity.</li>
513 <li>A server MAY choose to filter allowed namespaces. In this case, it MUST always set the allowed type of filtered namespaces to <strong>0</strong></li>
514
515 <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>
516 </ol>
517 </section1>
518 <section1 topic='IANA Considerations' anchor='iana'>
519 <p>This document requires no interaction with &IANA;.</p>
520 </section1>
521 <section1 topic='XMPP Registrar Considerations' anchor='registrar'>
522 <section2 topic='Protocol Namespaces' anchor='ns'>
523 <p>The &REGISTRAR; includes 'urn:xmpp:delegation:0' in its registry of protocol namespaces (see &NAMESPACES;).</p>
524 <ul>
525 <li>urn:xmpp:delegation:0</li>
526 </ul>
527 </section2>
528 <section2 topic='Protocol Versioning' anchor='registrar-versioning'>
529 &NSVER;
530 </section2>
531 </section1>
532 <section1 topic='XML Schema' anchor='schema'>
533 <code><![CDATA[
534 <?xml version='1.0' encoding='UTF-8'?>
535
536 <xs:schema
537 xmlns:xs='http://www.w3.org/2001/XMLSchema'
538 targetNamespace='urn:xmpp:delegation:0'
539 xmlns='urn:xmpp:delegation:0'
540 elementFormDefault='qualified'>
541
542 <xs:element name='query'>
543 <xs:complexType>
544 <xs:attribute name='type' use='required'>
545 <xs:simpleType base='xs:NMTOKEN'>
546 <xs:enumeration value='request'/>
547 <xs:enumeration value='allowed'/>
548 </xs:simpleType>
549 </xs:attribute>
550 <xs:attribute name='delegation' use='optional'>
551 <xs:simpleType base='xs:NMTOKEN'>
552 <xs:enumeration value='admin'/>
553 <xs:enumeration value='client'/>
554 </xs:simpleType>
555 </xs:attribute>
556 <xs:attribute name='to' use='optional' type='xs:string'/>
557 </xs:attribute>
558 <xs:element name='delegation'
559 maxOccurs='unbounded'>
560 <xs:complexType>
561 <xs:attribute name='namespace' use='required' type='xs:string'/>
562 </xs:complexType>
563 </xs:element>
564 </xs:complexType>
565 </xs:element>
566
567 </xs:schema>
568 ]]></code>
569 </section1>
570 <section1 topic='Acknowledgements' anchor='acks'>
571 <p>This XEP is linked with XEP-XXXX privileged entity and works in a similar way.</p>
572 <p>The client mode delegation mechanism is inspired from &xep0321; permission request.</p>
573 </section1>
574 </xep>