comparison xmpp/xep-0355.xml @ 42:bbb900a768ea

xeps: updated xep-0355 (namespace delegation): Several updates according to feedbacks: - Added attribute filtering, mainly to manage correctly MAM - Simplification of configuration in admin mode: no more <iq/> negociation - Delegations notifications to the managing entity are now done with a <message/> stanza - Forwarding now use XEP-0297 to avoid server to parse every stanza and a to have a cleaner separation - The behaviour when managing entity is unavailable is specified - Use of namespace in field var for client mode negociation is now mandatory - Behaviour when managing a delegation kept between session in client mode, when managing entity is not available, is specified - Implementation note added for in-order processing issue (thanks to Kurt Zeilenga for pointing this) - Added an note for discovery nesting with attribute filtering - Updated namespace to reflect incompatible changes
author Goffi <goffi@goffi.org>
date Sat, 21 Mar 2015 20:07:46 +0100
parents 21d0d0ab7aa0
children
comparison
equal deleted inserted replaced
41:21d0d0ab7aa0 42:bbb900a768ea
26 <firstname>Jérôme</firstname> 26 <firstname>Jérôme</firstname>
27 <surname>Poisson</surname> 27 <surname>Poisson</surname>
28 <email>goffi@goffi.org</email> 28 <email>goffi@goffi.org</email>
29 <jid>goffi@jabber.fr</jid> 29 <jid>goffi@jabber.fr</jid>
30 </author> 30 </author>
31
32 <revision>
33 <version>0.2</version>
34 <date>2014-03-21</date>
35 <initials>jp</initials>
36 <remark><p>Several updates according to feedbacks:</p>
37 <ul>
38 <li>Added attribute filtering, mainly to manage correctly MAM</li>
39 <li>Simplification of configuration in admin mode: no more &IQ; negociation</li>
40 <li>Delegations notifications to the managing entity are now done with a &MESSAGE; stanza</li>
41 <li>Forwarding now use &xep0297; to avoid server to parse every stanza and a to have a cleaner separation</li>
42 <li>The behaviour when managing entity is unavailable is specified</li>
43 <li>Use of namespace in field var for client mode negociation is now mandatory</li>
44 <li>Behaviour when managing a delegation kept between session in client mode, when managing entity is not available, is specified</li>
45 <li>Implementation note added for in-order processing issue (thanks to Kurt Zeilenga for pointing this)</li>
46 <li>Added an note for discovery nesting with attribute filtering</li>
47 <li>Updated namespace to reflect incompatible changes</li>
48 </ul>
49 </remark>
50 </revision>
51
31 <revision> 52 <revision>
32 <version>0.1</version> 53 <version>0.1</version>
33 <date>2014-12-18</date> 54 <date>2014-12-18</date>
34 <initials>XEP Editor (mam)</initials> 55 <initials>XEP Editor (mam)</initials>
35 <remark><p>Initial published version approved by the XMPP Council.</p></remark> 56 <remark><p>Initial published version approved by the XMPP Council.</p></remark>
36 </revision> 57 </revision>
58
37 <revision> 59 <revision>
38 <version>0.0.1</version> 60 <version>0.0.1</version>
39 <date>2014-11-13</date> 61 <date>2014-11-13</date>
40 <initials>jp</initials> 62 <initials>jp</initials>
41 <remark><p>First draft.</p></remark> 63 <remark><p>First draft.</p></remark>
42 </revision> 64 </revision>
65
43 </header> 66 </header>
44 <section1 topic='Introduction' anchor='intro'> 67 <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 uses 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 (independent of server) on stanza is also provided.</p> 68 <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 uses 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 (independent 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 separately.</p> 69 <p>This XEP is complementary to &xep0356; (and works in a similar way), although they can be used together or separately.</p>
47 <p>Here are some use cases of namespace delegation:</p> 70 <p>Here are some use cases of namespace delegation:</p>
48 <ul> 71 <ul>
49 <li>use an external component for a PEP service because the server doesn't implement it or lacks some features</li> 72 <li>use an external component for a PEP service because the server doesn't implement it or lacks some features</li>
50 <li>decentralize a server feature to an entity under client control</li> 73 <li>decentralize a server feature to an entity under client control</li>
51 <li>make a component which react on new user registration, independent of server implementation</li> 74 <li>make a component which react on new user registration, independent of server implementation</li>
62 <p>In <em>client</em> mode, a managing entity MUST have an explicit authorization 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> 85 <p>In <em>client</em> mode, a managing entity MUST have an explicit authorization 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> 86 </section1>
64 <section1 topic='Glossary' anchor='glossary'> 87 <section1 topic='Glossary' anchor='glossary'>
65 <ul> 88 <ul>
66 <li><strong>Delegated namespace</strong> — the namespace being managed by an external entity.</li> 89 <li><strong>Delegated namespace</strong> — the namespace being managed by an external entity.</li>
90 <li><strong>Filtering attribute</strong> — an attribute which must be present in first &IQ; child element to delegate the namespace.</li>
67 <li><strong>Managing entity</strong> — the entity which actualy manages the delegated namespace.</li> 91 <li><strong>Managing entity</strong> — the entity which actualy manages 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> 92 <li><strong>Managed entity</strong> — an entity which wants to have a namespace of its server delegated to a managing entity.</li>
69 </ul> 93 </ul>
70 </section1> 94 </section1>
71 <section1 topic='Admin Mode Use Cases' anchor='admin_usecases'> 95 <section1 topic='Admin Mode Use Cases' anchor='admin_usecases'>
72 96
97 <section2 topic='Server Allows Namespaces Delegations' anchor='server_config'>
98 <p>Namespaces delegations are granted in the server configuration. Only &IQ; stanza namespaces can be delegated.</p>
99 <p>A feature is delegated using:</p>
100 <ol>
101 <li>it's namespace: e.g. <em>'urn:xmpp:mam:0'</em></li>
102 <li>zero or more filtering attribute (attributes which must be present in the initial &IQ; child element): e.g. <em>'node'</em></li>
103 <li>the jid of the managing entity: e.g. <em>'managing.capulet.lit'</em></li>
104 </ol>
105 </section2>
106
73 <section2 topic='Delegation Request Use Case' anchor='admin_perm'> 107 <section2 topic='Delegation Request Use Case' anchor='admin_perm'>
74 <section3 topic='Entity Requests Namespace Delegation' anchor='req_delegation'> 108 <p>Once the managing entity is authenticated and stream is started, the server send it a &MESSAGE; stanza with a &lt;delegation/&gt; elements which MUST have the <strong>'urn:xmpp:delegation:1'</strong> namespace. This element contains &lt;delegated/&gt; elements which MUST contain a 'namespace' attribute indicating the delegated namespace. If there is additional attribute filtering, the &lt;delegated/&gt; can have children &lt;attribute/&gt; elements which MUST contain a 'name' attribute with the name of the filtering attribute.</p>
75 <p>Once the managing entity is authenticated and stream is started, the entity can request to manage a namespace. It does 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> 109 <example caption='server advertise delegated namespaces'><![CDATA[
76 <p>Namespace delegations are asked with a &lt;delegate/&gt; element, which MUST contain a 'namespace' attribute set to the requested namespace.</p> 110 <message from='capulet.net' to='pubub.capulet.lit' id='12345'>
77 <p>Only &lt;iq/&gt; stanza namespaces can be delegated.</p> 111 <delegation xmlns='urn:xmpp:delegation:1'>
78 <example caption='entity asks for delegation in admin mode'><![CDATA[ 112 <delegated namespace='urn:xmpp:mam:0'>
79 <iq from='pubsub.capulet.lit' type='get' id='delegation1'> 113 <attribute name='node' />
80 <query xmlns='urn:xmpp:delegation:0' type='request' delegation='admin'> 114 <delegated/>
81 <delegate namespace='jabber:iq:roster'/> 115 <delegated namespace='http://jabber.org/protocol/pubsub'/>
82 <delegate namespace='http://jabber.org/protocol/pubsub'/> 116 </delegation>
83 </query> 117 </message>
84 </iq> 118 ]]></example>
85 ]]></example> 119 <p>Here <em>pubsub.capulet.lit</em> will received all stanzas of pubsub namespace sent to <em>capulet.lit</em>. It will also receive MAM stanzas, but only if the 'node' attribute is present in &QUERY;.</p>
86 </section3>
87 <section3 topic='Server Accepts Namespace Delegation' anchor='accept_delegation'>
88 <p>If the server accepts 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 made to itself on this namespace to the managing entity, except the requests made by the managing entity itself (see below).<br/>
99 The server MUST NOT forward any request made to an other entity than itself or to a bare JID within its domain.</p>
100 </section3>
101 <section3 topic='Server Rejects Namespace Delegation' anchor='reject_delegation'>
102 <p>If the server rejects 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> 120 </section2>
112 121
113 <section2 topic='Server Forwards Delegated &IQ; Stanza' anchor='stanza_forward'> 122 <section2 topic='Server Forwards 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> 123 <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 sends her mood to her server via PEP'><![CDATA[ 124 <example caption='Juliet sends her mood to her server via PEP'><![CDATA[
126 </item> 135 </item>
127 </publish> 136 </publish>
128 </pubsub> 137 </pubsub>
129 </iq> 138 </iq>
130 ]]></example> 139 ]]></example>
131 <p>The server gets this stanza, sees that this namespace is delegated to <em>pubsub.capulet.lit</em>, so it forwards it:</p> 140 <p>The server gets this stanza, sees that this namespace is delegated to <em>pubsub.capulet.lit</em>, so it forwards it.</p>
141 <p>To forward, an &IQ; stanza of type "set" is used which contain a &lt;delegation/&gt; element (with namespace<em>'urn:xmpp:delegation:1'</em>) which in turn contain a &lt;forwarded/&gt; element encapsulating the initial stanza, according to &xep0297;:</p>
132 142
133 <example caption='server delegate the stanza to pubsub.capulet.lit'><![CDATA[ 143 <example caption='server delegate the stanza to pubsub.capulet.lit'><![CDATA[
134 <iq from='juliet@capulet.lit/balcony' 144 <iq from='capulet.lit'
135 to='pubsub.capulet.lit' 145 to='pubsub.capulet.lit'
136 id='delegate1' 146 id='delegate1'
137 type='set'> 147 type='set'>
138 <pubsub xmlns='http://jabber.org/protocol/pubsub'> 148 <delegation xmlns='urn:xmpp:delegation:1'>
139 <publish node='http://jabber.org/protocol/mood'> 149 <forwarded xmlns='urn:xmpp:forward:0'>
140 <item> 150 <iq from='juliet@capulet.lit/balcony'
141 <mood xmlns='http://jabber.org/protocol/mood'> 151 id='pep1'
142 <annoyed/> 152 type='set'>
143 <text>curse my nurse!</text> 153 <pubsub xmlns='http://jabber.org/protocol/pubsub'>
144 </mood> 154 <publish node='http://jabber.org/protocol/mood'>
145 </item> 155 <item>
146 </publish> 156 <mood xmlns='http://jabber.org/protocol/mood'>
147 </pubsub> 157 <annoyed/>
148 </iq> 158 <text>curse my nurse!</text>
149 ]]></example> 159 </mood>
150 160 </item>
151 <p>The managing entity replies normally to the stanza:</p> 161 </publish>
152 <example caption='pubsub.capulet.lit replies to Juliet'><![CDATA[ 162 </pubsub>
163 </iq>
164 </forwarded>
165 </delegation>
166 </iq>
167 ]]></example>
168 <p>The managing entity replies to the stanza by encapsulating its &IQ; result in the same way:</p>
169 <example caption='pubsub.capulet.lit replies badly to juliet'><![CDATA[
153 <iq from='pubsub.capulet.lit' 170 <iq from='pubsub.capulet.lit'
154 to='juliet@capulet.lit/balcony' 171 to='capulet.lit'
155 id='delegate1' 172 id='delegate1'
156 type='result'> 173 type='result'>
174 <delegation xmlns='urn:xmpp:delegation:1'>
175 <forwarded xmlns='urn:xmpp:forward:0'>
176 <iq to='juliet@capulet.lit/balcony'
177 id='pep1'
178 type='result'>
179 <pubsub xmlns='http://jabber.org/protocol/pubsub' />
180 </iq>
181 </forwarded>
182 </delegation>
183 </iq>
184 ]]></example>
185
186 <p>Then the server MUST decapsulate the &IQ; result, MUST insure that the 'to' and the 'from' attribute corresponds to respectively the 'from' and the 'to' attributes of the initial stanza, MUST insure that the 'id' attribute of the decapsulated stanza is the same as the initial 'id' attribute and that 'type' is "result". If everything is alright, it can send the decapsulated stanza to Juliet.</p>
187 <p>If the forwarded result from managing entity is bad (i.e. wrong 'to', 'from', 'id' or 'result' attributes), the server MUST send an &IQ; error with condition &lt;service-unavailable/&gt; to managed entity, and MAY close the connexion with managing entity.</p>
188
189 <example caption='capulet.lit replies to Juliet'><![CDATA[
190 <iq to='juliet@capulet.lit/balcony'
191 id='pep1'
192 type='result'>
157 <pubsub xmlns='http://jabber.org/protocol/pubsub' /> 193 <pubsub xmlns='http://jabber.org/protocol/pubsub' />
158 </iq> 194 </iq>
159 ]]></example> 195 ]]></example>
160 196
161 <p>Then the server MUST change the from field of managing entity to its own JID, and send the answer back to Juliet with the original &IQ; id.</p>
162
163 <example caption='capulet.lit replies 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> 197 <p>The workflow is fully transparent for Juliet.</p>
198 <p><strong>N.B.&#8321;:</strong> If the server encounter a delegated namespace and the managing entity is not available, it MUST return an &IQ; stanza of type "error" with an error condition of &lt;service-unavailable/&gt;</p>
199 <p><strong>N.B.&#8322;:</strong> If the server encounter a delegated namespace but the filtering attribute does not match, it MUST follow its normal behaviour, i.e. it must follow the same behaviour it would have had if the namespace was not delegated at all</p>
173 <section3 topic='Stanzas from managing entity' anchor='managing_entity_stanzas'> 200 <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> 201 <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 filters allowed entities (which can be added to a roster), and sort them in enforced groups.</p> 202 <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 filters allowed entities (which can be added to a roster), and sort them in enforced groups.</p>
176 203
177 <example caption='Juliet adds Romeo to her roster'><![CDATA[ 204 <example caption='Juliet adds Romeo to her roster'><![CDATA[
185 </query> 212 </query>
186 </iq> 213 </iq>
187 ]]></example> 214 ]]></example>
188 215
189 <example caption='server forwards stanza to managing entity'><![CDATA[ 216 <example caption='server forwards stanza to managing entity'><![CDATA[
190 <iq from='juliet@capulet.lit/balcony' 217 <iq from='capulet.lit'
191 to='filter.capulet.lit' 218 to='pubsub.capulet.lit'
192 id='delegate1' 219 id='delegate1'
193 type='set'> 220 type='set'>
194 <query xmlns='jabber:iq:roster'> 221 <delegation xmlns='urn:xmpp:delegation:1'>
195 <item jid='romeo@montaigu.lit' 222 <forwarded xmlns='urn:xmpp:forward:0'>
196 name='My Romeo'> 223 <iq from='juliet@capulet.lit/balcony'
197 </item> 224 id='roster1'
198 </query> 225 type='set'>
199 </iq> 226 <query xmlns='jabber:iq:roster'>
200 ]]></example> 227 <item jid='romeo@montaigu.lit'
201 228 name='My Romeo'>
202 <p><em>filter.capulet.lit</em> accepts to add Romeo, but all JIDs with a <em>montaigu.lit</em> must be in a "Rivals" group, so it first returns a success result (Romeo is accepted).</p> 229 </item>
230 </query>
231 </iq>
232 </forwarded>
233 </delegation>
234 </iq>
235 ]]></example>
236
237 <p><em>filter.capulet.lit</em> accepts to add Romeo, but all JIDs with a <em>montaigu.lit</em> must be in a "Rivals" group, so it first returns a success result (Romeo is accepted).</p>
203 <example caption='filtering component accept Romeo'><![CDATA[ 238 <example caption='filtering component accept Romeo'><![CDATA[
204 <iq from='filter.capulet.lit' 239 <iq from='pubsub.capulet.lit'
205 to='juliet@capulet.lit/balcony' 240 to='capulet.lit'
206 id='delegate1' 241 id='delegate1'
207 type='result' /> 242 type='result'>
208 ]]></example> 243 <delegation xmlns='urn:xmpp:delegation:1'>
209 <example caption='server forward the result with the initial id'><![CDATA[ 244 <forwarded xmlns='urn:xmpp:forward:0'>
245 <iq to='juliet@capulet.lit/balcony'
246 id='roster1'
247 type='result' />
248 </forwarded>
249 </delegation>
250 </iq>
251 ]]></example>
252 <example caption='server decapsulate and send the result with the initial id'><![CDATA[
210 <iq to='juliet@capulet.lit/balcony' 253 <iq to='juliet@capulet.lit/balcony'
211 id='roster1' 254 id='roster1'
212 type='result' /> 255 type='result' />
213 ]]></example> 256 ]]></example>
214 257
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 uses this ability to add Romeo in the enforced group:</p> 258 <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 uses this ability to add Romeo in the enforced group:</p>
216 <example caption='filter.capulet.lit uses privileged entity to add Romeo'><![CDATA[ 259 <example caption='filter.capulet.lit uses privileged entity to add Romeo'><![CDATA[
217 <iq to='juliet@capulet.lit' 260 <iq to='juliet@capulet.lit'
218 from='filter.capulet.lit' 261 from='filter.capulet.lit'
219 id='roster2' 262 id='roster2'
220 type='set'> 263 type='set'>
224 <group>Rivals</group> 267 <group>Rivals</group>
225 </item> 268 </item>
226 </query> 269 </query>
227 </iq> 270 </iq>
228 ]]></example> 271 ]]></example>
229 <p>The namespace is delegated, but as the stanza is from the managing entity, the server manages it normally. The entity is also privileged, so it can change the stanza of Juliet, the server accepts:</p> 272 <p>The namespace is delegated, but as the stanza is from the managing entity, the server manages it normally. The entity is also privileged, so it can change the stanza of Juliet, the server accepts:</p>
230 273
231 <example caption='server accept new entity in roster'><![CDATA[ 274 <example caption='server accept new entity in roster'><![CDATA[
232 <iq to='filter.capulet.lit' 275 <iq to='filter.capulet.lit'
233 from='juliet@capulet.lit' 276 from='juliet@capulet.lit'
234 id='roster2' 277 id='roster2'
235 type='result'/> 278 type='result'/>
236 ]]></example> 279 ]]></example>
237 280
238 <p>The server will then send the roster pushes (with the enforced group) normally.</p> 281 <p>The server will then send the roster pushes (with the enforced group) normally.</p>
239 282
240 </section3> 283 </section3>
241 284
242 </section2> 285 </section2>
243 286
244 287
245 </section1> 288 </section1>
246 289
247 <section1 topic='Client Mode Use Cases' anchor='client_usecases'> 290 <section1 topic='Client Mode Use Cases' anchor='client_usecases'>
248 <section2 topic='Client Delegation Request Use Case' anchor='client_delegation'> 291 <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> 292 <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).</p>
250 <ol> 293 <p>To request delegation for a particular entity, the managing entity MUST have an &IQ; stanza with <em>'urn:xmpp:delegation:1'</em> namespace. The &QUERY; element MUST have a 'to' attribute which specify the entity it wants to manage.</p>
251 <li>the delegation type is <em>client</em> instead of <em>admin</em></li> 294 <p>Namespace delegations are asked with a &lt;delegate/&gt; element, which MUST contain a 'namespace' attribute set to the requested namespace.</p>
252 <li>the delegation is done per entity, so the managed entity MUST be specified in a 'to' attribute</li> 295
253 </ol>
254 <p>If an entity want to manage PEP service for Juliet, it can ask the delegation like this: 296 <p>If an entity want to manage PEP service for Juliet, it can ask the delegation like this:
255 </p> 297 </p>
256 <example caption='managing entity asks for namespace delegation for one particular entity'><![CDATA[ 298 <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'> 299 <iq from='pubsub.montaigu.lit' to='capulet.lit' type='get' id='delegation1'>
258 <query xmlns='urn:xmpp:delegation:0' 300 <query xmlns='urn:xmpp:delegation:1'
259 type='request'
260 delegation='client'
261 to='juliet@capulet.lit'> 301 to='juliet@capulet.lit'>
262 <delegate namespace='http://jabber.org/protocol/pubsub'/> 302 <delegate namespace='http://jabber.org/protocol/pubsub'/>
263 </query> 303 </query>
264 </iq> 304 </iq>
265 ]]></example> 305 ]]></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. 306 <p>Once received the delegation request, the server ask to the client if it grants access to the requested namespace using &xep0004;. The server use a challenge which it MUST have generated itself.
267 </p> 307 </p>
268 <example caption='server asks user for the namespace delegation'><![CDATA[ 308 <example caption='server asks user for the namespace delegation'><![CDATA[
269 <message from='capulet.lit' to='juliet@capulet.lit'> 309 <message from='capulet.lit' to='juliet@capulet.lit/balcony'>
270 <body> 310 <body>
271 pubsub.montaigu.lit wants to manage a feature normally managed by the server. 311 pubsub.montaigu.lit wants to manage a feature normally managed by the server.
272 Do you allow it to manage the following features? 312 Do you allow it to manage the following features?
273 313
274 Be careful! According management to an entity is a serious thing, 314 Be careful! According management to an entity is a serious thing,
278 <title>Delegation request</title> 318 <title>Delegation request</title>
279 <instructions>pubsub.montaigu.lit wants to manage the following features: 319 <instructions>pubsub.montaigu.lit wants to manage the following features:
280 Do you allow it?</instructions> 320 Do you allow it?</instructions>
281 <field type='hidden' var='challenge'><value>5439123</value></field> 321 <field type='hidden' var='challenge'><value>5439123</value></field>
282 <field type='hidden' var='FORM_TYPE'> 322 <field type='hidden' var='FORM_TYPE'>
283 <value>urn:xmpp:delegation:0</value> 323 <value>urn:xmpp:delegation:1</value>
284 </field> 324 </field>
285 <field type='list-single' 325 <field type='list-single'
286 label='Manage PubSub (http://jabber.org/protocol/pubsub)' 326 label='Manage PubSub (http://jabber.org/protocol/pubsub)'
287 var='http://jabber.org/protocol/pubsub'> 327 var='http://jabber.org/protocol/pubsub'>
288 <value>0</value> 328 <value>0</value>
290 <option label='Yes'><value>1</value></option> 330 <option label='Yes'><value>1</value></option>
291 </field> 331 </field>
292 </x> 332 </x>
293 </message> 333 </message>
294 ]]></example> 334 ]]></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> 335 <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 MUST use namespaces as field var, so a client can use them to have a customized display.</p>
296 <p>The client can then answer to the form:</p> 336 <p>The client can then answer to the form:</p>
297 <example caption='client answer to the form'><![CDATA[ 337 <example caption='client answer to the form'><![CDATA[
298 <message from='juliet@capulet.lit' to='capulet.lit'> 338 <message from='juliet@capulet.lit/balcony' to='capulet.lit'>
299 <x xmlns='jabber:x:data' type='submit'> 339 <x xmlns='jabber:x:data' type='submit'>
300 <field var='FORM_TYPE'> 340 <field var='FORM_TYPE'>
301 <value></value> 341 <value></value>
302 </field> 342 </field>
303 <field var='challenge'><value>5439123</value></field> 343 <field var='challenge'><value>5439123</value></field>
304 <field var='http://jabber.org/protocol/pubsub'><value>1</value></field> 344 <field var='http://jabber.org/protocol/pubsub'><value>1</value></field>
305 </x> 345 </x>
306 </message> 346 </message>
307 ]]></example> 347 ]]></example>
308 <p>Here Juliet allows <em>pubsub.montaigu.lit</em> to manage the PubSub (and then PEP) service.</p> 348 <p>Here Juliet allows <em>pubsub.montaigu.lit</em> to manage the PubSub (and then PEP) service.</p>
309 <p>Finaly, the server notifies the entity of the granted delegation. For this it uses a &QUERY; element with the 'allowed' type, and puts the client JID in a 'from' attribute:</p> 349
310 <example caption='server notify accepted delegations'><![CDATA[ 350
311 <iq from='capulet.lit' to='pubsub.montaigu.lit' type='set' id='delegation2'> 351 <p>Finaly, the server notifies the entity of the granted delegation. It do this in the same way as for <link url='#admin_perm'>admin mode</link>, except that the &lt;delegation/&gt; element has an attitional 'to' attribute set to the managed entity bare jid:</p>
312 <query xmlns='urn:xmpp:delegation:0' 352 <example caption='server advertise delegated namespaces for juliet'><![CDATA[
313 type='allowed' 353 <message from='capulet.net' to='pubub.capulet.lit' id='6789'>
314 from='juliet@capulet.lit'> 354 <delegation xmlns='urn:xmpp:delegation:1' to='juliet@capulet.lit'>
315 <delegate namespace='http://jabber.org/protocol/pubsub'/> 355 <delegated namespace='http://jabber.org/protocol/pubsub'/>
316 </query> 356 </delegation>
317 </iq> 357 </message>
318 ]]></example> 358 ]]></example>
319 <p>The managing entity can now manage the namespace the same way as in <link url='#stanza_forward'>admin mode</link>.</p> 359 <p>The managing entity can now manage the namespace the same way as in <link url='#stanza_forward'>admin mode</link>.</p>
320 </section2> 360 </section2>
321 361
322 </section1> 362 </section1>
323 363
324 <section1 topic='Configuration' anchor='configuration'> 364 <section1 topic='Configuration' anchor='configuration'>
325 <p>Server SHOULD provide a way for clients to check already delegated namespaces, and revoke them by using &xep0050; on the well-defined command node <strong>'urn:xmpp:delegation:0#configure'</strong>.</p> 365 <p>Server SHOULD provide a way for clients to check already delegated namespaces, and revoke them by using &xep0050; on the well-defined command node <strong>'urn:xmpp:delegation:1#configure'</strong>.</p>
326 <p>If present, the configuration 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> 366 <p>If present, the configuration 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> 367 </section1>
328 368
329 <section1 topic='Discovering Support' anchor='disco'> 369 <section1 topic='Discovering Support' anchor='disco'>
330 <section2 topic='Announce' anchor='disco_announce'> 370 <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> 371 <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:1</em>" in response to a &xep0030; information request:</p>
332 <example caption="service discovery information request"><![CDATA[ 372 <example caption="service discovery information request"><![CDATA[
333 <iq from='pubsub.capulet.lit' 373 <iq from='pubsub.capulet.lit'
334 id='disco1' 374 id='disco1'
335 to='capulet.lit' 375 to='capulet.lit'
336 type='get'> 376 type='get'>
342 id='disco1' 382 id='disco1'
343 to='pubsub.capulet.lit' 383 to='pubsub.capulet.lit'
344 type='result'> 384 type='result'>
345 <query xmlns='http://jabber.org/protocol/disco#info'> 385 <query xmlns='http://jabber.org/protocol/disco#info'>
346 ... 386 ...
347 <feature var='urn:xmpp:delegation:0'/> 387 <feature var='urn:xmpp:delegation:1'/>
348 ... 388 ...
349 </query> 389 </query>
350 </iq> 390 </iq>
351 ]]></example> 391 ]]></example>
352 </section2> 392 </section2>
353 <section2 topic='Nesting' anchor='disco_nesting'> 393 <section2 topic='Nesting' anchor='disco_nesting'>
354 <section3 topic='General Case'> 394 <section3 topic='General Case'>
355 <p>When a server delegates a namespace to a managing entity, the later can have particular features which must be advertised by the former with disco protocol.</p> 395 <p>When a server delegates 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 the following way: if pubsub.capulet.int manages 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 reports the managed features.</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> 396 <p>This is done by using a disco node, which is done the following way: if pubsub.capulet.int manages pubsub namespace, it MUST report that fact in discovery feature, and have a '<strong>urn:xmpp:delegation:1::http://jabber.org/protocol/pubsub</strong>' node which reports the managed features.</p><p>The node name is obtained by concatenating this XEP namespace (<strong>urn:xmpp:delegation:1</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 delegates its internal PEP component to pubsub.capulet.int. capulet.int only supports REQUIRED PubSub features and auto-create, while pubsub.capulet.int supports REQUIRED PubSub features and publish-options, but not auto-create. <br/>juliet@capulet.int asks its server what it is capable of, she is specially interested in PubSub capabilities.</p> 397 <p>In the following example, the capulet.int server delegates its internal PEP component to pubsub.capulet.int. capulet.int only supports REQUIRED PubSub features and auto-create, while pubsub.capulet.int supports REQUIRED PubSub features and publish-options, but not auto-create. <br/>juliet@capulet.int asks its server what it is capable of, she is specially interested in PubSub capabilities.</p>
358 <example caption="Juliet asks her server its available features"><![CDATA[ 398 <example caption="Juliet asks her server its available features"><![CDATA[
359 <iq from='juliet@capulet.lit/balcony' 399 <iq from='juliet@capulet.lit/balcony'
360 id='disco1' 400 id='disco1'
361 to='capulet.lit' 401 to='capulet.lit'
369 <iq from='capulet.lit' 409 <iq from='capulet.lit'
370 id='disco2' 410 id='disco2'
371 to='pubsub.capulet.lit' 411 to='pubsub.capulet.lit'
372 type='get'> 412 type='get'>
373 <query xmlns='http://jabber.org/protocol/disco#info' 413 <query xmlns='http://jabber.org/protocol/disco#info'
374 node='urn:xmpp:delegation:0::http://jabber.org/protocol/pubsub'/> 414 node='urn:xmpp:delegation:1::http://jabber.org/protocol/pubsub'/>
375 </iq> 415 </iq>
376 ]]> 416 ]]>
377 </example> 417 </example>
378 <p>Note that in real situation, server has probably this information already in cache (see <link url='#impl'>Implementation Notes</link>).<br/> 418 <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> returns its available features:</p> 419 <em>pubsub.capulet.lit</em> returns its available features:</p>
381 <iq from='pubsub.capulet.lit' 421 <iq from='pubsub.capulet.lit'
382 id='disco2' 422 id='disco2'
383 to='capulet.lit' 423 to='capulet.lit'
384 type='result'> 424 type='result'>
385 <query xmlns='http://jabber.org/protocol/disco#info' 425 <query xmlns='http://jabber.org/protocol/disco#info'
386 node='urn:xmpp:delegation:0::http://jabber.org/protocol/pubsub'> 426 node='urn:xmpp:delegation:1::http://jabber.org/protocol/pubsub'>
387 <feature var='http://jabber.org/protocol/pubsub'/> 427 <feature var='http://jabber.org/protocol/pubsub'/>
388 <feature var='http://jabber.org/protocol/pubsub#publish'/> 428 <feature var='http://jabber.org/protocol/pubsub#publish'/>
389 <feature var='http://jabber.org/protocol/pubsub#subscribe'/> 429 <feature var='http://jabber.org/protocol/pubsub#subscribe'/>
390 <feature var='http://jabber.org/protocol/pubsub#publish-options'/> 430 <feature var='http://jabber.org/protocol/pubsub#publish-options'/>
391 </query> 431 </query>
397 <iq from='capulet.lit' 437 <iq from='capulet.lit'
398 id='disco1' 438 id='disco1'
399 to='juliet@capulet.lit/balcony' 439 to='juliet@capulet.lit/balcony'
400 type='result'> 440 type='result'>
401 <query xmlns='http://jabber.org/protocol/disco#info' 441 <query xmlns='http://jabber.org/protocol/disco#info'
402 node='urn:xmpp:delegation:0::http://jabber.org/protocol/pubsub'> 442 node='urn:xmpp:delegation:1::http://jabber.org/protocol/pubsub'>
403 <feature var='urn:xmpp:delegation:0'/> 443 <feature var='urn:xmpp:delegation:1'/>
404 ... 444 ...
405 <feature var='http://jabber.org/protocol/pubsub'/> 445 <feature var='http://jabber.org/protocol/pubsub'/>
406 <feature var='http://jabber.org/protocol/pubsub#publish'/> 446 <feature var='http://jabber.org/protocol/pubsub#publish'/>
407 <feature var='http://jabber.org/protocol/pubsub#subscribe'/> 447 <feature var='http://jabber.org/protocol/pubsub#subscribe'/>
408 <feature var='http://jabber.org/protocol/pubsub#publish-options'/> 448 <feature var='http://jabber.org/protocol/pubsub#publish-options'/>
410 </query> 450 </query>
411 </iq> 451 </iq>
412 ]]> 452 ]]>
413 </example> 453 </example>
414 <p>Note that '<em>http://jabber.org/protocol/pubsub#auto-create</em>' is not available.</p> 454 <p>Note that '<em>http://jabber.org/protocol/pubsub#auto-create</em>' is not available.</p>
455 <p><strong>N.B.:</strong> In the special case of attribute filtering, the server still display managing entity's features for the whole delegated namespace instead of its own internal ones.</p>
415 </section3> 456 </section3>
416 <section3 topic='Rediction Of Bare JID Disco Info'> 457 <section3 topic='Rediction Of Bare JID Disco Info'>
417 <p>As an entity may ask for discovery information on bare JID, which the server would answer, the managing entity must be able to send this kind of information.</p> 458 <p>As an entity may ask for discovery information 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> 459 <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 460
431 <iq from='capulet.lit' 472 <iq from='capulet.lit'
432 id='disco4' 473 id='disco4'
433 to='pubsub.capulet.lit' 474 to='pubsub.capulet.lit'
434 type='get'> 475 type='get'>
435 <query xmlns='http://jabber.org/protocol/disco#info' 476 <query xmlns='http://jabber.org/protocol/disco#info'
436 node='urn:xmpp:delegation:0:bare:http://jabber.org/protocol/pubsub'/> 477 node='urn:xmpp:delegation:1:bare:http://jabber.org/protocol/pubsub'/>
437 </iq> 478 </iq>
438 ]]> 479 ]]>
439 </example> 480 </example>
440 <p>As for general case, server has probably <link url='#impl'>this information already in cache</link>.<br/> 481 <p>As for general case, server has probably <link url='#impl'>this information already in cache</link>.<br/>
441 <em>pubsub.capulet.lit</em> returns its available features:</p> 482 <em>pubsub.capulet.lit</em> returns its available features:</p>
443 <iq from='pubsub.capulet.lit' 484 <iq from='pubsub.capulet.lit'
444 id='disco4' 485 id='disco4'
445 to='capulet.lit' 486 to='capulet.lit'
446 type='result'> 487 type='result'>
447 <query xmlns='http://jabber.org/protocol/disco#info' 488 <query xmlns='http://jabber.org/protocol/disco#info'
448 node='urn:xmpp:delegation:0:bare:http://jabber.org/protocol/pubsub'> 489 node='urn:xmpp:delegation:1:bare:http://jabber.org/protocol/pubsub'>
449 <identity category='pubsub' type='pep'/> 490 <identity category='pubsub' type='pep'/>
450 <feature var='http://jabber.org/protocol/pubsub#access-presence'/> 491 <feature var='http://jabber.org/protocol/pubsub#access-presence'/>
451 <feature var='http://jabber.org/protocol/pubsub#auto-create'/> 492 <feature var='http://jabber.org/protocol/pubsub#auto-create'/>
452 <feature var='http://jabber.org/protocol/pubsub#auto-subscribe'/> 493 <feature var='http://jabber.org/protocol/pubsub#auto-subscribe'/>
453 <feature var='http://jabber.org/protocol/pubsub#config-node'/> 494 <feature var='http://jabber.org/protocol/pubsub#config-node'/>
496 <section1 topic='Business Rules' anchor='rules'> 537 <section1 topic='Business Rules' anchor='rules'>
497 <ol> 538 <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 does so, it MUST provide configuration like explained in the <link url='#configuration'>suitable section</link>. If server offers this feature, it SHOULD add a field directly in configuration commands.</li> 539 <li>In client mode, server MAY keep delegations granted to an entity by a client from one session to an other, but if it does so, it MUST provide configuration like explained in the <link url='#configuration'>suitable section</link>. If server offers 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> 540 <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> 541 <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 requests it, the server MUST return a &forbidden; error.</li> 542 <li>If delegations are kept between sessions in client mode, and the managing entity is not available, the server MUST return an &IQ; error with condition &lt;service-unavailable/&gt; when a delegated namespace is requested, like explained in <link url='#stanza_forward'>"Server Forwards Delegated &IQ; Stanza" section</link>.</li>
543 <li>The namespace of this XEP (<strong>urn:xmpp:delegation:1</strong>) MUST NOT be delegated. If an entity requests it, the server MUST return a &forbidden; error.</li>
502 </ol> 544 </ol>
503 </section1> 545 </section1>
504 <section1 topic='Implementation Notes' anchor='impl'> 546 <section1 topic='Implementation Notes' anchor='impl'>
505 <ol> 547 <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> 548 <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> 549 <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>
550 <li>&rfc6120; section 10.1 require in-order processing of stanzas, which may be problematic for this extension: either the server blocks the traffic until the managing entity answer - which can lead to severe performance impact -, or the server doesn't block and may loose order. The recommended way is to not block the traffic while waiting for managing entity answer to avoid performance issues. A future version of this XEP may include an attribute to request traffic blocking. In admin mode the server implementation MAY chooses to have a blocking option (which SHOULD be per namespace, not global).
551 </li>
508 </ol> 552 </ol>
509 </section1> 553 </section1>
510 <section1 topic='Security Considerations' anchor='security'> 554 <section1 topic='Security Considerations' anchor='security'>
511 <ol> 555 <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> 556 <li>Managing entity can manage sensitive data, <em>admin</em> delegation should be granted carefuly, only if you absolutely trust the entity.</li>
518 <section1 topic='IANA Considerations' anchor='iana'> 562 <section1 topic='IANA Considerations' anchor='iana'>
519 <p>This document requires no interaction with &IANA;.</p> 563 <p>This document requires no interaction with &IANA;.</p>
520 </section1> 564 </section1>
521 <section1 topic='XMPP Registrar Considerations' anchor='registrar'> 565 <section1 topic='XMPP Registrar Considerations' anchor='registrar'>
522 <section2 topic='Protocol Namespaces' anchor='ns'> 566 <section2 topic='Protocol Namespaces' anchor='ns'>
523 <p>The &REGISTRAR; includes 'urn:xmpp:delegation:0' in its registry of protocol namespaces (see &NAMESPACES;).</p> 567 <p>The &REGISTRAR; includes 'urn:xmpp:delegation:1' in its registry of protocol namespaces (see &NAMESPACES;).</p>
524 <ul> 568 <ul>
525 <li>urn:xmpp:delegation:0</li> 569 <li>urn:xmpp:delegation:1</li>
526 </ul> 570 </ul>
527 </section2> 571 </section2>
528 <section2 topic='Protocol Versioning' anchor='registrar-versioning'> 572 <section2 topic='Protocol Versioning' anchor='registrar-versioning'>
529 &NSVER; 573 &NSVER;
530 </section2> 574 </section2>
533 <code><![CDATA[ 577 <code><![CDATA[
534 <?xml version='1.0' encoding='UTF-8'?> 578 <?xml version='1.0' encoding='UTF-8'?>
535 579
536 <xs:schema 580 <xs:schema
537 xmlns:xs='http://www.w3.org/2001/XMLSchema' 581 xmlns:xs='http://www.w3.org/2001/XMLSchema'
538 targetNamespace='urn:xmpp:delegation:0' 582 targetNamespace='urn:xmpp:delegation:1'
539 xmlns='urn:xmpp:delegation:0' 583 xmlns='urn:xmpp:delegation:1'
540 elementFormDefault='qualified'> 584 elementFormDefault='qualified'>
585
586 <xs:import namespace='urn:xmpp:forward:0'
587 schemaLocation='http://xmpp.org/schemas/forward.xsd'/>
541 588
542 <xs:element name='query'> 589 <xs:element name='query'>
543 <xs:complexType> 590 <xs:complexType>
544 <xs:attribute name='type' use='required'> 591 <xs:attribute name='to' use='required' type='xs:string'/>
545 <xs:simpleType base='xs:NMTOKEN'>
546 <xs:enumeration value='request'/>
547 <xs:enumeration value='allowed'/>
548 </xs:simpleType>
549 </xs:attribute> 592 </xs:attribute>
550 <xs:attribute name='delegation' use='optional'> 593 <xs:element name='delegate'
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'> 594 maxOccurs='unbounded'>
560 <xs:complexType> 595 <xs:complexType>
561 <xs:attribute name='namespace' use='required' type='xs:string'/> 596 <xs:attribute name='namespace' use='required' type='xs:string'/>
562 </xs:complexType> 597 </xs:complexType>
563 </xs:element> 598 </xs:element>
564 </xs:complexType> 599 </xs:complexType>
565 </xs:element> 600 </xs:element>
566 601
602 <xs:element name='delegation'>
603 <xs:complexType>
604 <xs:element ref='urn:xmpp:forward:0' minOccurs='0' maxOccurs='1' />
605 <xs:element name='delegated'
606 minOccurs='0'
607 maxOccurs='unbounded'>
608 <xs:complexType>
609 <xs:attribute name='namespace' use='required' type='xs:string'/>
610 <xs:element name='attribute'
611 minOccurs='0'
612 maxOccurs='unbounded'>
613 <xs:complexType>
614 <xs:attribute name='name' use='required' type='xs:string'/>
615 </xs:complexType>
616 </xs:element>
617 </xs:complexType>
618 </xs:element>
619 </xs:complexType>
620 </xs:element>
621
567 </xs:schema> 622 </xs:schema>
568 ]]></code> 623 ]]></code>
569 </section1> 624 </section1>
570 <section1 topic='Acknowledgements' anchor='acks'> 625 <section1 topic='Acknowledgements' anchor='acks'>
571 <p>This XEP is linked with &xep0356; and works in a similar way.</p> 626 <p>This XEP is linked with &xep0356; and works in a similar way.</p>
572 <p>The client mode delegation mechanism is inspired from &xep0321; permission request.</p> 627 <p>The client mode delegation mechanism is inspired from &xep0321; permission request.</p>
573 <p>Thanks to Adrien Cossa for his typos/style corrections</p> 628 <p>Thanks to Adrien Cossa for his typos/style corrections</p>
629 <p>Thanks to Philipp Hancke, Dave Cridland, Kurt Zeilenga and Sergey Dobrov for their feedbacks.</p>
574 </section1> 630 </section1>
575 </xep> 631 </xep>