comparison xmpp/xep-proto-namespace-delegation.xml @ 32:a3f262d5b594

xeps: typos/style fixes
author souliane <souliane@mailoo.org>
date Tue, 18 Nov 2014 13:20:14 +0100
parents b04be960ebdf
children b70084aa0af7
comparison
equal deleted inserted replaced
31:91d56a6e4b0d 32:a3f262d5b594
40 <initials>jp</initials> 40 <initials>jp</initials>
41 <remark><p>First draft.</p></remark> 41 <remark><p>First draft.</p></remark>
42 </revision> 42 </revision>
43 </header> 43 </header>
44 <section1 topic='Introduction' anchor='intro'> 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> 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>
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> 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>
47 <p>Here are some use cases of namespace delegation:</p> 47 <p>Here are some use cases of namespace delegation:</p>
48 <ul> 48 <ul>
49 <li>use an external component for a PEP service because the server doesn't implement it or lack some features</li> 49 <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> 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> 51 <li>make a component which react on new user registration, independent of server implementation</li>
52 <li>server agnostic roster filtering</li> 52 <li>server agnostic roster filtering</li>
53 </ul> 53 </ul>
54 </section1> 54 </section1>
55 <section1 topic='Requirements' anchor='reqs'> 55 <section1 topic='Requirements' anchor='reqs'>
56 <p>Namespace delegation can be used in two modes:</p> 56 <p>Namespace delegation can be used in two modes:</p>
57 <ul> 57 <ul>
58 <li><strong>admin</strong> mode, where delegation is specified by the server administrator.</li> 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> 59 <li><strong>client</strong> mode, where it can be requested by any user.</li>
60 </ul> 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> 61 <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>
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> 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>
63 </section1> 63 </section1>
64 <section1 topic='Glossary' anchor='glossary'> 64 <section1 topic='Glossary' anchor='glossary'>
65 <ul> 65 <ul>
66 <li><strong>Delegated namespace</strong> — the namespace being managed by an external entity.</li> 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> 67 <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> 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> 69 </ul>
70 </section1> 70 </section1>
71 <section1 topic='Admin Mode Use Cases' anchor='admin_usecases'> 71 <section1 topic='Admin Mode Use Cases' anchor='admin_usecases'>
72 72
73 <section2 topic='Delegation Request Use Case' anchor='admin_perm'> 73 <section2 topic='Delegation Request Use Case' anchor='admin_perm'>
74 <section3 topic='Entity Request Delegation Of Namespaces' anchor='req_delegation'> 74 <section3 topic='Entity Requests Namespace Delegation' 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> 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>
76 <p>Namespace delegations are asked with a &lt;delegate/&gt; element, which MUST contain a 'namespace' attribute set to the requested namespace</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> 77 <p>Only &lt;iq/&gt; stanza namespaces can be delegated.</p>
78 <example caption='entity asks for delegation in admin mode'><![CDATA[ 78 <example caption='entity asks for delegation in admin mode'><![CDATA[
79 <iq from='pubsub.capulet.lit' type='get' id='delegation1'> 79 <iq from='pubsub.capulet.lit' type='get' id='delegation1'>
80 <query xmlns='urn:xmpp:delegation:0' type='request' delegation='admin'> 80 <query xmlns='urn:xmpp:delegation:0' type='request' delegation='admin'>
81 <delegate namespace='jabber:iq:roster'/> 81 <delegate namespace='jabber:iq:roster'/>
82 <delegate namespace='http://jabber.org/protocol/pubsub'/> 82 <delegate namespace='http://jabber.org/protocol/pubsub'/>
83 </query> 83 </query>
84 </iq> 84 </iq>
85 ]]></example> 85 ]]></example>
86 </section3> 86 </section3>
87 <section3 topic='Server Accept Namespace Delegation' anchor='accept_delegation'> 87 <section3 topic='Server Accepts 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> 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[ 89 <example caption='server accept namespace delegations'><![CDATA[
90 <iq from='capulet.lit' to='pubsub.capulet.lit' type='result' id='delegation1'> 90 <iq from='capulet.lit' to='pubsub.capulet.lit' type='result' id='delegation1'>
91 <query xmlns='urn:xmpp:delegation:0' type='allowed'> 91 <query xmlns='urn:xmpp:delegation:0' type='allowed'>
92 <delegate namespace='jabber:iq:roster'> 92 <delegate namespace='jabber:iq:roster'>
93 <delegate namespace='http://jabber.org/protocol/pubsub'> 93 <delegate namespace='http://jabber.org/protocol/pubsub'>
94 </query> 94 </query>
95 </iq> 95 </iq>
96 ]]></example> 96 ]]></example>
97 <p>Note: the granted delegations MAY be different from the requested ones, according to server's configuration.</p> 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/> 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 done to an other entity than itself or a bare jid with its domain.</p> 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> 100 </section3>
101 <section3 topic='Server Reject Namespace Delegation' anchor='reject_delegation'> 101 <section3 topic='Server Rejects Namespace Delegation' anchor='reject_delegation'>
102 <p>If the server reject the delegation, it MUST return a &forbidden; error:</p> 102 <p>If the server rejects the delegation, it MUST return a &forbidden; error:</p>
103 <example caption='server reject delegation'><![CDATA[ 103 <example caption='server reject delegation'><![CDATA[
104 <iq from='capulet.lit' to='pubsub.capulet.lit' type='error' id='delegation1'> 104 <iq from='capulet.lit' to='pubsub.capulet.lit' type='error' id='delegation1'>
105 <error type='cancel'> 105 <error type='cancel'>
106 <forbidden xmlns='urn:ietf:params:xml:ns:xmpp-stanzas'/> 106 <forbidden xmlns='urn:ietf:params:xml:ns:xmpp-stanzas'/>
107 </error> 107 </error>
108 </iq> 108 </iq>
109 ]]></example> 109 ]]></example>
110 </section3> 110 </section3>
111 </section2> 111 </section2>
112 112
113 <section2 topic='Server Forward Delegated &IQ; Stanza' anchor='stanza_forward'> 113 <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> 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[ 115 <example caption='Juliet sends her mood to her server via PEP'><![CDATA[
116 <iq from='juliet@capulet.lit/balcony' 116 <iq from='juliet@capulet.lit/balcony'
117 id='pep1' 117 id='pep1'
118 type='set'> 118 type='set'>
119 <pubsub xmlns='http://jabber.org/protocol/pubsub'> 119 <pubsub xmlns='http://jabber.org/protocol/pubsub'>
120 <publish node='http://jabber.org/protocol/mood'> 120 <publish node='http://jabber.org/protocol/mood'>
126 </item> 126 </item>
127 </publish> 127 </publish>
128 </pubsub> 128 </pubsub>
129 </iq> 129 </iq>
130 ]]></example> 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> 131 <p>The server gets this stanza, sees that this namespace is delegated to <em>pubsub.capulet.lit</em>, so it forwards it:</p>
132 132
133 <example caption='sever delegate the stanza to pubsub.capulet.lit'><![CDATA[ 133 <example caption='server delegate the stanza to pubsub.capulet.lit'><![CDATA[
134 <iq from='juliet@capulet.lit/balcony' 134 <iq from='juliet@capulet.lit/balcony'
135 to='pubsub.capulet.lit' 135 to='pubsub.capulet.lit'
136 id='delegate1' 136 id='delegate1'
137 type='set'> 137 type='set'>
138 <pubsub xmlns='http://jabber.org/protocol/pubsub'> 138 <pubsub xmlns='http://jabber.org/protocol/pubsub'>
146 </publish> 146 </publish>
147 </pubsub> 147 </pubsub>
148 </iq> 148 </iq>
149 ]]></example> 149 ]]></example>
150 150
151 <p>The managing entity reply normally to the stanza:</p> 151 <p>The managing entity replies normally to the stanza:</p>
152 <example caption='pubsub.capulet.lit reply to juliet'><![CDATA[ 152 <example caption='pubsub.capulet.lit replies to Juliet'><![CDATA[
153 <iq from='pubsub.capulet.lit' 153 <iq from='pubsub.capulet.lit'
154 to='juliet.capulet.lit/balcony' 154 to='juliet@capulet.lit/balcony'
155 id='delegate1' 155 id='delegate1'
156 type='result'> 156 type='result'>
157 <pubsub xmlns='http://jabber.org/protocol/pubsub' /> 157 <pubsub xmlns='http://jabber.org/protocol/pubsub' />
158 </iq> 158 </iq>
159 ]]></example> 159 ]]></example>
160 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> 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 162
163 <example caption='capulet.lit reply to juliet'><![CDATA[ 163 <example caption='capulet.lit replies to Juliet'><![CDATA[
164 <iq from='capulet.lit' 164 <iq from='capulet.lit'
165 to='juliet.capulet.lit/balcony' 165 to='juliet@capulet.lit/balcony'
166 id='pep1' 166 id='pep1'
167 type='result'> 167 type='result'>
168 <pubsub xmlns='http://jabber.org/protocol/pubsub' /> 168 <pubsub xmlns='http://jabber.org/protocol/pubsub' />
169 </iq> 169 </iq>
170 ]]></example> 170 ]]></example>
171 171
172 <p>The workflow is fully transparent for Juliet</p> 172 <p>The workflow is fully transparent for Juliet.</p>
173 <section3 topic='Stanzas from managing entity' anchor='managing_entity_stanzas'> 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> 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> 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>
176 176
177 <example caption='Juliet add Romeo to her roster'><![CDATA[ 177 <example caption='Juliet adds Romeo to her roster'><![CDATA[
178 <iq from='juliet@capulet.lit/balcony' 178 <iq from='juliet@capulet.lit/balcony'
179 id='roster1' 179 id='roster1'
180 type='set'> 180 type='set'>
181 <query xmlns='jabber:iq:roster'> 181 <query xmlns='jabber:iq:roster'>
182 <item jid='romeo@montaigu.lit' 182 <item jid='romeo@montaigu.lit'
184 </item> 184 </item>
185 </query> 185 </query>
186 </iq> 186 </iq>
187 ]]></example> 187 ]]></example>
188 188
189 <example caption='server forward stanza to managing entity'><![CDATA[ 189 <example caption='server forwards stanza to managing entity'><![CDATA[
190 <iq from='juliet@capulet.lit/balcony' 190 <iq from='juliet@capulet.lit/balcony'
191 to='filter.capulet.lit' 191 to='filter.capulet.lit'
192 id='delegate1' 192 id='delegate1'
193 type='set'> 193 type='set'>
194 <query xmlns='jabber:iq:roster'> 194 <query xmlns='jabber:iq:roster'>
197 </item> 197 </item>
198 </query> 198 </query>
199 </iq> 199 </iq>
200 ]]></example> 200 ]]></example>
201 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> 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>
203 <example caption='filtering component accept Romeo'><![CDATA[ 203 <example caption='filtering component accept Romeo'><![CDATA[
204 <iq from='filter.capulet.lit' 204 <iq from='filter.capulet.lit'
205 to='juliet@capulet.lit/balcony' 205 to='juliet@capulet.lit/balcony'
206 id='delegate1' 206 id='delegate1'
207 type='result' /> 207 type='result' />
210 <iq to='juliet@capulet.lit/balcony' 210 <iq to='juliet@capulet.lit/balcony'
211 id='roster1' 211 id='roster1'
212 type='result' /> 212 type='result' />
213 ]]></example> 213 ]]></example>
214 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> 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>
216 <example caption='filter.capulet.lit use privileged entity to add romeo'><![CDATA[ 216 <example caption='filter.capulet.lit uses privileged entity to add Romeo'><![CDATA[
217 <iq to='juliet@capulet.lit' 217 <iq to='juliet@capulet.lit'
218 from='filter.capulet.lit' 218 from='filter.capulet.lit'
219 id='roster2' 219 id='roster2'
220 type='set'> 220 type='set'>
221 <query xmlns='jabber:iq:roster'> 221 <query xmlns='jabber:iq:roster'>
224 <group>Rivals</group> 224 <group>Rivals</group>
225 </item> 225 </item>
226 </query> 226 </query>
227 </iq> 227 </iq>
228 ]]></example> 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> 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>
230 230
231 <example caption='server accept new entity in roster'><![CDATA[ 231 <example caption='server accept new entity in roster'><![CDATA[
232 <iq to='filter.capulet.lit' 232 <iq to='filter.capulet.lit'
233 from='juliet@capulet.lit' 233 from='juliet@capulet.lit'
234 id='roster2' 234 id='roster2'
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> 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> 250 <ol>
251 <li>the delegation type is <em>client</em> instead of <em>admin</em></li> 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> 252 <li>the delegation is done per entity, so the managed entity MUST be specified in a 'to' attribute</li>
253 </ol> 253 </ol>
254 <p>If an entity want to manage PEP service for juliet, it can ask the delegation like this: 254 <p>If an entity want to manage PEP service for Juliet, it can ask the delegation like this:
255 </p> 255 </p>
256 <example caption='managing entity asks for namespace delegation for one particular entity'><![CDATA[ 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'> 257 <iq from='pubsub.montaigu.lit' to='capulet.lit' type='get' id='delegation1'>
258 <query xmlns='urn:xmpp:delegation:0' 258 <query xmlns='urn:xmpp:delegation:0'
259 type='request' 259 type='request'
267 </p> 267 </p>
268 <example caption='server asks user for the namespace delegation'><![CDATA[ 268 <example caption='server asks user for the namespace delegation'><![CDATA[
269 <message from='capulet.lit' to='juliet@capulet.lit'> 269 <message from='capulet.lit' to='juliet@capulet.lit'>
270 <body> 270 <body>
271 pubsub.montaigu.lit wants to manage a feature normally managed by the server. 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 ? 272 Do you allow it to manage the following features?
273 273
274 Be careful ! According management to entity is a serious thing, 274 Be careful! According management to an entity is a serious thing,
275 think twice that you can trust the entity before doing this. 275 think twice that you can trust the entity before doing this.
276 </body> 276 </body>
277 <x xmlns='jabber:x:data' type='form'> 277 <x xmlns='jabber:x:data' type='form'>
278 <title>Delegation request</title> 278 <title>Delegation request</title>
279 <instructions>pubsub.montaigu.lit wants to manage the following features: 279 <instructions>pubsub.montaigu.lit wants to manage the following features:
303 <field var='challenge'><value>5439123</value></field> 303 <field var='challenge'><value>5439123</value></field>
304 <field var='http://jabber.org/protocol/pubsub'><value>1</value></field> 304 <field var='http://jabber.org/protocol/pubsub'><value>1</value></field>
305 </x> 305 </x>
306 </message> 306 </message>
307 ]]></example> 307 ]]></example>
308 <p>Here juliet accept that <em>pubsub.montaigu.lit</em> manage the PubSub (and then PEP) service.</p> 308 <p>Here Juliet allows <em>pubsub.montaigu.lit</em> to 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> 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>
310 <example caption='server notify accepted delegations'><![CDATA[ 310 <example caption='server notify accepted delegations'><![CDATA[
311 <iq from='capulet.lit' to='pubsub.montaigu.lit' type='set' id='delegation2'> 311 <iq from='capulet.lit' to='pubsub.montaigu.lit' type='set' id='delegation2'>
312 <query xmlns='urn:xmpp:delegation:0' 312 <query xmlns='urn:xmpp:delegation:0'
313 type='allowed' 313 type='allowed'
314 from='juliet@capulet.lit'> 314 from='juliet@capulet.lit'>
320 </section2> 320 </section2>
321 321
322 </section1> 322 </section1>
323 323
324 <section1 topic='Configuration' anchor='configuration'> 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> 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>
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> 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>
327 </section1> 327 </section1>
328 328
329 <section1 topic='Discovering Support' anchor='disco'> 329 <section1 topic='Discovering Support' anchor='disco'>
330 <section2 topic='Announce' anchor='disco_announce'> 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> 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>
350 </iq> 350 </iq>
351 ]]></example> 351 ]]></example>
352 </section2> 352 </section2>
353 <section2 topic='Nesting' anchor='disco_nesting'> 353 <section2 topic='Nesting' anchor='disco_nesting'>
354 <section3 topic='General Case'> 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> 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>
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> 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>
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> 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>
358 <example caption="Juliet ask her server its available features"><![CDATA[ 358 <example caption="Juliet asks her server its available features"><![CDATA[
359 <iq from='juliet@capulet.lit/balcony' 359 <iq from='juliet@capulet.lit/balcony'
360 id='disco1' 360 id='disco1'
361 to='capulet.lit' 361 to='capulet.lit'
362 type='get'> 362 type='get'>
363 <query xmlns='http://jabber.org/protocol/disco#info'/> 363 <query xmlns='http://jabber.org/protocol/disco#info'/>
364 </iq> 364 </iq>
365 ]]> 365 ]]>
366 </example> 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> 367 <p>Server delegates its PubSub namespace to <em>pubsub.capulet.lit</em>, so it asks 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[ 368 <example caption="capulet.lit requests disco infos for pubsub namespace to pubsub.capulet.lit"><![CDATA[
369 <iq from='capulet.lit' 369 <iq from='capulet.lit'
370 id='disco2' 370 id='disco2'
371 to='pubsub.capulet.lit' 371 to='pubsub.capulet.lit'
372 type='get'> 372 type='get'>
373 <query xmlns='http://jabber.org/protocol/disco#info' 373 <query xmlns='http://jabber.org/protocol/disco#info'
374 node='urn:xmpp:delegation:0::http://jabber.org/protocol/pubsub'/> 374 node='urn:xmpp:delegation:0::http://jabber.org/protocol/pubsub'/>
375 </iq> 375 </iq>
376 ]]> 376 ]]>
377 </example> 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/> 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> 379 <em>pubsub.capulet.lit</em> returns its available features:</p>
380 <example caption="pubsub.capulet.lit returns features to nest"><![CDATA[ 380 <example caption="pubsub.capulet.lit returns features to nest"><![CDATA[
381 <iq from='pubsub.capulet.lit' 381 <iq from='pubsub.capulet.lit'
382 id='disco2' 382 id='disco2'
383 to='capulet.lit' 383 to='capulet.lit'
384 type='result'> 384 type='result'>
411 </iq> 411 </iq>
412 ]]> 412 ]]>
413 </example> 413 </example>
414 <p>Note that '<em>http://jabber.org/protocol/pubsub#auto-create</em>' is not available.</p> 414 <p>Note that '<em>http://jabber.org/protocol/pubsub#auto-create</em>' is not available.</p>
415 </section3> 415 </section3>
416 <section3 topic='rediction of bare jid disco info'> 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> 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>
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> 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 419
420 <example caption="Juliet ask features for its own bare jid"><![CDATA[ 420 <example caption="Juliet asks features for its own bare JID"><![CDATA[
421 <iq from='juliet@capulet.lit/balcony' 421 <iq from='juliet@capulet.lit/balcony'
422 id='disco3' 422 id='disco3'
423 to='juliet@capulet.lit' 423 to='juliet@capulet.lit'
424 type='get'> 424 type='get'>
425 <query xmlns='http://jabber.org/protocol/disco#info'/> 425 <query xmlns='http://jabber.org/protocol/disco#info'/>
426 </iq> 426 </iq>
427 ]]> 427 ]]>
428 </example> 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> 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[ 430 <example caption="capulet.lit requests disco infos for pubsub namespace to pubsub.capulet.lit"><![CDATA[
431 <iq from='capulet.lit' 431 <iq from='capulet.lit'
432 id='disco4' 432 id='disco4'
433 to='pubsub.capulet.lit' 433 to='pubsub.capulet.lit'
434 type='get'> 434 type='get'>
435 <query xmlns='http://jabber.org/protocol/disco#info' 435 <query xmlns='http://jabber.org/protocol/disco#info'
436 node='urn:xmpp:delegation:0:bare:http://jabber.org/protocol/pubsub'/> 436 node='urn:xmpp:delegation:0:bare:http://jabber.org/protocol/pubsub'/>
437 </iq> 437 </iq>
438 ]]> 438 ]]>
439 </example> 439 </example>
440 <p>As for general case, server has probably <link url='#impl'>this information already in cache</link>.<br/> 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> 441 <em>pubsub.capulet.lit</em> returns its available features:</p>
442 <example caption="pubsub.capulet.lit returns features to nest"><![CDATA[ 442 <example caption="pubsub.capulet.lit returns features to nest"><![CDATA[
443 <iq from='pubsub.capulet.lit' 443 <iq from='pubsub.capulet.lit'
444 id='disco4' 444 id='disco4'
445 to='capulet.lit' 445 to='capulet.lit'
446 type='result'> 446 type='result'>
461 ... 461 ...
462 </query> 462 </query>
463 </iq> 463 </iq>
464 ]]> 464 ]]>
465 </example> 465 </example>
466 <p>then the server return the answer to Juliet, as in general case, with requested bare jid in 'from' field.</p> 466 <p>Then the server returns 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[ 467 <example caption="capulet.lit returns disco info to Juliet"><![CDATA[
468 <iq from='juliet@capulet.lit' 468 <iq from='juliet@capulet.lit'
469 id='disco3' 469 id='disco3'
470 to='juliet@capulet.lit/balcony' 470 to='juliet@capulet.lit/balcony'
471 type='result'> 471 type='result'>
472 <query xmlns='http://jabber.org/protocol/disco#info'> 472 <query xmlns='http://jabber.org/protocol/disco#info'>
493 </section2> 493 </section2>
494 </section1> 494 </section1>
495 495
496 <section1 topic='Business Rules' anchor='rules'> 496 <section1 topic='Business Rules' anchor='rules'>
497 <ol> 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> 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>
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> 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> 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> 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>
502 </ol> 502 </ol>
503 </section1> 503 </section1>
504 <section1 topic='Implementation Notes' anchor='impl'> 504 <section1 topic='Implementation Notes' anchor='impl'>
505 <ol> 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> 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>
508 </ol> 508 </ol>
509 </section1> 509 </section1>
510 <section1 topic='Security Considerations' anchor='security'> 510 <section1 topic='Security Considerations' anchor='security'>
511 <ol> 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> 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> 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 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> 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> 516 </ol>
517 </section1> 517 </section1>
518 <section1 topic='IANA Considerations' anchor='iana'> 518 <section1 topic='IANA Considerations' anchor='iana'>
519 <p>This document requires no interaction with &IANA;.</p> 519 <p>This document requires no interaction with &IANA;.</p>
520 </section1> 520 </section1>