Mercurial > sat_docs
annotate xmpp/xep-proto-namespace-delegation.xml @ 38:57dfd2ab2881
association: updated location (article 3) in statuts
author | Goffi <goffi@goffi.org> |
---|---|
date | Thu, 05 Feb 2015 11:56:47 +0100 |
parents | db9316a75306 |
children |
rev | line source |
---|---|
30 | 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 "Specification"), 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 "AS IS" 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 <<link url='http://xmpp.org/extensions/ipr-policy.shtml'>http://xmpp.org/extensions/ipr-policy.shtml</link>> 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> | |
34
db9316a75306
XEP: updated privileged entity according to discussions following the council's veto (see http://mail.jabber.org/pipermail/standards/2014-December/029378.html):
Goffi <goffi@goffi.org>
parents:
33
diff
changeset
|
38 <version>0.0.2</version> |
db9316a75306
XEP: updated privileged entity according to discussions following the council's veto (see http://mail.jabber.org/pipermail/standards/2014-December/029378.html):
Goffi <goffi@goffi.org>
parents:
33
diff
changeset
|
39 <date>2014-11-27</date> |
db9316a75306
XEP: updated privileged entity according to discussions following the council's veto (see http://mail.jabber.org/pipermail/standards/2014-December/029378.html):
Goffi <goffi@goffi.org>
parents:
33
diff
changeset
|
40 <initials>jp</initials> |
db9316a75306
XEP: updated privileged entity according to discussions following the council's veto (see http://mail.jabber.org/pipermail/standards/2014-December/029378.html):
Goffi <goffi@goffi.org>
parents:
33
diff
changeset
|
41 <remark><p></p></remark> |
db9316a75306
XEP: updated privileged entity according to discussions following the council's veto (see http://mail.jabber.org/pipermail/standards/2014-December/029378.html):
Goffi <goffi@goffi.org>
parents:
33
diff
changeset
|
42 </revision> |
db9316a75306
XEP: updated privileged entity according to discussions following the council's veto (see http://mail.jabber.org/pipermail/standards/2014-December/029378.html):
Goffi <goffi@goffi.org>
parents:
33
diff
changeset
|
43 <revision> |
30 | 44 <version>0.0.1</version> |
45 <date>2014-11-13</date> | |
46 <initials>jp</initials> | |
47 <remark><p>First draft.</p></remark> | |
48 </revision> | |
49 </header> | |
50 <section1 topic='Introduction' anchor='intro'> | |
32 | 51 <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> |
52 <p>This XEP is complementary to priviliged entity XEP (and works in a similar way), although they can be used together or separately.</p> | |
30 | 53 <p>Here are some use cases of namespace delegation:</p> |
54 <ul> | |
32 | 55 <li>use an external component for a PEP service because the server doesn't implement it or lacks some features</li> |
30 | 56 <li>decentralize a server feature to an entity under client control</li> |
32 | 57 <li>make a component which react on new user registration, independent of server implementation</li> |
30 | 58 <li>server agnostic roster filtering</li> |
59 </ul> | |
60 </section1> | |
61 <section1 topic='Requirements' anchor='reqs'> | |
62 <p>Namespace delegation can be used in two modes:</p> | |
63 <ul> | |
64 <li><strong>admin</strong> mode, where delegation is specified by the server administrator.</li> | |
65 <li><strong>client</strong> mode, where it can be requested by any user.</li> | |
66 </ul> | |
32 | 67 <p>In <em>admin</em> mode, the managing entity manages stanza of the delegated namespace for all users registered on the server. The namespace delegation MUST be totally transparent for the managed entities.</p> |
68 <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> | |
30 | 69 </section1> |
70 <section1 topic='Glossary' anchor='glossary'> | |
71 <ul> | |
72 <li><strong>Delegated namespace</strong> — the namespace being managed by an external entity.</li> | |
32 | 73 <li><strong>Managing entity</strong> — the entity which actualy manages the delegated namespace.</li> |
30 | 74 <li><strong>Managed entity</strong> — an entity which wants to have a namespace of its server delegated to a managing entity.</li> |
75 </ul> | |
76 </section1> | |
77 <section1 topic='Admin Mode Use Cases' anchor='admin_usecases'> | |
78 | |
79 <section2 topic='Delegation Request Use Case' anchor='admin_perm'> | |
32 | 80 <section3 topic='Entity Requests Namespace Delegation' anchor='req_delegation'> |
34
db9316a75306
XEP: updated privileged entity according to discussions following the council's veto (see http://mail.jabber.org/pipermail/standards/2014-December/029378.html):
Goffi <goffi@goffi.org>
parents:
33
diff
changeset
|
81 <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 MAY have a 'delegation' attribute with the value "admin".</p> |
32 | 82 <p>Namespace delegations are asked with a <delegate/> element, which MUST contain a 'namespace' attribute set to the requested namespace.</p> |
30 | 83 <p>Only <iq/> stanza namespaces can be delegated.</p> |
84 <example caption='entity asks for delegation in admin mode'><![CDATA[ | |
85 <iq from='pubsub.capulet.lit' type='get' id='delegation1'> | |
34
db9316a75306
XEP: updated privileged entity according to discussions following the council's veto (see http://mail.jabber.org/pipermail/standards/2014-December/029378.html):
Goffi <goffi@goffi.org>
parents:
33
diff
changeset
|
86 <query xmlns='urn:xmpp:delegation:0' delegation='admin'> |
30 | 87 <delegate namespace='jabber:iq:roster'/> |
88 <delegate namespace='http://jabber.org/protocol/pubsub'/> | |
89 </query> | |
90 </iq> | |
91 ]]></example> | |
92 </section3> | |
32 | 93 <section3 topic='Server Accepts Namespace Delegation' anchor='accept_delegation'> |
94 <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 <delegate> elements:</p> | |
30 | 95 <example caption='server accept namespace delegations'><![CDATA[ |
96 <iq from='capulet.lit' to='pubsub.capulet.lit' type='result' id='delegation1'> | |
34
db9316a75306
XEP: updated privileged entity according to discussions following the council's veto (see http://mail.jabber.org/pipermail/standards/2014-December/029378.html):
Goffi <goffi@goffi.org>
parents:
33
diff
changeset
|
97 <query xmlns='urn:xmpp:delegation:0'> |
30 | 98 <delegate namespace='jabber:iq:roster'> |
99 <delegate namespace='http://jabber.org/protocol/pubsub'> | |
100 </query> | |
101 </iq> | |
102 ]]></example> | |
103 <p>Note: the granted delegations MAY be different from the requested ones, according to server's configuration.</p> | |
32 | 104 <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/> |
105 The server MUST NOT forward any request made to an other entity than itself or to a bare JID within its domain.</p> | |
30 | 106 </section3> |
32 | 107 <section3 topic='Server Rejects Namespace Delegation' anchor='reject_delegation'> |
108 <p>If the server rejects the delegation, it MUST return a &forbidden; error:</p> | |
30 | 109 <example caption='server reject delegation'><![CDATA[ |
110 <iq from='capulet.lit' to='pubsub.capulet.lit' type='error' id='delegation1'> | |
111 <error type='cancel'> | |
112 <forbidden xmlns='urn:ietf:params:xml:ns:xmpp-stanzas'/> | |
113 </error> | |
114 </iq> | |
115 ]]></example> | |
116 </section3> | |
117 </section2> | |
118 | |
32 | 119 <section2 topic='Server Forwards Delegated &IQ; Stanza' anchor='stanza_forward'> |
120 <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> | |
121 <example caption='Juliet sends her mood to her server via PEP'><![CDATA[ | |
30 | 122 <iq from='juliet@capulet.lit/balcony' |
123 id='pep1' | |
124 type='set'> | |
125 <pubsub xmlns='http://jabber.org/protocol/pubsub'> | |
126 <publish node='http://jabber.org/protocol/mood'> | |
127 <item> | |
128 <mood xmlns='http://jabber.org/protocol/mood'> | |
129 <annoyed/> | |
130 <text>curse my nurse!</text> | |
131 </mood> | |
132 </item> | |
133 </publish> | |
134 </pubsub> | |
135 </iq> | |
136 ]]></example> | |
32 | 137 <p>The server gets this stanza, sees that this namespace is delegated to <em>pubsub.capulet.lit</em>, so it forwards it:</p> |
30 | 138 |
32 | 139 <example caption='server delegate the stanza to pubsub.capulet.lit'><![CDATA[ |
30 | 140 <iq from='juliet@capulet.lit/balcony' |
141 to='pubsub.capulet.lit' | |
142 id='delegate1' | |
143 type='set'> | |
144 <pubsub xmlns='http://jabber.org/protocol/pubsub'> | |
145 <publish node='http://jabber.org/protocol/mood'> | |
146 <item> | |
147 <mood xmlns='http://jabber.org/protocol/mood'> | |
148 <annoyed/> | |
149 <text>curse my nurse!</text> | |
150 </mood> | |
151 </item> | |
152 </publish> | |
153 </pubsub> | |
154 </iq> | |
155 ]]></example> | |
156 | |
32 | 157 <p>The managing entity replies normally to the stanza:</p> |
158 <example caption='pubsub.capulet.lit replies to Juliet'><![CDATA[ | |
30 | 159 <iq from='pubsub.capulet.lit' |
32 | 160 to='juliet@capulet.lit/balcony' |
30 | 161 id='delegate1' |
162 type='result'> | |
163 <pubsub xmlns='http://jabber.org/protocol/pubsub' /> | |
164 </iq> | |
165 ]]></example> | |
166 | |
32 | 167 <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> |
30 | 168 |
32 | 169 <example caption='capulet.lit replies to Juliet'><![CDATA[ |
30 | 170 <iq from='capulet.lit' |
32 | 171 to='juliet@capulet.lit/balcony' |
30 | 172 id='pep1' |
173 type='result'> | |
174 <pubsub xmlns='http://jabber.org/protocol/pubsub' /> | |
175 </iq> | |
176 ]]></example> | |
177 | |
32 | 178 <p>The workflow is fully transparent for Juliet.</p> |
30 | 179 <section3 topic='Stanzas from managing entity' anchor='managing_entity_stanzas'> |
32 | 180 <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> |
181 <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> | |
30 | 182 |
32 | 183 <example caption='Juliet adds Romeo to her roster'><![CDATA[ |
30 | 184 <iq from='juliet@capulet.lit/balcony' |
185 id='roster1' | |
186 type='set'> | |
187 <query xmlns='jabber:iq:roster'> | |
188 <item jid='romeo@montaigu.lit' | |
189 name='My Romeo'> | |
190 </item> | |
191 </query> | |
192 </iq> | |
193 ]]></example> | |
194 | |
32 | 195 <example caption='server forwards stanza to managing entity'><![CDATA[ |
30 | 196 <iq from='juliet@capulet.lit/balcony' |
197 to='filter.capulet.lit' | |
198 id='delegate1' | |
199 type='set'> | |
200 <query xmlns='jabber:iq:roster'> | |
201 <item jid='romeo@montaigu.lit' | |
202 name='My Romeo'> | |
203 </item> | |
204 </query> | |
205 </iq> | |
206 ]]></example> | |
207 | |
32 | 208 <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> |
30 | 209 <example caption='filtering component accept Romeo'><![CDATA[ |
210 <iq from='filter.capulet.lit' | |
211 to='juliet@capulet.lit/balcony' | |
212 id='delegate1' | |
213 type='result' /> | |
214 ]]></example> | |
215 <example caption='server forward the result with the initial id'><![CDATA[ | |
216 <iq to='juliet@capulet.lit/balcony' | |
217 id='roster1' | |
218 type='result' /> | |
219 ]]></example> | |
220 | |
32 | 221 <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> |
222 <example caption='filter.capulet.lit uses privileged entity to add Romeo'><![CDATA[ | |
30 | 223 <iq to='juliet@capulet.lit' |
224 from='filter.capulet.lit' | |
225 id='roster2' | |
226 type='set'> | |
227 <query xmlns='jabber:iq:roster'> | |
228 <item jid='romeo@montaigu.lit' | |
229 name='My Romeo'> | |
230 <group>Rivals</group> | |
231 </item> | |
232 </query> | |
233 </iq> | |
234 ]]></example> | |
32 | 235 <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> |
30 | 236 |
237 <example caption='server accept new entity in roster'><![CDATA[ | |
238 <iq to='filter.capulet.lit' | |
239 from='juliet@capulet.lit' | |
240 id='roster2' | |
241 type='result'/> | |
242 ]]></example> | |
243 | |
244 <p>The server will then send the roster pushes (with the enforced group) normally.</p> | |
245 | |
246 </section3> | |
247 | |
248 </section2> | |
249 | |
250 | |
251 </section1> | |
252 | |
253 <section1 topic='Client Mode Use Cases' anchor='client_usecases'> | |
254 <section2 topic='Client Delegation Request Use Case' anchor='client_delegation'> | |
255 <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> | |
256 <ol> | |
257 <li>the delegation type is <em>client</em> instead of <em>admin</em></li> | |
258 <li>the delegation is done per entity, so the managed entity MUST be specified in a 'to' attribute</li> | |
259 </ol> | |
32 | 260 <p>If an entity want to manage PEP service for Juliet, it can ask the delegation like this: |
30 | 261 </p> |
262 <example caption='managing entity asks for namespace delegation for one particular entity'><![CDATA[ | |
263 <iq from='pubsub.montaigu.lit' to='capulet.lit' type='get' id='delegation1'> | |
264 <query xmlns='urn:xmpp:delegation:0' | |
265 delegation='client' | |
266 to='juliet@capulet.lit'> | |
267 <delegate namespace='http://jabber.org/protocol/pubsub'/> | |
268 </query> | |
269 </iq> | |
270 ]]></example> | |
271 <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. | |
272 </p> | |
273 <example caption='server asks user for the namespace delegation'><![CDATA[ | |
274 <message from='capulet.lit' to='juliet@capulet.lit'> | |
275 <body> | |
276 pubsub.montaigu.lit wants to manage a feature normally managed by the server. | |
32 | 277 Do you allow it to manage the following features? |
30 | 278 |
32 | 279 Be careful! According management to an entity is a serious thing, |
30 | 280 think twice that you can trust the entity before doing this. |
281 </body> | |
282 <x xmlns='jabber:x:data' type='form'> | |
283 <title>Delegation request</title> | |
284 <instructions>pubsub.montaigu.lit wants to manage the following features: | |
285 Do you allow it?</instructions> | |
286 <field type='hidden' var='challenge'><value>5439123</value></field> | |
287 <field type='hidden' var='FORM_TYPE'> | |
288 <value>urn:xmpp:delegation:0</value> | |
289 </field> | |
290 <field type='list-single' | |
291 label='Manage PubSub (http://jabber.org/protocol/pubsub)' | |
292 var='http://jabber.org/protocol/pubsub'> | |
293 <value>0</value> | |
294 <option label='No'><value>0</value></option> | |
295 <option label='Yes'><value>1</value></option> | |
296 </field> | |
297 </x> | |
298 </message> | |
299 ]]></example> | |
300 <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> | |
301 <p>The client can then answer to the form:</p> | |
302 <example caption='client answer to the form'><![CDATA[ | |
303 <message from='juliet@capulet.lit' to='capulet.lit'> | |
304 <x xmlns='jabber:x:data' type='submit'> | |
305 <field var='FORM_TYPE'> | |
306 <value></value> | |
307 </field> | |
308 <field var='challenge'><value>5439123</value></field> | |
309 <field var='http://jabber.org/protocol/pubsub'><value>1</value></field> | |
310 </x> | |
311 </message> | |
312 ]]></example> | |
32 | 313 <p>Here Juliet allows <em>pubsub.montaigu.lit</em> to manage the PubSub (and then PEP) service.</p> |
34
db9316a75306
XEP: updated privileged entity according to discussions following the council's veto (see http://mail.jabber.org/pipermail/standards/2014-December/029378.html):
Goffi <goffi@goffi.org>
parents:
33
diff
changeset
|
314 <p>Finaly, the server notifies the entity of the granted delegation. For this it uses a &QUERY; element with the client JID in a 'from' attribute:</p> |
30 | 315 <example caption='server notify accepted delegations'><![CDATA[ |
316 <iq from='capulet.lit' to='pubsub.montaigu.lit' type='set' id='delegation2'> | |
34
db9316a75306
XEP: updated privileged entity according to discussions following the council's veto (see http://mail.jabber.org/pipermail/standards/2014-December/029378.html):
Goffi <goffi@goffi.org>
parents:
33
diff
changeset
|
317 <query xmlns='urn:xmpp:delegation:0' from='juliet@capulet.lit'> |
30 | 318 <delegate namespace='http://jabber.org/protocol/pubsub'/> |
319 </query> | |
320 </iq> | |
321 ]]></example> | |
322 <p>The managing entity can now manage the namespace the same way as in <link url='#stanza_forward'>admin mode</link>.</p> | |
323 </section2> | |
324 | |
325 </section1> | |
326 | |
327 <section1 topic='Configuration' anchor='configuration'> | |
32 | 328 <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> |
329 <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> | |
30 | 330 </section1> |
331 | |
332 <section1 topic='Discovering Support' anchor='disco'> | |
333 <section2 topic='Announce' anchor='disco_announce'> | |
334 <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> | |
335 <example caption="service discovery information request"><![CDATA[ | |
336 <iq from='pubsub.capulet.lit' | |
337 id='disco1' | |
338 to='capulet.lit' | |
339 type='get'> | |
340 <query xmlns='http://jabber.org/protocol/disco#info'/> | |
341 </iq> | |
342 ]]></example> | |
343 <example caption="service discovery information response"><![CDATA[ | |
344 <iq from='capulet.lit' | |
345 id='disco1' | |
346 to='pubsub.capulet.lit' | |
347 type='result'> | |
348 <query xmlns='http://jabber.org/protocol/disco#info'> | |
349 ... | |
350 <feature var='urn:xmpp:delegation:0'/> | |
351 ... | |
352 </query> | |
353 </iq> | |
354 ]]></example> | |
355 </section2> | |
356 <section2 topic='Nesting' anchor='disco_nesting'> | |
357 <section3 topic='General Case'> | |
32 | 358 <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> |
359 <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> | |
360 <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> | |
361 <example caption="Juliet asks her server its available features"><![CDATA[ | |
30 | 362 <iq from='juliet@capulet.lit/balcony' |
363 id='disco1' | |
364 to='capulet.lit' | |
365 type='get'> | |
366 <query xmlns='http://jabber.org/protocol/disco#info'/> | |
367 </iq> | |
368 ]]> | |
369 </example> | |
32 | 370 <p>Server delegates its PubSub namespace to <em>pubsub.capulet.lit</em>, so it asks its available features for this namespace like this:</p> |
371 <example caption="capulet.lit requests disco infos for pubsub namespace to pubsub.capulet.lit"><![CDATA[ | |
30 | 372 <iq from='capulet.lit' |
373 id='disco2' | |
374 to='pubsub.capulet.lit' | |
375 type='get'> | |
376 <query xmlns='http://jabber.org/protocol/disco#info' | |
377 node='urn:xmpp:delegation:0::http://jabber.org/protocol/pubsub'/> | |
378 </iq> | |
379 ]]> | |
380 </example> | |
381 <p>Note that in real situation, server has probably this information already in cache (see <link url='#impl'>Implementation Notes</link>).<br/> | |
32 | 382 <em>pubsub.capulet.lit</em> returns its available features:</p> |
30 | 383 <example caption="pubsub.capulet.lit returns features to nest"><![CDATA[ |
384 <iq from='pubsub.capulet.lit' | |
385 id='disco2' | |
386 to='capulet.lit' | |
387 type='result'> | |
388 <query xmlns='http://jabber.org/protocol/disco#info' | |
389 node='urn:xmpp:delegation:0::http://jabber.org/protocol/pubsub'> | |
390 <feature var='http://jabber.org/protocol/pubsub'/> | |
391 <feature var='http://jabber.org/protocol/pubsub#publish'/> | |
392 <feature var='http://jabber.org/protocol/pubsub#subscribe'/> | |
393 <feature var='http://jabber.org/protocol/pubsub#publish-options'/> | |
394 </query> | |
395 </iq> | |
396 ]]> | |
397 </example> | |
398 <p>Server include the results in its own discovery info results:</p> | |
399 <example caption="capulet.lit return disco info including features from pubsub.capulet.lit"><![CDATA[ | |
400 <iq from='capulet.lit' | |
401 id='disco1' | |
402 to='juliet@capulet.lit/balcony' | |
403 type='result'> | |
404 <query xmlns='http://jabber.org/protocol/disco#info' | |
405 node='urn:xmpp:delegation:0::http://jabber.org/protocol/pubsub'> | |
406 <feature var='urn:xmpp:delegation:0'/> | |
407 ... | |
408 <feature var='http://jabber.org/protocol/pubsub'/> | |
409 <feature var='http://jabber.org/protocol/pubsub#publish'/> | |
410 <feature var='http://jabber.org/protocol/pubsub#subscribe'/> | |
411 <feature var='http://jabber.org/protocol/pubsub#publish-options'/> | |
412 ... | |
413 </query> | |
414 </iq> | |
415 ]]> | |
416 </example> | |
417 <p>Note that '<em>http://jabber.org/protocol/pubsub#auto-create</em>' is not available.</p> | |
418 </section3> | |
32 | 419 <section3 topic='Rediction Of Bare JID Disco Info'> |
420 <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> | |
30 | 421 <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> |
422 | |
32 | 423 <example caption="Juliet asks features for its own bare JID"><![CDATA[ |
30 | 424 <iq from='juliet@capulet.lit/balcony' |
425 id='disco3' | |
426 to='juliet@capulet.lit' | |
427 type='get'> | |
428 <query xmlns='http://jabber.org/protocol/disco#info'/> | |
429 </iq> | |
430 ]]> | |
431 </example> | |
32 | 432 <p>Server delegate its PubSub namespace to <em>pubsub.capulet.lit</em>, so it ask its available features for this namespace like this:</p> |
433 <example caption="capulet.lit requests disco infos for pubsub namespace to pubsub.capulet.lit"><![CDATA[ | |
30 | 434 <iq from='capulet.lit' |
435 id='disco4' | |
436 to='pubsub.capulet.lit' | |
437 type='get'> | |
438 <query xmlns='http://jabber.org/protocol/disco#info' | |
439 node='urn:xmpp:delegation:0:bare:http://jabber.org/protocol/pubsub'/> | |
440 </iq> | |
441 ]]> | |
442 </example> | |
443 <p>As for general case, server has probably <link url='#impl'>this information already in cache</link>.<br/> | |
32 | 444 <em>pubsub.capulet.lit</em> returns its available features:</p> |
30 | 445 <example caption="pubsub.capulet.lit returns features to nest"><![CDATA[ |
446 <iq from='pubsub.capulet.lit' | |
447 id='disco4' | |
448 to='capulet.lit' | |
449 type='result'> | |
450 <query xmlns='http://jabber.org/protocol/disco#info' | |
451 node='urn:xmpp:delegation:0:bare:http://jabber.org/protocol/pubsub'> | |
452 <identity category='pubsub' type='pep'/> | |
453 <feature var='http://jabber.org/protocol/pubsub#access-presence'/> | |
454 <feature var='http://jabber.org/protocol/pubsub#auto-create'/> | |
455 <feature var='http://jabber.org/protocol/pubsub#auto-subscribe'/> | |
456 <feature var='http://jabber.org/protocol/pubsub#config-node'/> | |
457 <feature var='http://jabber.org/protocol/pubsub#create-and-configure'/> | |
458 <feature var='http://jabber.org/protocol/pubsub#create-nodes'/> | |
459 <feature var='http://jabber.org/protocol/pubsub#filtered-notifications'/> | |
460 <feature var='http://jabber.org/protocol/pubsub#persistent-items'/> | |
461 <feature var='http://jabber.org/protocol/pubsub#publish'/> | |
462 <feature var='http://jabber.org/protocol/pubsub#retrieve-items'/> | |
463 <feature var='http://jabber.org/protocol/pubsub#subscribe'/> | |
464 ... | |
465 </query> | |
466 </iq> | |
467 ]]> | |
468 </example> | |
32 | 469 <p>Then the server returns the answer to Juliet, as in general case, with requested bare JID in 'from' field.</p> |
470 <example caption="capulet.lit returns disco info to Juliet"><![CDATA[ | |
30 | 471 <iq from='juliet@capulet.lit' |
472 id='disco3' | |
473 to='juliet@capulet.lit/balcony' | |
474 type='result'> | |
475 <query xmlns='http://jabber.org/protocol/disco#info'> | |
476 <identity category='account' type='registered'/> | |
477 <identity category='pubsub' type='pep'/> | |
478 <feature var='http://jabber.org/protocol/pubsub#access-presence'/> | |
479 <feature var='http://jabber.org/protocol/pubsub#auto-create'/> | |
480 <feature var='http://jabber.org/protocol/pubsub#auto-subscribe'/> | |
481 <feature var='http://jabber.org/protocol/pubsub#config-node'/> | |
482 <feature var='http://jabber.org/protocol/pubsub#create-and-configure'/> | |
483 <feature var='http://jabber.org/protocol/pubsub#create-nodes'/> | |
484 <feature var='http://jabber.org/protocol/pubsub#filtered-notifications'/> | |
485 <feature var='http://jabber.org/protocol/pubsub#persistent-items'/> | |
486 <feature var='http://jabber.org/protocol/pubsub#publish'/> | |
487 <feature var='http://jabber.org/protocol/pubsub#retrieve-items'/> | |
488 <feature var='http://jabber.org/protocol/pubsub#subscribe'/> | |
489 ... | |
490 </query> | |
491 </iq> | |
492 ]]> | |
493 </example> | |
494 | |
495 </section3> | |
496 </section2> | |
497 </section1> | |
498 | |
499 <section1 topic='Business Rules' anchor='rules'> | |
500 <ol> | |
32 | 501 <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> |
30 | 502 <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> |
32 | 503 <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> |
504 <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> | |
30 | 505 </ol> |
506 </section1> | |
507 <section1 topic='Implementation Notes' anchor='impl'> | |
508 <ol> | |
509 <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> | |
510 <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> | |
511 </ol> | |
512 </section1> | |
513 <section1 topic='Security Considerations' anchor='security'> | |
514 <ol> | |
515 <li>Managing entity can manage sensitive data, <em>admin</em> delegation should be granted carefuly, only if you absolutely trust the entity.</li> | |
32 | 516 <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> |
30 | 517 |
32 | 518 <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> |
30 | 519 </ol> |
520 </section1> | |
521 <section1 topic='IANA Considerations' anchor='iana'> | |
522 <p>This document requires no interaction with &IANA;.</p> | |
523 </section1> | |
524 <section1 topic='XMPP Registrar Considerations' anchor='registrar'> | |
525 <section2 topic='Protocol Namespaces' anchor='ns'> | |
526 <p>The ®ISTRAR; includes 'urn:xmpp:delegation:0' in its registry of protocol namespaces (see &NAMESPACES;).</p> | |
527 <ul> | |
528 <li>urn:xmpp:delegation:0</li> | |
529 </ul> | |
530 </section2> | |
531 <section2 topic='Protocol Versioning' anchor='registrar-versioning'> | |
532 &NSVER; | |
533 </section2> | |
534 </section1> | |
535 <section1 topic='XML Schema' anchor='schema'> | |
536 <code><![CDATA[ | |
537 <?xml version='1.0' encoding='UTF-8'?> | |
538 | |
539 <xs:schema | |
540 xmlns:xs='http://www.w3.org/2001/XMLSchema' | |
541 targetNamespace='urn:xmpp:delegation:0' | |
542 xmlns='urn:xmpp:delegation:0' | |
543 elementFormDefault='qualified'> | |
544 | |
545 <xs:element name='query'> | |
546 <xs:complexType> | |
547 <xs:attribute name='delegation' use='optional'> | |
548 <xs:simpleType base='xs:NMTOKEN'> | |
549 <xs:enumeration value='admin'/> | |
550 <xs:enumeration value='client'/> | |
551 </xs:simpleType> | |
552 </xs:attribute> | |
553 <xs:attribute name='to' use='optional' type='xs:string'/> | |
554 </xs:attribute> | |
555 <xs:element name='delegation' | |
556 maxOccurs='unbounded'> | |
557 <xs:complexType> | |
558 <xs:attribute name='namespace' use='required' type='xs:string'/> | |
559 </xs:complexType> | |
560 </xs:element> | |
561 </xs:complexType> | |
562 </xs:element> | |
563 | |
564 </xs:schema> | |
565 ]]></code> | |
566 </section1> | |
567 <section1 topic='Acknowledgements' anchor='acks'> | |
568 <p>This XEP is linked with XEP-XXXX privileged entity and works in a similar way.</p> | |
569 <p>The client mode delegation mechanism is inspired from &xep0321; permission request.</p> | |
33
b70084aa0af7
xeps: added thanks to souliane for his corrections
Goffi <goffi@goffi.org>
parents:
32
diff
changeset
|
570 <p>Thanks to Adrien Cossa for his typos/style corrections</p> |
30 | 571 </section1> |
572 </xep> |