changeset 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 4c5bd7ddaaca
files xmpp/xep-0355.xml
diffstat 1 files changed, 191 insertions(+), 135 deletions(-) [+]
line wrap: on
line diff
--- a/xmpp/xep-0355.xml	Fri Mar 20 16:13:10 2015 +0100
+++ b/xmpp/xep-0355.xml	Sat Mar 21 20:07:46 2015 +0100
@@ -28,22 +28,45 @@
     <email>goffi@goffi.org</email>
     <jid>goffi@jabber.fr</jid>
   </author>
+  
+  <revision>
+    <version>0.2</version>
+    <date>2014-03-21</date>
+    <initials>jp</initials>
+    <remark><p>Several updates according to feedbacks:</p>
+        <ul>
+            <li>Added attribute filtering, mainly to manage correctly MAM</li>
+            <li>Simplification of configuration in admin mode: no more &IQ; negociation</li>
+            <li>Delegations notifications to the managing entity are now done with a &MESSAGE; stanza</li>
+            <li>Forwarding now use &xep0297; to avoid server to parse every stanza and a to have a cleaner separation</li>
+            <li>The behaviour when managing entity is unavailable is specified</li>
+            <li>Use of namespace in field var for client mode negociation is now mandatory</li>
+            <li>Behaviour when managing a delegation kept between session in client mode, when managing entity is not available, is specified</li>
+            <li>Implementation note added for in-order processing issue (thanks to Kurt Zeilenga for pointing this)</li>
+            <li>Added an note for discovery nesting with attribute filtering</li>
+            <li>Updated namespace to reflect incompatible changes</li>
+        </ul>
+    </remark>
+  </revision>
+  
   <revision>
     <version>0.1</version>
     <date>2014-12-18</date>
     <initials>XEP Editor (mam)</initials>
     <remark><p>Initial published version approved by the XMPP Council.</p></remark>
   </revision>
+  
   <revision>
     <version>0.0.1</version>
     <date>2014-11-13</date>
     <initials>jp</initials>
     <remark><p>First draft.</p></remark>
   </revision>
+
 </header>
 <section1 topic='Introduction' anchor='intro'>
     <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>
-    <p>This XEP is complementary to priviliged entity XEP (and works in a similar way), although they can be used together or separately.</p>
+    <p>This XEP is complementary to &xep0356; (and works in a similar way), although they can be used together or separately.</p>
     <p>Here are some use cases of namespace delegation:</p>
         <ul>
             <li>use an external component for a PEP service because the server doesn't implement it or lacks some features</li>
@@ -64,50 +87,36 @@
 <section1 topic='Glossary' anchor='glossary'>
   <ul>
     <li><strong>Delegated namespace</strong> — the namespace being managed by an external entity.</li>
+    <li><strong>Filtering attribute</strong> — an attribute which must be present in first &IQ; child element to delegate the namespace.</li>
     <li><strong>Managing entity</strong> — the entity which actualy manages the delegated namespace.</li>
     <li><strong>Managed entity</strong> — an entity which wants to have a namespace of its server delegated to a managing entity.</li>
   </ul>
 </section1>
 <section1 topic='Admin Mode Use Cases' anchor='admin_usecases'>
 
+    <section2 topic='Server Allows Namespaces Delegations' anchor='server_config'>
+        <p>Namespaces delegations are granted in the server configuration. Only &IQ; stanza namespaces can be delegated.</p> 
+        <p>A feature is delegated using:</p>
+        <ol>
+            <li>it's namespace: e.g. <em>'urn:xmpp:mam:0'</em></li>
+            <li>zero or more filtering attribute (attributes which must be present in the initial &IQ; child element): e.g. <em>'node'</em></li>
+            <li>the jid of the managing entity: e.g. <em>'managing.capulet.lit'</em></li>
+        </ol>
+    </section2>
+
     <section2 topic='Delegation Request Use Case' anchor='admin_perm'>
-        <section3 topic='Entity Requests Namespace Delegation' anchor='req_delegation'>
-            <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>
-            <p>Namespace delegations are asked with a &lt;delegate/&gt; element, which MUST contain a 'namespace' attribute set to the requested namespace.</p>
-            <p>Only &lt;iq/&gt; stanza namespaces can be delegated.</p>
-            <example caption='entity asks for delegation in admin mode'><![CDATA[
-<iq from='pubsub.capulet.lit' type='get' id='delegation1'>
-    <query xmlns='urn:xmpp:delegation:0' type='request' delegation='admin'>
-        <delegate namespace='jabber:iq:roster'/>
-        <delegate namespace='http://jabber.org/protocol/pubsub'/>
-    </query>
-</iq>
-            ]]></example>
-        </section3>
-        <section3 topic='Server Accepts Namespace Delegation' anchor='accept_delegation'>
-            <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>
-            <example caption='server accept namespace delegations'><![CDATA[
-<iq from='capulet.lit' to='pubsub.capulet.lit' type='result' id='delegation1'>
-    <query xmlns='urn:xmpp:delegation:0' type='allowed'>
-        <delegate namespace='jabber:iq:roster'>
-        <delegate namespace='http://jabber.org/protocol/pubsub'>
-    </query>
-</iq>
-]]></example>
-<p>Note: the granted delegations MAY be different from the requested ones, according to server's configuration.</p>
-<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/>
-   The server MUST NOT forward any request made to an other entity than itself or to a bare JID within its domain.</p>
-        </section3>
-        <section3 topic='Server Rejects Namespace Delegation' anchor='reject_delegation'>
-            <p>If the server rejects the delegation, it MUST return a &forbidden; error:</p>
-            <example caption='server reject delegation'><![CDATA[
-<iq from='capulet.lit' to='pubsub.capulet.lit' type='error' id='delegation1'>
-    <error type='cancel'>
-        <forbidden xmlns='urn:ietf:params:xml:ns:xmpp-stanzas'/>
-    </error>
-</iq>
-            ]]></example>
-        </section3>
+        <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>
+        <example caption='server advertise delegated namespaces'><![CDATA[
+<message from='capulet.net' to='pubub.capulet.lit' id='12345'>
+    <delegation xmlns='urn:xmpp:delegation:1'>
+        <delegated namespace='urn:xmpp:mam:0'>
+            <attribute name='node' />
+        <delegated/>
+        <delegated namespace='http://jabber.org/protocol/pubsub'/>
+    </delegation>
+</message>
+    ]]></example>
+        <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>
     </section2>
 
     <section2 topic='Server Forwards Delegated &IQ; Stanza' anchor='stanza_forward'>
@@ -128,41 +137,57 @@
     </pubsub>
 </iq>
 ]]></example>
-<p>The server gets this stanza, sees that this namespace is delegated to <em>pubsub.capulet.lit</em>, so it forwards it:</p>
+<p>The server gets this stanza, sees that this namespace is delegated to <em>pubsub.capulet.lit</em>, so it forwards it.</p>
+<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>
 
 <example caption='server delegate the stanza to pubsub.capulet.lit'><![CDATA[
-<iq from='juliet@capulet.lit/balcony'
+<iq from='capulet.lit'
     to='pubsub.capulet.lit'
     id='delegate1'
     type='set'>
-    <pubsub xmlns='http://jabber.org/protocol/pubsub'>
-        <publish node='http://jabber.org/protocol/mood'>
-        <item>
-            <mood xmlns='http://jabber.org/protocol/mood'>
-                <annoyed/>
-                <text>curse my nurse!</text>
-            </mood>
-        </item>
-        </publish>
-    </pubsub>
+    <delegation xmlns='urn:xmpp:delegation:1'>
+        <forwarded xmlns='urn:xmpp:forward:0'>
+            <iq from='juliet@capulet.lit/balcony'
+                id='pep1'
+                type='set'>
+                <pubsub xmlns='http://jabber.org/protocol/pubsub'>
+                    <publish node='http://jabber.org/protocol/mood'>
+                    <item>
+                        <mood xmlns='http://jabber.org/protocol/mood'>
+                            <annoyed/>
+                            <text>curse my nurse!</text>
+                        </mood>
+                    </item>
+                    </publish>
+                </pubsub>
+            </iq>
+        </forwarded>
+    </delegation>
+</iq>
+]]></example>
+<p>The managing entity replies to the stanza by encapsulating its &IQ; result in the same way:</p>
+<example caption='pubsub.capulet.lit replies badly to juliet'><![CDATA[
+<iq from='pubsub.capulet.lit'
+    to='capulet.lit'
+    id='delegate1'
+    type='result'>
+    <delegation xmlns='urn:xmpp:delegation:1'>
+        <forwarded xmlns='urn:xmpp:forward:0'>
+            <iq to='juliet@capulet.lit/balcony'
+                id='pep1'
+                type='result'>
+                <pubsub xmlns='http://jabber.org/protocol/pubsub' />
+            </iq>
+        </forwarded>
+    </delegation>
 </iq>
 ]]></example>
 
-<p>The managing entity replies normally to the stanza:</p>
-<example caption='pubsub.capulet.lit replies to Juliet'><![CDATA[
-<iq from='pubsub.capulet.lit'
-    to='juliet@capulet.lit/balcony'
-    id='delegate1'
-    type='result'>
-    <pubsub xmlns='http://jabber.org/protocol/pubsub' />
-</iq>
-]]></example>
+    <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>
+    <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>
 
-<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>
-
-<example caption='capulet.lit replies to Juliet'><![CDATA[
-<iq from='capulet.lit'
-    to='juliet@capulet.lit/balcony'
+    <example caption='capulet.lit replies to Juliet'><![CDATA[
+<iq to='juliet@capulet.lit/balcony'
     id='pep1'
     type='result'>
     <pubsub xmlns='http://jabber.org/protocol/pubsub' />
@@ -170,6 +195,8 @@
 ]]></example>
 
     <p>The workflow is fully transparent for Juliet.</p>
+    <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>
+    <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>
     <section3 topic='Stanzas from managing entity' anchor='managing_entity_stanzas'>
         <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>
         <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>
@@ -187,32 +214,48 @@
 ]]></example>
 
         <example caption='server forwards stanza to managing entity'><![CDATA[
-<iq from='juliet@capulet.lit/balcony'
-          to='filter.capulet.lit'
-          id='delegate1'
-          type='set'>
-    <query xmlns='jabber:iq:roster'>
-        <item jid='romeo@montaigu.lit'
-              name='My Romeo'>
-        </item>
-    </query>
+<iq from='capulet.lit'
+    to='pubsub.capulet.lit'
+    id='delegate1'
+    type='set'>
+    <delegation xmlns='urn:xmpp:delegation:1'>
+        <forwarded xmlns='urn:xmpp:forward:0'>
+            <iq from='juliet@capulet.lit/balcony'
+                      id='roster1'
+                      type='set'>
+                <query xmlns='jabber:iq:roster'>
+                    <item jid='romeo@montaigu.lit'
+                          name='My Romeo'>
+                    </item>
+                </query>
+            </iq>
+        </forwarded>
+    </delegation>
 </iq>
 ]]></example>
 
-<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>
+        <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>
         <example caption='filtering component accept Romeo'><![CDATA[
-<iq from='filter.capulet.lit'
-    to='juliet@capulet.lit/balcony'
+<iq from='pubsub.capulet.lit'
+    to='capulet.lit'
     id='delegate1'
-    type='result' />
+    type='result'>
+    <delegation xmlns='urn:xmpp:delegation:1'>
+        <forwarded xmlns='urn:xmpp:forward:0'>
+            <iq to='juliet@capulet.lit/balcony'
+                id='roster1'
+                type='result' />
+        </forwarded>
+    </delegation>
+</iq>
 ]]></example>
-        <example caption='server forward the result with the initial id'><![CDATA[
+        <example caption='server decapsulate and send the result with the initial id'><![CDATA[
 <iq to='juliet@capulet.lit/balcony'
     id='roster1'
     type='result' />
 ]]></example>
 
-    <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>
+        <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>
         <example caption='filter.capulet.lit uses privileged entity to add Romeo'><![CDATA[
 <iq to='juliet@capulet.lit'
     from='filter.capulet.lit'
@@ -226,18 +269,18 @@
     </query>
 </iq>
 ]]></example>
-    <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>
+        <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>
 
-    <example caption='server accept new entity in roster'><![CDATA[
+        <example caption='server accept new entity in roster'><![CDATA[
 <iq to='filter.capulet.lit'
     from='juliet@capulet.lit'
     id='roster2'
     type='result'/>
 ]]></example>
 
-<p>The server will then send the roster pushes (with the enforced group) normally.</p>
+        <p>The server will then send the roster pushes (with the enforced group) normally.</p>
 
-    </section3>
+        </section3>
 
     </section2>
 
@@ -246,27 +289,24 @@
 
 <section1 topic='Client Mode Use Cases' anchor='client_usecases'>
     <section2 topic='Client Delegation Request Use Case' anchor='client_delegation'>
-        <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>
-        <ol>
-            <li>the delegation type is <em>client</em> instead of <em>admin</em></li>
-            <li>the delegation is done per entity, so the managed entity MUST be specified in a 'to' attribute</li>
-        </ol>
+        <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>
+        <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>
+        <p>Namespace delegations are asked with a &lt;delegate/&gt; element, which MUST contain a 'namespace' attribute set to the requested namespace.</p>
+        
         <p>If an entity want to manage PEP service for Juliet, it can ask the delegation like this:
         </p>
         <example caption='managing entity asks for namespace delegation for one particular entity'><![CDATA[
 <iq from='pubsub.montaigu.lit' to='capulet.lit' type='get' id='delegation1'>
-    <query xmlns='urn:xmpp:delegation:0'
-           type='request'
-           delegation='client'
+    <query xmlns='urn:xmpp:delegation:1'
            to='juliet@capulet.lit'>
         <delegate namespace='http://jabber.org/protocol/pubsub'/>
     </query>
 </iq>
         ]]></example>
-        <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.
+        <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.
         </p>
         <example caption='server asks user for the namespace delegation'><![CDATA[
-<message from='capulet.lit' to='juliet@capulet.lit'>
+<message from='capulet.lit' to='juliet@capulet.lit/balcony'>
     <body>
         pubsub.montaigu.lit wants to manage a feature normally managed by the server.
         Do you allow it to manage the following features?
@@ -280,7 +320,7 @@
             Do you allow it?</instructions>
         <field type='hidden' var='challenge'><value>5439123</value></field>
         <field type='hidden' var='FORM_TYPE'>
-            <value>urn:xmpp:delegation:0</value>
+            <value>urn:xmpp:delegation:1</value>
         </field>
         <field type='list-single'
             label='Manage PubSub (http://jabber.org/protocol/pubsub)'
@@ -292,10 +332,10 @@
     </x>
 </message>
         ]]></example>
-        <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>
+        <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>
         <p>The client can then answer to the form:</p>
         <example caption='client answer to the form'><![CDATA[
-<message from='juliet@capulet.lit' to='capulet.lit'>
+<message from='juliet@capulet.lit/balcony' to='capulet.lit'>
   <x xmlns='jabber:x:data' type='submit'>
     <field var='FORM_TYPE'>
       <value></value>
@@ -306,29 +346,29 @@
 </message>
         ]]></example>
         <p>Here Juliet allows <em>pubsub.montaigu.lit</em> to manage the PubSub (and then PEP) service.</p>
-        <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>
-        <example caption='server notify accepted delegations'><![CDATA[
-<iq from='capulet.lit' to='pubsub.montaigu.lit' type='set' id='delegation2'>
-    <query xmlns='urn:xmpp:delegation:0'
-        type='allowed'
-        from='juliet@capulet.lit'>
-        <delegate namespace='http://jabber.org/protocol/pubsub'/>
-    </query>
-</iq>
-        ]]></example>
+
+
+        <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>
+        <example caption='server advertise delegated namespaces for juliet'><![CDATA[
+<message from='capulet.net' to='pubub.capulet.lit' id='6789'>
+    <delegation xmlns='urn:xmpp:delegation:1' to='juliet@capulet.lit'>
+        <delegated namespace='http://jabber.org/protocol/pubsub'/>
+    </delegation>
+</message>
+]]></example>
         <p>The managing entity can now manage the namespace the same way as in <link url='#stanza_forward'>admin mode</link>.</p>
     </section2>
 
 </section1>
 
 <section1 topic='Configuration' anchor='configuration'>
-    <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>
+    <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>
     <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>
 </section1>
 
 <section1 topic='Discovering Support' anchor='disco'>
     <section2 topic='Announce' anchor='disco_announce'>
-        <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>
+        <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>
         <example caption="service discovery information request"><![CDATA[
 <iq from='pubsub.capulet.lit'
     id='disco1'
@@ -344,7 +384,7 @@
     type='result'>
   <query xmlns='http://jabber.org/protocol/disco#info'>
     ...
-    <feature var='urn:xmpp:delegation:0'/>
+    <feature var='urn:xmpp:delegation:1'/>
     ...
   </query>
 </iq>
@@ -353,7 +393,7 @@
     <section2 topic='Nesting' anchor='disco_nesting'>
     <section3 topic='General Case'>
         <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>
-        <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>
+        <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>
 <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>
 <example caption="Juliet asks her server its available features"><![CDATA[
 <iq from='juliet@capulet.lit/balcony'
@@ -371,7 +411,7 @@
     to='pubsub.capulet.lit'
     type='get'>
   <query xmlns='http://jabber.org/protocol/disco#info'
-         node='urn:xmpp:delegation:0::http://jabber.org/protocol/pubsub'/>
+         node='urn:xmpp:delegation:1::http://jabber.org/protocol/pubsub'/>
 </iq>
   ]]>
 </example>
@@ -383,7 +423,7 @@
     to='capulet.lit'
     type='result'>
   <query xmlns='http://jabber.org/protocol/disco#info'
-         node='urn:xmpp:delegation:0::http://jabber.org/protocol/pubsub'>
+         node='urn:xmpp:delegation:1::http://jabber.org/protocol/pubsub'>
         <feature var='http://jabber.org/protocol/pubsub'/>
         <feature var='http://jabber.org/protocol/pubsub#publish'/>
         <feature var='http://jabber.org/protocol/pubsub#subscribe'/>
@@ -399,8 +439,8 @@
     to='juliet@capulet.lit/balcony'
     type='result'>
   <query xmlns='http://jabber.org/protocol/disco#info'
-         node='urn:xmpp:delegation:0::http://jabber.org/protocol/pubsub'>
-        <feature var='urn:xmpp:delegation:0'/>
+         node='urn:xmpp:delegation:1::http://jabber.org/protocol/pubsub'>
+        <feature var='urn:xmpp:delegation:1'/>
         ...
         <feature var='http://jabber.org/protocol/pubsub'/>
         <feature var='http://jabber.org/protocol/pubsub#publish'/>
@@ -412,6 +452,7 @@
   ]]>
 </example>
 <p>Note that '<em>http://jabber.org/protocol/pubsub#auto-create</em>' is not available.</p>
+<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>
     </section3>
     <section3 topic='Rediction Of Bare JID Disco Info'>
         <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>
@@ -433,7 +474,7 @@
     to='pubsub.capulet.lit'
     type='get'>
   <query xmlns='http://jabber.org/protocol/disco#info'
-         node='urn:xmpp:delegation:0:bare:http://jabber.org/protocol/pubsub'/>
+         node='urn:xmpp:delegation:1:bare:http://jabber.org/protocol/pubsub'/>
 </iq>
   ]]>
 </example>
@@ -445,7 +486,7 @@
     to='capulet.lit'
     type='result'>
     <query xmlns='http://jabber.org/protocol/disco#info'
-           node='urn:xmpp:delegation:0:bare:http://jabber.org/protocol/pubsub'>
+           node='urn:xmpp:delegation:1:bare:http://jabber.org/protocol/pubsub'>
         <identity category='pubsub' type='pep'/>
         <feature var='http://jabber.org/protocol/pubsub#access-presence'/>
         <feature var='http://jabber.org/protocol/pubsub#auto-create'/>
@@ -498,13 +539,16 @@
         <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>
         <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>
         <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>
-        <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>
+        <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>
+        <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>
     </ol>
 </section1>
 <section1 topic='Implementation Notes' anchor='impl'>
     <ol>
         <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>
         <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>
+        <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).
+        </li>
     </ol>
 </section1>
 <section1 topic='Security Considerations' anchor='security'>
@@ -520,9 +564,9 @@
 </section1>
 <section1 topic='XMPP Registrar Considerations' anchor='registrar'>
   <section2 topic='Protocol Namespaces' anchor='ns'>
-    <p>The &REGISTRAR; includes 'urn:xmpp:delegation:0' in its registry of protocol namespaces (see &NAMESPACES;).</p>
+    <p>The &REGISTRAR; includes 'urn:xmpp:delegation:1' in its registry of protocol namespaces (see &NAMESPACES;).</p>
     <ul>
-      <li>urn:xmpp:delegation:0</li>
+      <li>urn:xmpp:delegation:1</li>
     </ul>
   </section2>
   <section2 topic='Protocol Versioning' anchor='registrar-versioning'>
@@ -535,27 +579,18 @@
 
 <xs:schema
     xmlns:xs='http://www.w3.org/2001/XMLSchema'
-    targetNamespace='urn:xmpp:delegation:0'
-    xmlns='urn:xmpp:delegation:0'
+    targetNamespace='urn:xmpp:delegation:1'
+    xmlns='urn:xmpp:delegation:1'
     elementFormDefault='qualified'>
 
+  <xs:import namespace='urn:xmpp:forward:0'
+      schemaLocation='http://xmpp.org/schemas/forward.xsd'/>
+
   <xs:element name='query'>
       <xs:complexType>
-          <xs:attribute name='type' use='required'>
-              <xs:simpleType base='xs:NMTOKEN'>
-                  <xs:enumeration value='request'/>
-                  <xs:enumeration value='allowed'/>
-              </xs:simpleType>
+          <xs:attribute name='to' use='required' type='xs:string'/>
           </xs:attribute>
-          <xs:attribute name='delegation' use='optional'>
-              <xs:simpleType base='xs:NMTOKEN'>
-                  <xs:enumeration value='admin'/>
-                  <xs:enumeration value='client'/>
-              </xs:simpleType>
-          </xs:attribute>
-          <xs:attribute name='to' use='optional' type='xs:string'/>
-          </xs:attribute>
-          <xs:element name='delegation'
+          <xs:element name='delegate'
                       maxOccurs='unbounded'>
               <xs:complexType>
                   <xs:attribute name='namespace' use='required' type='xs:string'/>
@@ -564,6 +599,26 @@
       </xs:complexType>
   </xs:element>
 
+  <xs:element name='delegation'>
+      <xs:complexType>
+          <xs:element ref='urn:xmpp:forward:0' minOccurs='0' maxOccurs='1' />
+          <xs:element name='delegated'
+                      minOccurs='0'
+                      maxOccurs='unbounded'>
+              <xs:complexType>
+                  <xs:attribute name='namespace' use='required' type='xs:string'/>
+                  <xs:element name='attribute'
+                              minOccurs='0'
+                              maxOccurs='unbounded'>
+                      <xs:complexType>
+                          <xs:attribute name='name' use='required' type='xs:string'/>
+                      </xs:complexType>
+                  </xs:element>
+              </xs:complexType>
+          </xs:element>
+      </xs:complexType>
+  </xs:element>
+
 </xs:schema>
     ]]></code>
 </section1>
@@ -571,5 +626,6 @@
   <p>This XEP is linked with &xep0356; and works in a similar way.</p>
   <p>The client mode delegation mechanism is inspired from &xep0321; permission request.</p>
   <p>Thanks to Adrien Cossa for his typos/style corrections</p>
+  <p>Thanks to Philipp Hancke, Dave Cridland, Kurt Zeilenga and Sergey Dobrov for their feedbacks.</p>
 </section1>
 </xep>