1
0
mirror of https://github.com/moparisthebest/xeps synced 2024-12-03 06:22:16 -05:00

Merge branch 'xep-0355' into premerge

This commit is contained in:
Jonas Schäfer 2021-10-19 16:52:47 +02:00
commit 73cdf415e5

View File

@ -10,7 +10,7 @@
<abstract>This specification provides a way for XMPP server to delegate treatments for a namespace to an other entity</abstract>
&LEGALNOTICE;
<number>0355</number>
<status>Deferred</status>
<status>Experimental</status>
<type>Standards Track</type>
<sig>Standards</sig>
<approver>Council</approver>
@ -28,18 +28,36 @@
<email>goffi@goffi.org</email>
<jid>goffi@jabber.fr</jid>
</author>
<revision>
<version>0.5</version>
<date>2021-10-15</date>
<initials>jp</initials>
<remark>
<ul>
<li>delegation of <link url='#remaining_disco'>Remaining Discovery Infos</link></li>
<li>delegation of <link url='#bare_jid_disco_items'>Bare JID Disco Items</link></li>
<li><link url="#security">Security Consideration</link> about disco requests</li>
<li>namespace bump</li>
<li>typos</li>
</ul>
</remark>
</revision>
<revision>
<version>0.4.2</version>
<date>2021-03-04</date>
<initials>mw</initials>
<remark><p>Cross-document editorial adjustments for inclusive language.</p></remark>
</revision>
<revision>
<version>0.4.1</version>
<date>2018-11-03</date>
<initials>pep</initials>
<remark>Fix a bunch of typos, batch-style.</remark>
</revision>
<revision>
<version>0.4</version>
<date>2017-09-11</date>
@ -81,7 +99,7 @@
<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>Forwarding now use &xep0297; to avoid server to parse every stanza and 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>
@ -142,18 +160,18 @@
<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>its namespace: e.g. <em>'urn:xmpp:mam:0'</em></li>
<li>its namespace: e.g. <em>'urn:xmpp:mam:2'</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'>
<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>
<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:2'</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.lit' to='pubub.capulet.lit' id='12345'>
<delegation xmlns='urn:xmpp:delegation:1'>
<delegated namespace='urn:xmpp:mam:0'>
<delegation xmlns='urn:xmpp:delegation:2'>
<delegated namespace='urn:xmpp:mam:2'>
<attribute name='node' />
</delegated>
<delegated namespace='http://jabber.org/protocol/pubsub'/>
@ -182,14 +200,14 @@
</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>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>
<p>To forward, an &IQ; stanza of type "set" is used which contain a &lt;delegation/&gt; element (with namespace <em>'urn:xmpp:delegation:2'</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[
<example caption='Server Delegates The Stanza To pubsub.capulet.lit'><![CDATA[
<iq from='capulet.lit'
to='pubsub.capulet.lit'
id='delegate1'
type='set'>
<delegation xmlns='urn:xmpp:delegation:1'>
<delegation xmlns='urn:xmpp:delegation:2'>
<forwarded xmlns='urn:xmpp:forward:0'>
<iq from='juliet@capulet.lit/balcony'
id='pep1'
@ -211,12 +229,12 @@
</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 to juliet'><![CDATA[
<example caption='pubsub.capulet.lit Replies To Juliet'><![CDATA[
<iq from='pubsub.capulet.lit'
to='capulet.lit'
id='delegate1'
type='result'>
<delegation xmlns='urn:xmpp:delegation:1'>
<delegation xmlns='urn:xmpp:delegation:2'>
<forwarded xmlns='urn:xmpp:forward:0'>
<iq to='juliet@capulet.lit/balcony'
id='pep1'
@ -232,7 +250,7 @@
<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>
<example caption='capulet.lit replies to Juliet'><![CDATA[
<example caption='capulet.lit Replies To Juliet'><![CDATA[
<iq to='juliet@capulet.lit/balcony'
id='pep1'
type='result'>
@ -265,7 +283,7 @@
to='pubsub.capulet.lit'
id='delegate1'
type='set'>
<delegation xmlns='urn:xmpp:delegation:1'>
<delegation xmlns='urn:xmpp:delegation:2'>
<forwarded xmlns='urn:xmpp:forward:0'>
<iq from='juliet@capulet.lit/balcony'
id='roster1'
@ -288,7 +306,7 @@
to='capulet.lit'
id='delegate1'
type='result'>
<delegation xmlns='urn:xmpp:delegation:1'>
<delegation xmlns='urn:xmpp:delegation:2'>
<forwarded xmlns='urn:xmpp:forward:0'>
<iq to='juliet@capulet.lit/balcony'
id='roster1'
@ -339,14 +357,14 @@
<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).</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>To request delegation for a particular entity, the managing entity MUST have an &IQ; stanza with <em>'urn:xmpp:delegation:2'</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:1'
<query xmlns='urn:xmpp:delegation:2'
to='juliet@capulet.lit'>
<delegate namespace='http://jabber.org/protocol/pubsub'/>
</query>
@ -369,7 +387,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:1</value>
<value>urn:xmpp:delegation:2</value>
</field>
<field type='list-single'
label='Manage PubSub (http://jabber.org/protocol/pubsub)'
@ -400,7 +418,7 @@
<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'>
<delegation xmlns='urn:xmpp:delegation:2' to='juliet@capulet.lit'>
<delegated namespace='http://jabber.org/protocol/pubsub'/>
</delegation>
</message>
@ -418,13 +436,13 @@
</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:1#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:2#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:1</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:2</em>" in response to a &xep0030; information request:</p>
<example caption="service discovery information request"><![CDATA[
<iq from='pubsub.capulet.lit'
id='disco1'
@ -440,7 +458,7 @@
type='result'>
<query xmlns='http://jabber.org/protocol/disco#info'>
...
<feature var='urn:xmpp:delegation:1'/>
<feature var='urn:xmpp:delegation:2'/>
...
</query>
</iq>
@ -449,7 +467,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 built in 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>This is done by using a disco node, which is built in 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:2::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:2</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'
@ -467,7 +485,7 @@
to='pubsub.capulet.lit'
type='get'>
<query xmlns='http://jabber.org/protocol/disco#info'
node='urn:xmpp:delegation:1::http://jabber.org/protocol/pubsub'/>
node='urn:xmpp:delegation:2::http://jabber.org/protocol/pubsub'/>
</iq>
]]>
</example>
@ -479,7 +497,7 @@
to='capulet.lit'
type='result'>
<query xmlns='http://jabber.org/protocol/disco#info'
node='urn:xmpp:delegation:1::http://jabber.org/protocol/pubsub'>
node='urn:xmpp:delegation:2::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'/>
@ -495,7 +513,7 @@
to='juliet@capulet.lit/balcony'
type='result'>
<query xmlns='http://jabber.org/protocol/disco#info'>
<feature var='urn:xmpp:delegation:1'/>
<feature var='urn:xmpp:delegation:2'/>
...
<feature var='http://jabber.org/protocol/pubsub'/>
<feature var='http://jabber.org/protocol/pubsub#publish'/>
@ -509,11 +527,11 @@
<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'>
<section3 topic='Nesting 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>
<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>
<example caption="Juliet asks features for its own bare JID"><![CDATA[
<example caption="Juliet Asks Features for Her Own Bare JID"><![CDATA[
<iq from='juliet@capulet.lit/balcony'
id='disco3'
to='juliet@capulet.lit'
@ -529,7 +547,7 @@
to='pubsub.capulet.lit'
type='get'>
<query xmlns='http://jabber.org/protocol/disco#info'
node='urn:xmpp:delegation:1:bare:http://jabber.org/protocol/pubsub'/>
node='urn:xmpp:delegation:2:bare:http://jabber.org/protocol/pubsub'/>
</iq>
]]>
</example>
@ -541,7 +559,7 @@
to='capulet.lit'
type='result'>
<query xmlns='http://jabber.org/protocol/disco#info'
node='urn:xmpp:delegation:1:bare:http://jabber.org/protocol/pubsub'>
node='urn:xmpp:delegation:2: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'/>
@ -589,6 +607,259 @@
<section3 topic='Service Discovery Extensions'>
<p>Extensions of Service Discovery as specified in &xep0128; follow the same rules: for the delegated namespace, internal extensions MUST be removed and extensions of managing entity MUST be included instead.</p>
</section3>
<section3 topic="Remaining Discovery Infos" anchor="remaining_disco">
<p>It may be necessary for a managing entity to advertise feature on a node which is unknown at the time of configuration. This is notably the case for a PEP component: features must be advertisable on disco nodes mapping pubsub nodes.</p>
<p>To allows that, the special namespace '<strong>urn:xmpp:delegation:2:bare:disco#info:*</strong>' is used, and means <em>"delegate information discovery requests made on bare jids for any discovery node which is not already managed by the server"</em>.</p>
<example caption="Juliet Asks Features for the Microblog Node 'urn:xmpp:microblog:0' for her Own Bare JID"><![CDATA[
<iq from='juliet@capulet.lit/balcony'
id='disco1'
to='juliet@capulet.lit'
type='get'>
<query xmlns='http://jabber.org/protocol/disco#info' node='urn:xmpp:microblog:0'/>
</iq>
]]>
</example>
<p>The node '<em>urn:xmpp:microblog:0</em>' is not managed by the server. Normally, this would result as an <em>&lt;item-not-found&gt;</em> &IQ; error, but the namespace '<strong>urn:xmpp:delegation:2:bare:disco#info:*</strong>' is delegated to <em>pubsub.capulet.lit</em>, thus the server delegate the stanza to the managing entity:</p>
<example caption='Server Delegates Disco Request to pubsub.capulet.lit'><![CDATA[
<iq from='capulet.lit'
to='pubsub.capulet.lit'
id='delegate_disco_1'
type='set'>
<delegation xmlns='urn:xmpp:delegation:2'>
<forwarded xmlns='urn:xmpp:forward:0'>
<iq from='juliet@capulet.lit/balcony'
id='disco1'
to='juliet@capulet.lit'
type='get'>
<query xmlns='http://jabber.org/protocol/disco#info' node='urn:xmpp:microblog:0'/>
</iq>
</forwarded>
</delegation>
</iq>
]]></example>
<p>The managing entity answers with its own disco features for the requested node:</p>
<example caption='pubsub.capulet.lit Replies With its Disco Infos for this Node'><![CDATA[
<iq from='pubsub.capulet.lit'
to='capulet.lit'
id='delegate_disco_1'
type='result'>
<delegation xmlns='urn:xmpp:delegation:2'>
<forwarded xmlns='urn:xmpp:forward:0'>
<iq to='juliet@capulet.lit/balcony'
id='disco1'
type='result'
xmlns='jabber:client'>
<query xmlns="http://jabber.org/protocol/disco#info" node="urn:xmpp:microblog:0">
<identity type="leaf" category="pubsub"/>
<x xmlns="jabber:x:data" type="result">
<field var="FORM_TYPE" type="hidden">
<value>http://jabber.org/protocol/pubsub#meta-data</value>
</field>
<field var="pubsub#node_type" type="text-single">
<value>leaf</value>
</field>
<field var="pubsub#persist_items" type="boolean">
<value>true</value>
</field>
<field var="pubsub#max_items" type="text-single">
<value>max</value>
</field>
<field var="pubsub#access_model" type="list-single">
<value>whitelist</value>
</field>
</x>
<feature var="http://jabber.org/protocol/rsm"/>
<feature var="http://jabber.org/protocol/pubsub#rsm"/>
<feature var="urn:xmpp:order-by:1"/>
</query>
</iq>
</forwarded>
</delegation>
</iq>
]]></example>
<p>Then the server decapsulate the &IQ; result, validate it as explained in <link url="#stanza_forward">Server Forwards Delegated &IQ; Stanza</link>, and send the result to Juliet:</p>
<example caption='capulet.lit Sends the Disco Infos to Juliet'><![CDATA[
<iq to='juliet@capulet.lit/balcony'
id='disco1'
type='result'
xmlns='jabber:client'>
<query xmlns="http://jabber.org/protocol/disco#info" node="urn:xmpp:microblog:0">
<identity type="leaf" category="pubsub"/>
<x xmlns="jabber:x:data" type="result">
<field var="FORM_TYPE" type="hidden">
<value>http://jabber.org/protocol/pubsub#meta-data</value>
</field>
<field var="pubsub#node_type" type="text-single">
<value>leaf</value>
</field>
<field var="pubsub#persist_items" type="boolean">
<value>true</value>
</field>
<field var="pubsub#max_items" type="text-single">
<value>max</value>
</field>
<field var="pubsub#access_model" type="list-single">
<value>whitelist</value>
</field>
</x>
<feature var="http://jabber.org/protocol/rsm"/>
<feature var="http://jabber.org/protocol/pubsub#rsm"/>
<feature var="urn:xmpp:order-by:1"/>
</query>
</iq>
]]></example>
</section3>
<section3 topic="Bare JID Disco Items" anchor="bare_jid_disco_items">
<p>A managing entity must be able to answer items discovery requests on bare jids. For PEP components, this is used to show available nodes on the service. Furthermore, An information discovery request or an items discovery requests on a node corresponding to an item advertised by the managing entity must be forwarded to the managing entity too.</p>
<p>This is done by using the special namespace '<strong>urn:xmpp:delegation:2:bare:disco#items:*</strong>' which means <em>"delegate items discovery made on bare jids with no node specified and all items discovery requests made on bare jids with a node which is not already managed by the server"</em>.</p>
<p class='box'><strong>Note:</strong> When no node is used, and unlike the <em>disco#info</em> case, the server SHOULD NOT nest its internal items with the ones from managing entity. The reason is that bare jids disco items are usually used for PEP nodes, and the server would then mix internal PEP nodes with the managing entity nodes, which would be confusing for XMPP clients and end-users. The server implementation MAY choose to nest items anyway, in which case the mechanism is the same as for disco#info.</p>
<p>A server SHOULD NOT cache result of forwarded disco#items requests, as this is highly dynamic.</p>
<example caption="Juliet Discover Items from her Own Bare JID"><![CDATA[
<iq from='juliet@capulet.lit/balcony'
id='disco_items_1'
to='juliet@capulet.lit'
type='get'>
<query xmlns='http://jabber.org/protocol/disco#items'/>
</iq>
]]>
</example>
<p>The namespace '<strong>urn:xmpp:delegation:2:bare:disco#items:*</strong>' is delegated to <em>pubsub.capulet.lit</em>, thus the server delegate the stanza to the managing entity:</p>
<example caption='Server Delegates Disco Items Request to pubsub.capulet.lit'><![CDATA[
<iq from='capulet.lit'
to='pubsub.capulet.lit'
id='delegate_disco_items_1'
type='set'>
<delegation xmlns='urn:xmpp:delegation:2'>
<forwarded xmlns='urn:xmpp:forward:0'>
<iq from='juliet@capulet.lit/balcony'
id='disco_items_1'
to='juliet@capulet.lit'
type='get'>
<query xmlns='http://jabber.org/protocol/disco#items'/>
</iq>
</forwarded>
</delegation>
</iq>
]]></example>
<p>The managing entity answers with its own disco items for Juliet's JID:</p>
<example caption='pubsub.capulet.lit Replies With its Disco Items for this JID'><![CDATA[
<iq from='pubsub.capulet.lit'
to='capulet.lit'
id='delegate_disco_items_1'
type='result'>
<delegation xmlns='urn:xmpp:delegation:2'>
<forwarded xmlns='urn:xmpp:forward:0'>
<iq to='juliet@capulet.lit/balcony'
id='disco_items_1'
type='result'
xmlns='jabber:client'>
<query xmlns="http://jabber.org/protocol/disco#items">
<item jid="juliet@capulet.int" node="http://jabber.org/protocol/mood"/>
<item jid="juliet@capulet.int" node="http://jabber.org/protocol/activity"/>
<item jid="juliet@capulet.int" node="urn:xmpp:microblog:0"/>
</query>
</iq>
</forwarded>
</delegation>
</iq>
]]></example>
<p>Then the server decapsulate the &IQ; result, validate it as explained in <link url="#stanza_forward">Server Forwards Delegated &IQ; Stanza</link>, and send the result to Juliet:</p>
<example caption='capulet.lit Sends the Disco Items to Juliet'><![CDATA[
<iq to='juliet@capulet.lit/balcony'
id='disco_items_1'
type='result'
xmlns='jabber:client'>
<query xmlns="http://jabber.org/protocol/disco#items">
<item jid="juliet@capulet.int" node="http://jabber.org/protocol/mood"/>
<item jid="juliet@capulet.int" node="http://jabber.org/protocol/activity"/>
<item jid="juliet@capulet.int" node="urn:xmpp:microblog:0"/>
</query>
</iq>
]]></example>
<p>Juliet now wants to know the IDs of blog items which has been published on her blog, to do so she does an items discovery request on her own bare jid with the '<em>urn:xmpp:microblog:0</em>' node:</p>
<example caption="Juliet Discovers Items for the Microblog Node 'urn:xmpp:microblog:0' on her Own Bare JID"><![CDATA[
<iq from='juliet@capulet.lit/balcony'
id='disco_items_2'
to='juliet@capulet.lit'
type='get'>
<query xmlns='http://jabber.org/protocol/disco#items' node='urn:xmpp:microblog:0'/>
</iq>
]]>
</example>
<p>Because the special namespace '<strong>urn:xmpp:delegation:2:bare:disco#items:*</strong>' is delegated to <em>pubsub.capulet.lit</em>, the server forward the request to this managing entity:</p>
<example caption='Server Delegates Disco Items Request to pubsub.capulet.lit'><![CDATA[
<iq from='capulet.lit'
to='pubsub.capulet.lit'
id='delegate_disco_2'
type='set'>
<delegation xmlns='urn:xmpp:delegation:2'>
<forwarded xmlns='urn:xmpp:forward:0'>
<iq from='juliet@capulet.lit/balcony'
id='disco_items_2'
to='juliet@capulet.lit'
type='get'>
<query xmlns='http://jabber.org/protocol/disco#items' node='urn:xmpp:microblog:0'/>
</iq>
</forwarded>
</delegation>
</iq>
]]></example>
<p>The managing entity answers with its own disco items for the requested entity and node (<em>pubsub.capulet.lit</em> being a PEP service, the items are actually Juliet's blog items IDs):</p>
<example caption='pubsub.capulet.lit Replies With its Disco Items for this Entity and Node'><![CDATA[
<iq from='pubsub.capulet.lit'
to='capulet.lit'
id='delegate_disco_2'
type='result'>
<delegation xmlns='urn:xmpp:delegation:2'>
<forwarded xmlns='urn:xmpp:forward:0'>
<iq to='juliet@capulet.lit/balcony'
id='disco_items_2'
type='result'
xmlns='jabber:client'>
<query xmlns="http://jabber.org/protocol/disco#items" node="urn:xmpp:microblog:0">
<item name="o-romeo-romeo-wherefore-art-thou-romeo-G1aF" jid="juliet@capulet.lit"/>
<item name="thou-know-st-the-mask-of-night-is-on-my-face-2avF" jid="juliet@capulet.lit"/>
<item name="balcony-and-privacy-afFG" jid="juliet@capulet.lit"/>
</query>
</iq>
</forwarded>
</delegation>
</iq>
]]></example>
<p>The server decapsulates the &IQ; result, validate it as explained in <link url="#stanza_forward">Server Forwards Delegated &IQ; Stanza</link>, and send the result to Juliet:</p>
<example caption='capulet.lit Sends the Disco Items to Juliet'><![CDATA[
<iq to='juliet@capulet.lit/balcony'
id='disco_items_2'
type='result'
xmlns='jabber:client'>
<query xmlns="http://jabber.org/protocol/disco#items" node="urn:xmpp:microblog:0">
<item name="o-romeo-romeo-wherefore-art-thou-romeo-G1aF" jid="juliet@capulet.lit"/>
<item name="thou-know-st-the-mask-of-night-is-on-my-face-2avF" jid="juliet@capulet.lit"/>
<item name="balcony-and-privacy-afFG" jid="juliet@capulet.lit"/>
</query>
</iq>
]]></example>
</section3>
</section2>
</section1>
@ -598,14 +869,14 @@
<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>If delegations are kept between sessions in client mode, and the managing entity is not available or return an error, 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>
<li>The namespace of this XEP (<strong>urn:xmpp:delegation:2</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>&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 answers - 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>
@ -613,8 +884,8 @@
<ol>
<li>Managing entity can manage sensitive data, <em>admin</em> delegation should be granted carefuly, only if you absolutely trust the entity.</li>
<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>
<li>In case of filtering, an allowlist system is more secure and SHOULD be prefered to a blocklist (idealy, configuration would allow no filtering, allowlist filtering and blocklist filtering).</li>
<li>Managing entity must be careful about not leaking the existence of an account (see <link url="https://xmpp.org/extensions/xep-0030.html#security">XEP-0030 Security Considerations</link>).</li>
</ol>
</section1>
<section1 topic='IANA Considerations' anchor='iana'>
@ -622,9 +893,9 @@
</section1>
<section1 topic='XMPP Registrar Considerations' anchor='registrar'>
<section2 topic='Protocol Namespaces' anchor='ns'>
<p>The &REGISTRAR; includes 'urn:xmpp:delegation:1' in its registry of protocol namespaces (see &NAMESPACES;).</p>
<p>The &REGISTRAR; includes 'urn:xmpp:delegation:2' in its registry of protocol namespaces (see &NAMESPACES;).</p>
<ul>
<li>urn:xmpp:delegation:1</li>
<li>urn:xmpp:delegation:2</li>
</ul>
</section2>
<section2 topic='Protocol Versioning' anchor='registrar-versioning'>
@ -637,8 +908,8 @@
<xs:schema
xmlns:xs='http://www.w3.org/2001/XMLSchema'
targetNamespace='urn:xmpp:delegation:1'
xmlns='urn:xmpp:delegation:1'
targetNamespace='urn:xmpp:delegation:2'
xmlns='urn:xmpp:delegation:2'
elementFormDefault='qualified'>
<xs:import namespace='urn:xmpp:forward:0'