Mercurial > sat_docs
changeset 41:21d0d0ab7aa0
xeps: renamed published proto-xeps, and updated them according to published version
author | Goffi <goffi@goffi.org> |
---|---|
date | Fri, 20 Mar 2015 16:13:10 +0100 |
parents | 1eb3ec190ea1 |
children | bbb900a768ea |
files | xmpp/xep-0355.xml xmpp/xep-0356.xml xmpp/xep-proto-namespace-delegation.xml xmpp/xep-proto-privileged-component.xml |
diffstat | 4 files changed, 961 insertions(+), 958 deletions(-) [+] |
line wrap: on
line diff
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/xmpp/xep-0355.xml Fri Mar 20 16:13:10 2015 +0100 @@ -0,0 +1,575 @@ +<?xml version='1.0' encoding='UTF-8'?> +<!DOCTYPE xep SYSTEM 'xep.dtd' [ + <!ENTITY % ents SYSTEM 'xep.ent'> +%ents; +]> +<?xml-stylesheet type='text/xsl' href='xep.xsl'?> +<xep> +<header> + <title>Namespace Delegation</title> + <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>Experimental</status> + <type>Standards Track</type> + <sig>Standards</sig> + <approver>Council</approver> + <dependencies> + <spec>XMPP Core</spec> + <spec>XEP-0004</spec> + <spec>XEP-0297</spec> + </dependencies> + <supersedes/> + <supersededby/> + <shortname>NOT_YET_ASSIGNED</shortname> + <author> + <firstname>Jérôme</firstname> + <surname>Poisson</surname> + <email>goffi@goffi.org</email> + <jid>goffi@jabber.fr</jid> + </author> + <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>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> + <li>decentralize a server feature to an entity under client control</li> + <li>make a component which react on new user registration, independent of server implementation</li> + <li>server agnostic roster filtering</li> + </ul> +</section1> +<section1 topic='Requirements' anchor='reqs'> + <p>Namespace delegation can be used in two modes:</p> + <ul> + <li><strong>admin</strong> mode, where delegation is specified by the server administrator.</li> + <li><strong>client</strong> mode, where it can be requested by any user.</li> + </ul> + <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> + <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> +</section1> +<section1 topic='Glossary' anchor='glossary'> + <ul> + <li><strong>Delegated namespace</strong> — the namespace being managed by an external entity.</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='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 <delegate/> element, which MUST contain a 'namespace' attribute set to the requested namespace.</p> + <p>Only <iq/> 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 <delegate> 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> + </section2> + + <section2 topic='Server Forwards Delegated &IQ; Stanza' anchor='stanza_forward'> + <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> + <example caption='Juliet sends her mood to her server via PEP'><![CDATA[ +<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> +]]></example> +<p>The server gets this stanza, sees that this namespace is delegated to <em>pubsub.capulet.lit</em>, so it forwards it:</p> + +<example caption='server delegate the stanza to pubsub.capulet.lit'><![CDATA[ +<iq from='juliet@capulet.lit/balcony' + 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> +</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 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' + id='pep1' + type='result'> + <pubsub xmlns='http://jabber.org/protocol/pubsub' /> +</iq> +]]></example> + + <p>The workflow is fully transparent for Juliet.</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> + + <example caption='Juliet adds Romeo to her roster'><![CDATA[ +<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> +]]></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> +]]></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> + <example caption='filtering component accept Romeo'><![CDATA[ +<iq from='filter.capulet.lit' + to='juliet@capulet.lit/balcony' + id='delegate1' + type='result' /> +]]></example> + <example caption='server forward 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> + <example caption='filter.capulet.lit uses privileged entity to add Romeo'><![CDATA[ +<iq to='juliet@capulet.lit' + from='filter.capulet.lit' + id='roster2' + type='set'> + <query xmlns='jabber:iq:roster'> + <item jid='romeo@montaigu.lit' + name='My Romeo'> + <group>Rivals</group> + </item> + </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> + + <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> + + </section3> + + </section2> + + +</section1> + +<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>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' + 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> + <example caption='server asks user for the namespace delegation'><![CDATA[ +<message from='capulet.lit' to='juliet@capulet.lit'> + <body> + pubsub.montaigu.lit wants to manage a feature normally managed by the server. + Do you allow it to manage the following features? + + Be careful! According management to an entity is a serious thing, + think twice that you can trust the entity before doing this. + </body> + <x xmlns='jabber:x:data' type='form'> + <title>Delegation request</title> + <instructions>pubsub.montaigu.lit wants to manage the following features: + 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> + </field> + <field type='list-single' + label='Manage PubSub (http://jabber.org/protocol/pubsub)' + var='http://jabber.org/protocol/pubsub'> + <value>0</value> + <option label='No'><value>0</value></option> + <option label='Yes'><value>1</value></option> + </field> + </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 client can then answer to the form:</p> + <example caption='client answer to the form'><![CDATA[ +<message from='juliet@capulet.lit' to='capulet.lit'> + <x xmlns='jabber:x:data' type='submit'> + <field var='FORM_TYPE'> + <value></value> + </field> + <field var='challenge'><value>5439123</value></field> + <field var='http://jabber.org/protocol/pubsub'><value>1</value></field> + </x> +</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>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>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> + <example caption="service discovery information request"><![CDATA[ +<iq from='pubsub.capulet.lit' + id='disco1' + to='capulet.lit' + type='get'> + <query xmlns='http://jabber.org/protocol/disco#info'/> +</iq> + ]]></example> + <example caption="service discovery information response"><![CDATA[ +<iq from='capulet.lit' + id='disco1' + to='pubsub.capulet.lit' + type='result'> + <query xmlns='http://jabber.org/protocol/disco#info'> + ... + <feature var='urn:xmpp:delegation:0'/> + ... + </query> +</iq> + ]]></example> + </section2> + <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>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' + id='disco1' + to='capulet.lit' + type='get'> + <query xmlns='http://jabber.org/protocol/disco#info'/> +</iq> + ]]> +</example> +<p>Server delegates its PubSub namespace to <em>pubsub.capulet.lit</em>, so it asks its available features for this namespace like this:</p> +<example caption="capulet.lit requests disco infos for pubsub namespace to pubsub.capulet.lit"><![CDATA[ +<iq from='capulet.lit' + id='disco2' + to='pubsub.capulet.lit' + type='get'> + <query xmlns='http://jabber.org/protocol/disco#info' + node='urn:xmpp:delegation:0::http://jabber.org/protocol/pubsub'/> +</iq> + ]]> +</example> +<p>Note that in real situation, server has probably this information already in cache (see <link url='#impl'>Implementation Notes</link>).<br/> + <em>pubsub.capulet.lit</em> returns its available features:</p> +<example caption="pubsub.capulet.lit returns features to nest"><![CDATA[ +<iq from='pubsub.capulet.lit' + id='disco2' + to='capulet.lit' + type='result'> + <query xmlns='http://jabber.org/protocol/disco#info' + node='urn:xmpp:delegation:0::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'/> + <feature var='http://jabber.org/protocol/pubsub#publish-options'/> + </query> +</iq> + ]]> +</example> +<p>Server include the results in its own discovery info results:</p> +<example caption="capulet.lit return disco info including features from pubsub.capulet.lit"><![CDATA[ +<iq from='capulet.lit' + id='disco1' + 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'/> + ... + <feature var='http://jabber.org/protocol/pubsub'/> + <feature var='http://jabber.org/protocol/pubsub#publish'/> + <feature var='http://jabber.org/protocol/pubsub#subscribe'/> + <feature var='http://jabber.org/protocol/pubsub#publish-options'/> + ... + </query> +</iq> + ]]> +</example> +<p>Note that '<em>http://jabber.org/protocol/pubsub#auto-create</em>' is not available.</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> + <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[ +<iq from='juliet@capulet.lit/balcony' + id='disco3' + to='juliet@capulet.lit' + type='get'> + <query xmlns='http://jabber.org/protocol/disco#info'/> +</iq> + ]]> +</example> +<p>Server delegate its PubSub namespace to <em>pubsub.capulet.lit</em>, so it ask its available features for this namespace like this:</p> +<example caption="capulet.lit requests disco infos for pubsub namespace to pubsub.capulet.lit"><![CDATA[ +<iq from='capulet.lit' + id='disco4' + 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'/> +</iq> + ]]> +</example> +<p>As for general case, server has probably <link url='#impl'>this information already in cache</link>.<br/> + <em>pubsub.capulet.lit</em> returns its available features:</p> +<example caption="pubsub.capulet.lit returns features to nest"><![CDATA[ +<iq from='pubsub.capulet.lit' + id='disco4' + to='capulet.lit' + type='result'> + <query xmlns='http://jabber.org/protocol/disco#info' + node='urn:xmpp:delegation:0: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'/> + <feature var='http://jabber.org/protocol/pubsub#auto-subscribe'/> + <feature var='http://jabber.org/protocol/pubsub#config-node'/> + <feature var='http://jabber.org/protocol/pubsub#create-and-configure'/> + <feature var='http://jabber.org/protocol/pubsub#create-nodes'/> + <feature var='http://jabber.org/protocol/pubsub#filtered-notifications'/> + <feature var='http://jabber.org/protocol/pubsub#persistent-items'/> + <feature var='http://jabber.org/protocol/pubsub#publish'/> + <feature var='http://jabber.org/protocol/pubsub#retrieve-items'/> + <feature var='http://jabber.org/protocol/pubsub#subscribe'/> + ... + </query> +</iq> + ]]> +</example> +<p>Then the server returns the answer to Juliet, as in general case, with requested bare JID in 'from' field.</p> +<example caption="capulet.lit returns disco info to Juliet"><![CDATA[ +<iq from='juliet@capulet.lit' + id='disco3' + to='juliet@capulet.lit/balcony' + type='result'> + <query xmlns='http://jabber.org/protocol/disco#info'> + <identity category='account' type='registered'/> + <identity category='pubsub' type='pep'/> + <feature var='http://jabber.org/protocol/pubsub#access-presence'/> + <feature var='http://jabber.org/protocol/pubsub#auto-create'/> + <feature var='http://jabber.org/protocol/pubsub#auto-subscribe'/> + <feature var='http://jabber.org/protocol/pubsub#config-node'/> + <feature var='http://jabber.org/protocol/pubsub#create-and-configure'/> + <feature var='http://jabber.org/protocol/pubsub#create-nodes'/> + <feature var='http://jabber.org/protocol/pubsub#filtered-notifications'/> + <feature var='http://jabber.org/protocol/pubsub#persistent-items'/> + <feature var='http://jabber.org/protocol/pubsub#publish'/> + <feature var='http://jabber.org/protocol/pubsub#retrieve-items'/> + <feature var='http://jabber.org/protocol/pubsub#subscribe'/> + ... + </query> +</iq> + ]]> +</example> + + </section3> + </section2> +</section1> + +<section1 topic='Business Rules' anchor='rules'> + <ol> + <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> + </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> + </ol> +</section1> +<section1 topic='Security Considerations' anchor='security'> + <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, 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> + </ol> +</section1> +<section1 topic='IANA Considerations' anchor='iana'> + <p>This document requires no interaction with &IANA;.</p> +</section1> +<section1 topic='XMPP Registrar Considerations' anchor='registrar'> + <section2 topic='Protocol Namespaces' anchor='ns'> + <p>The ®ISTRAR; includes 'urn:xmpp:delegation:0' in its registry of protocol namespaces (see &NAMESPACES;).</p> + <ul> + <li>urn:xmpp:delegation:0</li> + </ul> + </section2> + <section2 topic='Protocol Versioning' anchor='registrar-versioning'> + &NSVER; + </section2> +</section1> +<section1 topic='XML Schema' anchor='schema'> + <code><![CDATA[ +<?xml version='1.0' encoding='UTF-8'?> + +<xs:schema + xmlns:xs='http://www.w3.org/2001/XMLSchema' + targetNamespace='urn:xmpp:delegation:0' + xmlns='urn:xmpp:delegation:0' + elementFormDefault='qualified'> + + <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> + <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' + maxOccurs='unbounded'> + <xs:complexType> + <xs:attribute name='namespace' use='required' type='xs:string'/> + </xs:complexType> + </xs:element> + </xs:complexType> + </xs:element> + +</xs:schema> + ]]></code> +</section1> +<section1 topic='Acknowledgements' anchor='acks'> + <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> +</section1> +</xep>
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/xmpp/xep-0356.xml Fri Mar 20 16:13:10 2015 +0100 @@ -0,0 +1,386 @@ +<?xml version='1.0' encoding='UTF-8'?> +<!DOCTYPE xep SYSTEM 'xep.dtd' [ + <!ENTITY % ents SYSTEM 'xep.ent'> +%ents; +]> +<?xml-stylesheet type='text/xsl' href='xep.xsl'?> +<xep> +<header> + <title>Privileged Entity</title> + <abstract>This specification provides a way for XMPP entities to have a privileged access to some other entities data</abstract> + &LEGALNOTICE; + <number>0356</number> + <status>Experimental</status> + <type>Standards Track</type> + <sig>Standards</sig> + <approver>Council</approver> + <dependencies> + <spec>XMPP Core</spec> + </dependencies> + <supersedes/> + <supersededby/> + <shortname>NOT_YET_ASSIGNED</shortname> + <author> + <firstname>Jérôme</firstname> + <surname>Poisson</surname> + <email>goffi@goffi.org</email> + <jid>goffi@jabber.fr</jid> + </author> + <revision> + <version>0.1</version> + <date>2015-01-27</date> + <initials>XEP Editor (mam)</initials> + <remark><p>Initial published version approved by the XMPP Council.</p></remark> + </revision> + <revision> + <version>0.0.4</version> + <date>2014-12-18</date> + <initials>jp</initials> + <remark><ul> + <li>Big simplification and restriction following council's veto and standard@ discussions</li> + <li>Configuration is now done only on server own configuration</li> + <li>No more client mode</li> + <li>Permissions are adverised using &MESSAGE;</li> + <li>The only &IQ; privilege still available is jabber:iq:roster</li> + </ul> + </remark> + </revision> + <revision> + <version>0.0.3</version> + <date>2014-11-13</date> + <initials>jp</initials> + <remark><ul> + <li>giving permission to manage this XEP namespace is forbidden</li> + <li>Added configuration section; with well-defined command node</li> + <li>better specification of persistent permissions</li> + <li>fixed erroneous example (server returns bookmarks)</li> + <li>added special permissions</li> + <li>better specification of &QUERY; element</li> + </ul> + </remark> + </revision> + <revision> + <version>0.0.2</version> + <date>2014-09-17</date> + <initials>jp</initials> + <remark><ul> + <li>changed for privileged entity</li> + <li>fixes after feedbacks on standard mailing list</li> + <li>completed missing required parts</li> + </ul> + </remark> + </revision> + <revision> + <version>0.0.1</version> + <date>2014-05-09</date> + <initials>jp</initials> + <remark><p>First draft.</p></remark> + </revision> +</header> + +<section1 topic='Introduction' anchor='intro'> + <p>XMPP components are used for long through &xep0114;, but are quite limited: they have a restricted access to other entities data, similar to what a client can do. This is sufficient for components like gateways, but very limiting for more complex components like a PubSub service. The goal of this XEP is to allow a component or any entity to have a "privileged" status, and access some other entity data with the same privileges than the entity itself, that means manage an entity roster on its behalf, send &MESSAGE; or receive &PRESENCE; stanzas in the name of the server.</p> + <p>Privileged entities have numerous advantages, including:</p> + <ul> + <li>a step forward in decentralization: it is possible for an entity to do tasks which were before reserved to server itself. For example, a privileged pubsub component can offer access model based on publisher's roster</li> + <li>better integration of components: a gateway can add items to an entity roster itself</li> + <li>possibility to overpass a server limitation (typically: incomplete PEP implementation)</li> + <li>quick development cycle: developers can implement the components they need without waiting for a new server release</li> + <li>server agnostic</li> + </ul> + <p>Privileged entity has been created with the main goal to create an external, server agnostic, PEP service. It is restricted to only a couple of features, see <link url='#acks'>Acknowledgements section</link> for more details</p> +</section1> + +<section1 topic='Requirements' anchor='reqs'> + <p>A privileged entity must be able to do what a PEP service can do and to access roster, so it must be able to (according to configuration):</p> + <ul> + <li>get and modify the roster of any entity managed by the server</li> + <li>send a &MESSAGE; stanza on behalf of the server</li> + <li>access &PRESENCE; informations for entities in a managed entity's roster (and for managed entity itself)</li> + </ul> + <p>The privilege mechanism MUST be totally transparent for the managed entities.</p> +</section1> + +<section1 topic='Glossary' anchor='glossary'> + <ul> + <li><strong>Privileged entity</strong> — the entity which has a privileged status.</li> + <li><strong>Managed entity</strong> — the entity that is managed by a privileged entity.</li> + </ul> +</section1> + +<section1 topic='Accessing Roster' anchor='access_roster'> + + <section2 topic='Server Allows Roster Access' anchor='server_roster'> + <p>Roster access is granted in the server configuration. Roster access can have 4 types:</p> + <ul> + <li><strong>none</strong> — the entity is not allowed to access managed entity roster at all. This MUST be the default value.</li> + <li><strong>get</strong> — the entity is allowed to send &IQ; stanzas of type <em>'get'</em> for the namespace 'jabber:iq:roster'.</li> + <li><strong>set</strong> — the entity is allowed to send &IQ; stanzas of type <em>'set'</em> for namespace 'jabber:iq:roster'.</li> + <li><strong>both</strong> — the entity is allowed to send &IQ; stanzas of type <em>'get'</em> and <em>'set'</em> for namespace 'jabber:iq:roster'.</li> + </ul> + </section2> + + <section2 topic='Server Advertise Entity Of Allowed Permission' anchor='advertise_roster'> + <p>Once an entity is authenticated and stream is started, the server send it a &MESSAGE; stanza with a <privilege> elements which MUST have the namespace 'urn:xmpp:privilege:0'. This element contains <perm> elements which MUST contain a 'namespace' attribute of the value "jabber:iq:roster" and a 'type' attribute which must correspond to the type configured as specified in <link url='#server_roster'>"Server Allows Roster Access" section</link></p> + <example caption='Server Advertise Roster Privilege'><![CDATA[ +<message from='capulet.net' to='pubub.capulet.lit' id='12345'> + <privilege xmlns='urn:xmpp:privilege:0'> + <perm namespace='jabber:iq:roster' type='both'/> + </privilege> +</message> + ]]></example> +<p>Here <em>pubsub.capulet.lit</em> is allowed to do <em>get</em> and <em>set</em> operations on all entities managed by capulet.lit</p> + </section2> + + <section2 topic='Privileged Entity Manage Roster' anchor='priv_manage_roster'> + <p>Doing a <em>get</em> or <em>set</em> operation on the roster of a managed entity is done in the usual way (as described in &rfc6121; section 2), except that the 'to' attribute is set to the attribute of the managed entity. The server MUST check that the privileged entity has right to <em>get</em> or <em>set</em> the roster of managed entity, and MUST return a &forbidden; error if it is not the case:</p> + <example caption='Privileged Entity Get Managed Entity Roster'><![CDATA[ +<iq id='roster1' + from='pubsub.capulet.lit' + to='juliet@example.com' + type='get' + id='roster1'> + <query xmlns='jabber:iq:roster'/> +</iq> + ]]></example> + + <p>The server then answers normally, as it would have done to the managed entity:</p> + <example caption='Server Answers To Privileged Entity'><![CDATA[ +<iq id='roster1' + from='juliet@example.com' + to='pubsub.capulet.net' + type='result'> + <query xmlns='jabber:iq:roster' ver='ver7'> + <item jid='nurse@example.com'/> + <item jid='romeo@example.net'/> + </query> +</iq> + ]]></example> + + </section2> +</section1> + +<section1 topic='Message Permission' anchor='message'> + <section2 topic='Authorizing Messages' anchor='auth_mess'> + <p>In some cases, it can be desirable to send notifications (e.g. PEP service), so the privileged entity must be able to send &MESSAGE; stanzas. This is allowed in server configuration in the same way as for roster permission. The permission type can have the following values:</p> + <ul> + <li><strong>none</strong> — the entity is not allowed to send &MESSAGE; stanza in the name of the server. This MUST be the default value.</li> + <li><strong>outgoing</strong> — the entity is allowed to send &MESSAGE; stanzas in the name of the server, according to following restrictions.</li> + </ul> + <p>A privileged entity can then send message on the behalf either of the server or of a bare JID of the server, using &xep0297;, with the following restrictions:</p> + <ol> + <li>forwarded &MESSAGE; 'type' attribute has the value of "headline"</li> + <li>forwarded &MESSAGE; 'from' attribute MUST be a bare JID from the server, no resource is allowed</li> + </ol> + <p>If any of this rules is violated, the server MUST return a <not-authorized/> stream error and close the connection, as explained in &rfc6120; section 4.9.3.12.</p> + </section2> + + <section2 topic='Advertising Permission' anchor='advertise_mess'> + <p>Server advertise "message" permission in the same way as for "roster" permission, except that 'namespace' attribute has the value of "message", and the 'type' attribute as a value of 'outgoing':</p> + <example caption='Server Advertise Roster And Message Privileges'><![CDATA[ +<message from='capulet.net' to='pubub.capulet.lit' id='54321'> + <privilege xmlns='urn:xmpp:privilege:0'> + <perm namespace='jabber:iq:roster' type='both'/> + <perm namespace='message' type='outgoing'/> + </privilege> +</message> +]]></example> + </section2> + + <section2 topic='Sending Messages' anchor='sending_mess'> + <p>Now that <em>pubsub.capulet.lit</em> is allowed, it can send messages using <forwarded/> elements.</p> + <example caption='privileged entity send a notificaction message'><![CDATA[ +<message from='pubsub.capulet.lit' to='capulet.lit' id='notif1'> + <forwarded xmlns='urn:xmpp:forward:0'> + <message from='juliet@capulet.lit' + id='foo' + to='romeo@montague.lit/orchard' + type='headline' + xmlns='jabber:client'> + <event xmlns='http://jabber.org/protocol/pubsub#event'> + <items node='http://jabber.org/protocol/tune'> + <item> + <tune xmlns='http://jabber.org/protocol/tune'> + <artist>Gerald Finzi</artist> + <length>255</length> + <source>Music for "Love's Labors Lost" (Suite for small orchestra)</source> + <title>Introduction (Allegro vigoroso)</title> + <track>1</track> + </tune> + </item> + </items> + </event> + <delay xmlns='urn:xmpp:delay' stamp='2014-11-25T14:34:32Z'/> + </message> + </forwarded> +</message> + ]]></example> + <p>The server sees that forwarded message type is '<em>headline</em>', that <em>juliet@capulet.lit</em> is a bare JID of the server, and that outgoing message permission was granted in admin mode (so all bare JIDs from server are allowed); it can now send the notification:</p> + <example caption='server sends the notification as if it was originating from him'><![CDATA[ +<message from='juliet@capulet.lit' + id='bar' + to='romeo@montague.lit/orchard' + type='headline'> + <event xmlns='http://jabber.org/protocol/pubsub#event'> + <items node='http://jabber.org/protocol/tune'> + <item> + <tune xmlns='http://jabber.org/protocol/tune'> + <artist>Gerald Finzi</artist> + <length>255</length> + <source>Music for "Love's Labors Lost" (Suite for small orchestra)</source> + <title>Introduction (Allegro vigoroso)</title> + <track>1</track> + </tune> + </item> + </items> + </event> + <delay xmlns='urn:xmpp:delay' stamp='2014-11-25T14:34:32Z'/> +</message> + ]]></example> + </section2> +</section1> + +<section1 topic='Presence Permission' anchor='presence'> + <section2 topic='Managed Entity Presence' anchor='managed_ent_presence'> + <p>It can be often desirable for a privileged entity to have presence information of the managed entities (e.g. to know when to send them notificiations). As privileges must be transparent for the managed entity, this presence has to be sent by the server without modifying managed entity roster.</p> + <p>This is allowed in server configuration in the same way as for <em>roster</em> and <em>message</em> permissions. The "presence" type can have the following values:</p> + <ul> + <li><strong>none</strong> — the entity is not allowed to access &PRESENCE; informations at all. This MUST be the default value.</li> + <li><strong>managed_entity</strong> — the entity is allowed to receive managed entity presence (see below).</li> + <li><strong>roster</strong> — the entity is allowed to receive presence informations of managed entity contacts, see <link url='#roster_presence'>Roster Presence section</link>.</li> + </ul> + <p>If the privilege is granted, the server MUST use a directed presence, as specified in &rfc6121; section 4.6 on the behalf of managed entity each time its presence information change.</p> + </section2> + + <section2 topic='Advertising Permission' anchor='advertise_managed_presence'> + <p>Server advertise "presence" permission in the same way as for "roster" or "message" permissions, except that 'namespace' attribute has the value of "presence", and the 'type' attribute has a value of "managed_entity"</p> + </section2> + + <section2 topic="Server Send presence informations" anchor='server_send_presence'> + <p>Once the "presence" permission is granted, the server send presence informations:</p> +<example caption='server receives new presence from Juliet'><![CDATA[ +<presence from='juliet@capulet.lit/balcony' + id='presence1' + xml:lang='en'> + <show>chat</show> + <status>Staying on the balcony</status> +</presence> +]]></example> + +<example caption='server redirects presence to privileged entity'><![CDATA[ +<presence from='juliet@capulet.lit/balcony' + to='pubsub.capulet.lit' + id='presence1' + xml:lang='en'> + <show>chat</show> + <status>Staying on the balcony</status> +</presence> +]]></example> + + </section2> + + <section2 topic='Roster Presence' anchor='roster_presence'> + <p>In addition to "<link url='#managed_ent_presence'>managed entity presence</link>", a privileged entity may need to know when a contact in managed entity roster is online (for example, it's necessary for a PEP service because of the presence default access model).</p> + <p>As for other permissions, the access in granted in server's configuration, but there is a additional restriction: the privileged entity MUST have read permission on roster namespace (i.e. 'type' attribute in allowed <perm> of namespace <em>jabber:iq:roster</em> MUST have a value of either <strong>get</strong> or <strong>both</strong>).</p> + <p>If the delegation is granted, the server MUST send to the privileged entity every presence information that the privileged entity is receiving. Having "roster" type for "presence" permission imply that you have also implicitly "managed_entity" type.</p><p>The server MUST reject the permission if the privileged entity doesn't have read permission on roster namespace.</p> + <p>Note: this permission should be given carefully, as it gives access to presence of potentially a lot of entities to the privileged entity (see <link url='#security'>security considerations</link>).</p> + </section2> + + <section2 topic='Advertising Permission' anchor='advertise_roster_presence'> + <p>Server advertise roster "presence" permission in the same way as for other permissions, except that the 'namespace' attribute has the value of "presence", and the 'type' attribute has a value of "roster"</p> + <example caption='Server Advertise Roster, Message, Managed Entity Presence and Roster Presence Privileges'><![CDATA[ +<message from='capulet.net' to='pubub.capulet.lit' id='54321'> + <privilege xmlns='urn:xmpp:privilege:0'> + <perm namespace='jabber:iq:roster' type='both'/> + <perm namespace='message'/> + <perm namespace='presence' type='roster'/> + </privilege> +</message> +]]></example> +<p>Note the presence of <em>jabber:iq:roster</em> permission request.</p> + </section2> + + <section2 topic="Privileged Entity Receive Roster Presences" anchor='priv_rec_roster_presence'> +<example caption="server receives new presence from Romeo, which is in Juliet's roster"><![CDATA[ +<presence from='romeo@montaigu.lit/orchard'/> +]]></example> +<example caption='server sends the presence as usually, but also to the privileged entity'><![CDATA[ +<presence from='romeo@montaigu.lit/orchard' + to='juliet@capulet.lit'/> +<presence from='romeo@montaigu.lit/orchard' + to='pubsub.capulet.lit'/> +]]></example> +</section2> +</section1> + +<section1 topic='Security Considerations' anchor='security'> + <ol> + <li>Privileged entitiy has access to sensitive data, and can act as the server itself, permissions should be granted carefuly, only if you absolutely trust the entity.</li> + <li><link url='#roster_presence'>Roster presence</link> is particulary sensitive, because presence informations of whole rosters are shared.</li> + </ol> +</section1> + +<section1 topic='IANA Considerations' anchor='iana'> + <p>This document requires no interaction with &IANA;.</p> +</section1> + +<section1 topic='XMPP Registrar Considerations' anchor='registrar'> + <section2 topic='Protocol Namespaces' anchor='ns'> + <p>The ®ISTRAR; includes 'urn:xmpp:privilege:0' in its registry of protocol namespaces (see &NAMESPACES;).</p> + <ul> + <li>urn:xmpp:privilege:0</li> + </ul> + </section2> + <section2 topic='Protocol Versioning' anchor='registrar-versioning'> + &NSVER; + </section2> +</section1> + +<section1 topic='XML Schema' anchor='schema'> + <code><![CDATA[ +<?xml version='1.0' encoding='UTF-8'?> + +<xs:schema + xmlns:xs='http://www.w3.org/2001/XMLSchema' + targetNamespace='urn:xmpp:privilege:0' + xmlns='urn:xmpp:privilege:0' + elementFormDefault='qualified'> + + <xs:element name='privilege'> + <xs:complexType> + <xs:element name='perm' + maxOccurs='unbounded'> + <xs:complexType> + <xs:attribute name='namespace' use='required' type='xs:string'/> + <xs:simpleType base='xs:NMTOKEN'> + <xs:enumeration value='jabber:iq:roster'/> + <xs:enumeration value='message'/> + <xs:enumeration value='presence'/> + </xs:simpleType> + <xs:attribute name='type' use='required'> + <xs:simpleType base='xs:NMTOKEN'> + <xs:enumeration value='none'/> + <xs:enumeration value='get'/> + <xs:enumeration value='set'/> + <xs:enumeration value='both'/> + <xs:enumeration value='outgoing'/> + <xs:enumeration value='managed_entity'/> + <xs:enumeration value='roster'/> + </xs:simpleType> + </xs:attribute> + </xs:complexType> + </xs:element> + </xs:complexType> +</xs:element> + +</xs:schema> + ]]></code> +</section1> + +<section1 topic='Acknowledgements' anchor='acks'> + <p>Thanks to Sergey Dobrov, Dave Cridland, Steven Lloyd Watkin, Lance Stout and Johannes Hund for their feedbacks. Thanks to Adrien Cossa for his typos/style corrections.</p> + <p>Privileged entity was initialy written to be a generic identity based access control (IBAC) which allows an entity to access sensitive data. After <link url='http://mail.jabber.org/pipermail/standards/2014-December/029378.html'>a discussion on standard mailing list</link>, it has been decided to restrict the current XEP to immediate needs to build an external PEP service, and to implement separately an Attribute Based Access Control (ABAC) which is more modern, generic and flexible. This XEP is still interesting for being easy to implement and doing the job.</p> + +</section1> + +</xep>
--- a/xmpp/xep-proto-namespace-delegation.xml Sun Mar 08 14:33:03 2015 +0100 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,572 +0,0 @@ -<?xml version='1.0' encoding='UTF-8'?> -<!DOCTYPE xep SYSTEM 'xep.dtd' [ - <!ENTITY % ents SYSTEM 'xep.ent'> -%ents; -]> -<?xml-stylesheet type='text/xsl' href='xep.xsl'?> -<xep> -<header> - <title>namespace delegation</title> - <abstract>This specification provides a way for XMPP server to delegate treatments for a namespace to an other entity</abstract> - <legal> - <copyright>This XMPP Extension Protocol is copyright (c) 1999 - 2014 by the XMPP Standards Foundation (XSF).</copyright> - <permissions>Permission is hereby granted, free of charge, to any person obtaining a copy of this specification (the "Specification"), to make use of the Specification without restriction, including without limitation the rights to implement the Specification in a software program, deploy the Specification in a network service, and copy, modify, merge, publish, translate, distribute, sublicense, or sell copies of the Specification, and to permit persons to whom the Specification is furnished to do so, subject to the condition that the foregoing copyright notice and this permission notice shall be included in all copies or substantial portions of the Specification. Unless separate permission is granted, modified works that are redistributed shall not contain misleading information regarding the authors, title, number, or publisher of the Specification, and shall not claim endorsement of the modified works by the authors, any organization or project to which the authors belong, or the XMPP Standards Foundation.</permissions> - <warranty>## NOTE WELL: This Specification is provided on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, express or implied, including, without limitation, any warranties or conditions of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A PARTICULAR PURPOSE. In no event shall the XMPP Standards Foundation or the authors of this Specification be liable for any claim, damages, or other liability, whether in an action of contract, tort, or otherwise, arising from, out of, or in connection with the Specification or the implementation, deployment, or other use of the Specification. ##</warranty> - <liability>In no event and under no legal theory, whether in tort (including negligence), contract, or otherwise, unless required by applicable law (such as deliberate and grossly negligent acts) or agreed to in writing, shall the XMPP Standards Foundation or any author of this Specification be liable for damages, including any direct, indirect, special, incidental, or consequential damages of any character arising out of the use or inability to use the Specification (including but not limited to damages for loss of goodwill, work stoppage, computer failure or malfunction, or any and all other commercial damages or losses), even if the XMPP Standards Foundation or such author has been advised of the possibility of such damages.</liability> - <conformance>This XMPP Extension Protocol has been contributed in full conformance with the XSF's Intellectual Property Rights Policy (a copy of which may be found at <<link url='http://xmpp.org/extensions/ipr-policy.shtml'>http://xmpp.org/extensions/ipr-policy.shtml</link>> or obtained by writing to XSF, P.O. Box 1641, Denver, CO 80201 USA).</conformance> - </legal> - <number>xxxx</number> - <status>ProtoXEP</status> - <type>Standards Track</type> - <sig>Standards</sig> - <approver>Council</approver> - <dependencies> - <spec>XMPP Core</spec> - <spec>XEP-0004</spec> - <spec>XEP-0297</spec> - </dependencies> - <supersedes/> - <supersededby/> - <shortname>NOT_YET_ASSIGNED</shortname> - <author> - <firstname>Jérôme</firstname> - <surname>Poisson</surname> - <email>goffi@goffi.org</email> - <jid>goffi@jabber.fr</jid> - </author> - <revision> - <version>0.0.2</version> - <date>2014-11-27</date> - <initials>jp</initials> - <remark><p></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>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> - <li>decentralize a server feature to an entity under client control</li> - <li>make a component which react on new user registration, independent of server implementation</li> - <li>server agnostic roster filtering</li> - </ul> -</section1> -<section1 topic='Requirements' anchor='reqs'> - <p>Namespace delegation can be used in two modes:</p> - <ul> - <li><strong>admin</strong> mode, where delegation is specified by the server administrator.</li> - <li><strong>client</strong> mode, where it can be requested by any user.</li> - </ul> - <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> - <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> -</section1> -<section1 topic='Glossary' anchor='glossary'> - <ul> - <li><strong>Delegated namespace</strong> — the namespace being managed by an external entity.</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='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 MAY have a 'delegation' attribute with the value "admin".</p> - <p>Namespace delegations are asked with a <delegate/> element, which MUST contain a 'namespace' attribute set to the requested namespace.</p> - <p>Only <iq/> 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' 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 <delegate> 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'> - <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> - </section2> - - <section2 topic='Server Forwards Delegated &IQ; Stanza' anchor='stanza_forward'> - <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> - <example caption='Juliet sends her mood to her server via PEP'><![CDATA[ -<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> -]]></example> -<p>The server gets this stanza, sees that this namespace is delegated to <em>pubsub.capulet.lit</em>, so it forwards it:</p> - -<example caption='server delegate the stanza to pubsub.capulet.lit'><![CDATA[ -<iq from='juliet@capulet.lit/balcony' - 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> -</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 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' - id='pep1' - type='result'> - <pubsub xmlns='http://jabber.org/protocol/pubsub' /> -</iq> -]]></example> - - <p>The workflow is fully transparent for Juliet.</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> - - <example caption='Juliet adds Romeo to her roster'><![CDATA[ -<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> -]]></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> -]]></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> - <example caption='filtering component accept Romeo'><![CDATA[ -<iq from='filter.capulet.lit' - to='juliet@capulet.lit/balcony' - id='delegate1' - type='result' /> -]]></example> - <example caption='server forward 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> - <example caption='filter.capulet.lit uses privileged entity to add Romeo'><![CDATA[ -<iq to='juliet@capulet.lit' - from='filter.capulet.lit' - id='roster2' - type='set'> - <query xmlns='jabber:iq:roster'> - <item jid='romeo@montaigu.lit' - name='My Romeo'> - <group>Rivals</group> - </item> - </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> - - <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> - - </section3> - - </section2> - - -</section1> - -<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>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' - delegation='client' - 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> - <example caption='server asks user for the namespace delegation'><![CDATA[ -<message from='capulet.lit' to='juliet@capulet.lit'> - <body> - pubsub.montaigu.lit wants to manage a feature normally managed by the server. - Do you allow it to manage the following features? - - Be careful! According management to an entity is a serious thing, - think twice that you can trust the entity before doing this. - </body> - <x xmlns='jabber:x:data' type='form'> - <title>Delegation request</title> - <instructions>pubsub.montaigu.lit wants to manage the following features: - 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> - </field> - <field type='list-single' - label='Manage PubSub (http://jabber.org/protocol/pubsub)' - var='http://jabber.org/protocol/pubsub'> - <value>0</value> - <option label='No'><value>0</value></option> - <option label='Yes'><value>1</value></option> - </field> - </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 client can then answer to the form:</p> - <example caption='client answer to the form'><![CDATA[ -<message from='juliet@capulet.lit' to='capulet.lit'> - <x xmlns='jabber:x:data' type='submit'> - <field var='FORM_TYPE'> - <value></value> - </field> - <field var='challenge'><value>5439123</value></field> - <field var='http://jabber.org/protocol/pubsub'><value>1</value></field> - </x> -</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 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' from='juliet@capulet.lit'> - <delegate namespace='http://jabber.org/protocol/pubsub'/> - </query> -</iq> - ]]></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>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> - <example caption="service discovery information request"><![CDATA[ -<iq from='pubsub.capulet.lit' - id='disco1' - to='capulet.lit' - type='get'> - <query xmlns='http://jabber.org/protocol/disco#info'/> -</iq> - ]]></example> - <example caption="service discovery information response"><![CDATA[ -<iq from='capulet.lit' - id='disco1' - to='pubsub.capulet.lit' - type='result'> - <query xmlns='http://jabber.org/protocol/disco#info'> - ... - <feature var='urn:xmpp:delegation:0'/> - ... - </query> -</iq> - ]]></example> - </section2> - <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>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' - id='disco1' - to='capulet.lit' - type='get'> - <query xmlns='http://jabber.org/protocol/disco#info'/> -</iq> - ]]> -</example> -<p>Server delegates its PubSub namespace to <em>pubsub.capulet.lit</em>, so it asks its available features for this namespace like this:</p> -<example caption="capulet.lit requests disco infos for pubsub namespace to pubsub.capulet.lit"><![CDATA[ -<iq from='capulet.lit' - id='disco2' - to='pubsub.capulet.lit' - type='get'> - <query xmlns='http://jabber.org/protocol/disco#info' - node='urn:xmpp:delegation:0::http://jabber.org/protocol/pubsub'/> -</iq> - ]]> -</example> -<p>Note that in real situation, server has probably this information already in cache (see <link url='#impl'>Implementation Notes</link>).<br/> - <em>pubsub.capulet.lit</em> returns its available features:</p> -<example caption="pubsub.capulet.lit returns features to nest"><![CDATA[ -<iq from='pubsub.capulet.lit' - id='disco2' - to='capulet.lit' - type='result'> - <query xmlns='http://jabber.org/protocol/disco#info' - node='urn:xmpp:delegation:0::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'/> - <feature var='http://jabber.org/protocol/pubsub#publish-options'/> - </query> -</iq> - ]]> -</example> -<p>Server include the results in its own discovery info results:</p> -<example caption="capulet.lit return disco info including features from pubsub.capulet.lit"><![CDATA[ -<iq from='capulet.lit' - id='disco1' - 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'/> - ... - <feature var='http://jabber.org/protocol/pubsub'/> - <feature var='http://jabber.org/protocol/pubsub#publish'/> - <feature var='http://jabber.org/protocol/pubsub#subscribe'/> - <feature var='http://jabber.org/protocol/pubsub#publish-options'/> - ... - </query> -</iq> - ]]> -</example> -<p>Note that '<em>http://jabber.org/protocol/pubsub#auto-create</em>' is not available.</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> - <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[ -<iq from='juliet@capulet.lit/balcony' - id='disco3' - to='juliet@capulet.lit' - type='get'> - <query xmlns='http://jabber.org/protocol/disco#info'/> -</iq> - ]]> -</example> -<p>Server delegate its PubSub namespace to <em>pubsub.capulet.lit</em>, so it ask its available features for this namespace like this:</p> -<example caption="capulet.lit requests disco infos for pubsub namespace to pubsub.capulet.lit"><![CDATA[ -<iq from='capulet.lit' - id='disco4' - 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'/> -</iq> - ]]> -</example> -<p>As for general case, server has probably <link url='#impl'>this information already in cache</link>.<br/> - <em>pubsub.capulet.lit</em> returns its available features:</p> -<example caption="pubsub.capulet.lit returns features to nest"><![CDATA[ -<iq from='pubsub.capulet.lit' - id='disco4' - to='capulet.lit' - type='result'> - <query xmlns='http://jabber.org/protocol/disco#info' - node='urn:xmpp:delegation:0: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'/> - <feature var='http://jabber.org/protocol/pubsub#auto-subscribe'/> - <feature var='http://jabber.org/protocol/pubsub#config-node'/> - <feature var='http://jabber.org/protocol/pubsub#create-and-configure'/> - <feature var='http://jabber.org/protocol/pubsub#create-nodes'/> - <feature var='http://jabber.org/protocol/pubsub#filtered-notifications'/> - <feature var='http://jabber.org/protocol/pubsub#persistent-items'/> - <feature var='http://jabber.org/protocol/pubsub#publish'/> - <feature var='http://jabber.org/protocol/pubsub#retrieve-items'/> - <feature var='http://jabber.org/protocol/pubsub#subscribe'/> - ... - </query> -</iq> - ]]> -</example> -<p>Then the server returns the answer to Juliet, as in general case, with requested bare JID in 'from' field.</p> -<example caption="capulet.lit returns disco info to Juliet"><![CDATA[ -<iq from='juliet@capulet.lit' - id='disco3' - to='juliet@capulet.lit/balcony' - type='result'> - <query xmlns='http://jabber.org/protocol/disco#info'> - <identity category='account' type='registered'/> - <identity category='pubsub' type='pep'/> - <feature var='http://jabber.org/protocol/pubsub#access-presence'/> - <feature var='http://jabber.org/protocol/pubsub#auto-create'/> - <feature var='http://jabber.org/protocol/pubsub#auto-subscribe'/> - <feature var='http://jabber.org/protocol/pubsub#config-node'/> - <feature var='http://jabber.org/protocol/pubsub#create-and-configure'/> - <feature var='http://jabber.org/protocol/pubsub#create-nodes'/> - <feature var='http://jabber.org/protocol/pubsub#filtered-notifications'/> - <feature var='http://jabber.org/protocol/pubsub#persistent-items'/> - <feature var='http://jabber.org/protocol/pubsub#publish'/> - <feature var='http://jabber.org/protocol/pubsub#retrieve-items'/> - <feature var='http://jabber.org/protocol/pubsub#subscribe'/> - ... - </query> -</iq> - ]]> -</example> - - </section3> - </section2> -</section1> - -<section1 topic='Business Rules' anchor='rules'> - <ol> - <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> - </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> - </ol> -</section1> -<section1 topic='Security Considerations' anchor='security'> - <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, 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> - </ol> -</section1> -<section1 topic='IANA Considerations' anchor='iana'> - <p>This document requires no interaction with &IANA;.</p> -</section1> -<section1 topic='XMPP Registrar Considerations' anchor='registrar'> - <section2 topic='Protocol Namespaces' anchor='ns'> - <p>The ®ISTRAR; includes 'urn:xmpp:delegation:0' in its registry of protocol namespaces (see &NAMESPACES;).</p> - <ul> - <li>urn:xmpp:delegation:0</li> - </ul> - </section2> - <section2 topic='Protocol Versioning' anchor='registrar-versioning'> - &NSVER; - </section2> -</section1> -<section1 topic='XML Schema' anchor='schema'> - <code><![CDATA[ -<?xml version='1.0' encoding='UTF-8'?> - -<xs:schema - xmlns:xs='http://www.w3.org/2001/XMLSchema' - targetNamespace='urn:xmpp:delegation:0' - xmlns='urn:xmpp:delegation:0' - elementFormDefault='qualified'> - - <xs:element name='query'> - <xs:complexType> - <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' - maxOccurs='unbounded'> - <xs:complexType> - <xs:attribute name='namespace' use='required' type='xs:string'/> - </xs:complexType> - </xs:element> - </xs:complexType> - </xs:element> - -</xs:schema> - ]]></code> -</section1> -<section1 topic='Acknowledgements' anchor='acks'> - <p>This XEP is linked with XEP-XXXX privileged entity 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> -</section1> -</xep>
--- a/xmpp/xep-proto-privileged-component.xml Sun Mar 08 14:33:03 2015 +0100 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,386 +0,0 @@ -<?xml version='1.0' encoding='UTF-8'?> -<!DOCTYPE xep SYSTEM 'xep.dtd' [ - <!ENTITY % ents SYSTEM 'xep.ent'> -%ents; -]> -<?xml-stylesheet type='text/xsl' href='xep.xsl'?> -<xep> -<header> - <title>privileged entity</title> - <abstract>This specification provides a way for XMPP entities to have a privileged access to some other entities data</abstract> - <legal> - <copyright>This XMPP Extension Protocol is copyright (c) 1999 - 2014 by the XMPP Standards Foundation (XSF).</copyright> - <permissions>Permission is hereby granted, free of charge, to any person obtaining a copy of this specification (the "Specification"), to make use of the Specification without restriction, including without limitation the rights to implement the Specification in a software program, deploy the Specification in a network service, and copy, modify, merge, publish, translate, distribute, sublicense, or sell copies of the Specification, and to permit persons to whom the Specification is furnished to do so, subject to the condition that the foregoing copyright notice and this permission notice shall be included in all copies or substantial portions of the Specification. Unless separate permission is granted, modified works that are redistributed shall not contain misleading information regarding the authors, title, number, or publisher of the Specification, and shall not claim endorsement of the modified works by the authors, any organization or project to which the authors belong, or the XMPP Standards Foundation.</permissions> - <warranty>## NOTE WELL: This Specification is provided on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, express or implied, including, without limitation, any warranties or conditions of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A PARTICULAR PURPOSE. In no event shall the XMPP Standards Foundation or the authors of this Specification be liable for any claim, damages, or other liability, whether in an action of contract, tort, or otherwise, arising from, out of, or in connection with the Specification or the implementation, deployment, or other use of the Specification. ##</warranty> - <liability>In no event and under no legal theory, whether in tort (including negligence), contract, or otherwise, unless required by applicable law (such as deliberate and grossly negligent acts) or agreed to in writing, shall the XMPP Standards Foundation or any author of this Specification be liable for damages, including any direct, indirect, special, incidental, or consequential damages of any character arising out of the use or inability to use the Specification (including but not limited to damages for loss of goodwill, work stoppage, computer failure or malfunction, or any and all other commercial damages or losses), even if the XMPP Standards Foundation or such author has been advised of the possibility of such damages.</liability> - <conformance>This XMPP Extension Protocol has been contributed in full conformance with the XSF's Intellectual Property Rights Policy (a copy of which may be found at <<link url='http://xmpp.org/extensions/ipr-policy.shtml'>http://xmpp.org/extensions/ipr-policy.shtml</link>> or obtained by writing to XSF, P.O. Box 1641, Denver, CO 80201 USA).</conformance> - </legal> - <number>xxxx</number> - <status>ProtoXEP</status> - <type>Standards Track</type> - <sig>Standards</sig> - <approver>Council</approver> - <dependencies> - <spec>XMPP Core</spec> - </dependencies> - <supersedes/> - <supersededby/> - <shortname>NOT_YET_ASSIGNED</shortname> - <author> - <firstname>Jérôme</firstname> - <surname>Poisson</surname> - <email>goffi@goffi.org</email> - <jid>goffi@jabber.fr</jid> - </author> - <revision> - <version>0.0.4</version> - <date>2014-12-18</date> - <initials>jp</initials> - <remark><ul> - <li>Big simplification and restriction following council's veto and standard@ discussions</li> - <li>Configuration is now done only on server own configuration</li> - <li>No more client mode</li> - <li>Permissions are adverised using &MESSAGE;</li> - <li>The only &IQ; privilege still available is jabber:iq:roster</li> - </ul> - </remark> - </revision> - <revision> - <version>0.0.3</version> - <date>2014-11-13</date> - <initials>jp</initials> - <remark><ul> - <li>giving permission to manage this XEP namespace is forbidden</li> - <li>Added configuration section; with well-defined command node</li> - <li>better specification of persistent permissions</li> - <li>fixed erroneous example (server returns bookmarks)</li> - <li>added special permissions</li> - <li>better specification of &QUERY; element</li> - </ul> - </remark> - </revision> - <revision> - <version>0.0.2</version> - <date>2014-09-17</date> - <initials>jp</initials> - <remark><ul> - <li>changed for privileged entity</li> - <li>fixes after feedbacks on standard mailing list</li> - <li>completed missing required parts</li> - </ul> - </remark> - </revision> - <revision> - <version>0.0.1</version> - <date>2014-05-09</date> - <initials>jp</initials> - <remark><p>First draft.</p></remark> - </revision> -</header> - -<section1 topic='Introduction' anchor='intro'> - <p>XMPP components are used for long through &xep0114;, but are quite limited: they have a restricted access to other entities data, similar to what a client can do. This is sufficient for components like gateways, but very limiting for more complex components like a PubSub service. The goal of this XEP is to allow a component or any entity to have a "privileged" status, and access some other entity data with the same privileges than the entity itself, that means manage an entity roster on its behalf, send &MESSAGE; or receive &PRESENCE; stanzas in the name of the server.</p> - <p>Privileged entities have numerous advantages, including:</p> - <ul> - <li>a step forward in decentralization: it is possible for an entity to do tasks which were before reserved to server itself. For example, a privileged pubsub component can offer access model based on publisher's roster</li> - <li>better integration of components: a gateway can add items to an entity roster itself</li> - <li>possibility to overpass a server limitation (typically: incomplete PEP implementation)</li> - <li>quick development cycle: developers can implement the components they need without waiting for a new server release</li> - <li>server agnostic</li> - </ul> - <p>Privileged entity has been created with the main goal to create an external, server agnostic, PEP service. It is restricted to only a couple of features, see <link url='#acks'>Acknowledgements section</link> for more details</p> -</section1> - -<section1 topic='Requirements' anchor='reqs'> - <p>A privileged entity must be able to do what a PEP service can do and to access roster, so it must be able to (according to configuration):</p> - <ul> - <li>get and modify the roster of any entity managed by the server</li> - <li>send a &MESSAGE; stanza on behalf of the server</li> - <li>access &PRESENCE; informations for entities in a managed entity's roster (and for managed entity itself)</li> - </ul> - <p>The privilege mechanism MUST be totally transparent for the managed entities.</p> -</section1> - -<section1 topic='Glossary' anchor='glossary'> - <ul> - <li><strong>Privileged entity</strong> — the entity which has a privileged status.</li> - <li><strong>Managed entity</strong> — the entity that is managed by a privileged entity.</li> - </ul> -</section1> - -<section1 topic='Accessing roster' anchor='access_roster'> - - <section2 topic='Server Allows Roster Access' anchor='server_roster'> - <p>Roster access is granted in the server configuration. Roster access can have 4 types:</p> - <ul> - <li><strong>none</strong> — the entity is not allowed to access managed entity roster at all. This MUST be the default value.</li> - <li><strong>get</strong> — the entity is allowed to send &IQ; stanzas of type <em>'get'</em> for the namespace 'jabber:iq:roster'.</li> - <li><strong>set</strong> — the entity is allowed to send &IQ; stanzas of type <em>'set'</em> for namespace 'jabber:iq:roster'.</li> - <li><strong>both</strong> — the entity is allowed to send &IQ; stanzas of type <em>'get'</em> and <em>'set'</em> for namespace 'jabber:iq:roster'.</li> - </ul> - </section2> - - <section2 topic='Server Advertise Entity Of Allowed Permission' anchor='advertise_roster'> - <p>Once an entity is authenticated and stream is started, the server send it a &MESSAGE; stanza with a <privilege> elements which MUST have the namespace 'urn:xmpp:privilege:0'. This element contains <perm> elements which MUST contain a 'namespace' attribute of the value "jabber:iq:roster" and a 'type' attribute which must correspond to the type configured as specified in <link url='#server_roster'>"Server Allows Roster Access" section</link></p> - <example caption='Server Advertise Roster Privilege'><![CDATA[ -<message from='capulet.net' to='pubub.capulet.lit' id='12345'> - <privilege xmlns='urn:xmpp:privilege:0'> - <perm namespace='jabber:iq:roster' type='both'/> - </privilege> -</message> - ]]></example> -<p>Here <em>pubsub.capulet.lit</em> is allowed to do <em>get</em> and <em>set</em> operations on all entities managed by capulet.lit</p> - </section2> - - <section2 topic='Privileged Entity Manage Roster' anchor='priv_manage_roster'> - <p>Doing a <em>get</em> or <em>set</em> operation on the roster of a managed entity is done in the usual way (as described in &rfc6121; section 2), except that the 'to' attribute is set to the attribute of the managed entity. The server MUST check that the privileged entity has right to <em>get</em> or <em>set</em> the roster of managed entity, and MUST return a &forbidden; error if it is not the case:</p> - <example caption='Privileged Entity Get Managed Entity Roster'><![CDATA[ -<iq id='roster1' - from='pubsub.capulet.lit' - to='juliet@example.com' - type='get' - id='roster1'> - <query xmlns='jabber:iq:roster'/> -</iq> - ]]></example> - - <p>The server then answers normally, as it would have done to the managed entity:</p> - <example caption='Server Answers To Privileged Entity'><![CDATA[ -<iq id='roster1' - from='juliet@example.com' - to='pubsub.capulet.net' - type='result'> - <query xmlns='jabber:iq:roster' ver='ver7'> - <item jid='nurse@example.com'/> - <item jid='romeo@example.net'/> - </query> -</iq> - ]]></example> - - </section2> -</section1> - -<section1 topic='Message Permission' anchor='message'> - <section2 topic='Authorizing Messages' anchor='auth_mess'> - <p>In some cases, it can be desirable to send notifications (e.g. PEP service), so the privileged entity must be able to send &MESSAGE; stanzas. This is allowed in server configuration in the same way as for roster permission. The permission type can have the following values:</p> - <ul> - <li><strong>none</strong> — the entity is not allowed to send &MESSAGE; stanza in the name of the server. This MUST be the default value.</li> - <li><strong>outgoing</strong> — the entity is allowed to send &MESSAGE; stanzas in the name of the server, according to following restrictions.</li> - </ul> - <p>A privileged entity can then send message on the behalf either of the server or of a bare JID of the server, using &xep0297;, with the following restrictions:</p> - <ol> - <li>forwarded &MESSAGE; 'type' attribute has the value of "headline"</li> - <li>forwarded &MESSAGE; 'from' attribute MUST be a bare JID from the server, no resource is allowed</li> - </ol> - <p>If any of this rules is violated, the server MUST return a <not-authorized/> stream error and close the connection, as explained in &rfc6120; section 4.9.3.12.</p> - </section2> - - <section2 topic='Advertising Permission' anchor='advertise_mess'> - <p>Server advertise "message" permission in the same way as for "roster" permission, except that 'namespace' attribute has the value of "message", and the 'type' attribute as a value of 'outgoing':</p> - <example caption='Server Advertise Roster And Message Privileges'><![CDATA[ -<message from='capulet.net' to='pubub.capulet.lit' id='54321'> - <privilege xmlns='urn:xmpp:privilege:0'> - <perm namespace='jabber:iq:roster' type='both'/> - <perm namespace='message' type='outgoing'/> - </privilege> -</message> -]]></example> - </section2> - - <section2 topic='Sending messages' anchor='sending_mess'> - <p>Now that <em>pubsub.capulet.lit</em> is allowed, it can send messages using <forwarded/> elements.</p> - <example caption='privileged entity send a notificaction message'><![CDATA[ -<message from='pubsub.capulet.lit' to='capulet.lit' id='notif1'> - <forwarded xmlns='urn:xmpp:forward:0'> - <message from='juliet@capulet.lit' - id='foo' - to='romeo@montague.lit/orchard' - type='headline' - xmlns='jabber:client'> - <event xmlns='http://jabber.org/protocol/pubsub#event'> - <items node='http://jabber.org/protocol/tune'> - <item> - <tune xmlns='http://jabber.org/protocol/tune'> - <artist>Gerald Finzi</artist> - <length>255</length> - <source>Music for "Love's Labors Lost" (Suite for small orchestra)</source> - <title>Introduction (Allegro vigoroso)</title> - <track>1</track> - </tune> - </item> - </items> - </event> - <delay xmlns='urn:xmpp:delay' stamp='2014-11-25T14:34:32Z'/> - </message> - </forwarded> -</message> - ]]></example> - <p>The server sees that forwarded message type is '<em>headline</em>', that <em>juliet@capulet.lit</em> is a bare JID of the server, and that outgoing message permission was granted in admin mode (so all bare JIDs from server are allowed); it can now send the notification:</p> - <example caption='server sends the notification as if it was originating from him'><![CDATA[ -<message from='juliet@capulet.lit' - id='bar' - to='romeo@montague.lit/orchard' - type='headline'> - <event xmlns='http://jabber.org/protocol/pubsub#event'> - <items node='http://jabber.org/protocol/tune'> - <item> - <tune xmlns='http://jabber.org/protocol/tune'> - <artist>Gerald Finzi</artist> - <length>255</length> - <source>Music for "Love's Labors Lost" (Suite for small orchestra)</source> - <title>Introduction (Allegro vigoroso)</title> - <track>1</track> - </tune> - </item> - </items> - </event> - <delay xmlns='urn:xmpp:delay' stamp='2014-11-25T14:34:32Z'/> -</message> - ]]></example> - </section2> -</section1> - -<section1 topic='Presence Permission' anchor='presence'> - <section2 topic='Managed Entity Presence' anchor='managed_ent_presence'> - <p>It can be often desirable for a privileged entity to have presence information of the managed entities (e.g. to know when to send them notificiations). As privileges must be transparent for the managed entity, this presence has to be sent by the server without modifying managed entity roster.</p> - <p>This is allowed in server configuration in the same way as for <em>roster</em> and <em>message</em> permissions. The "presence" type can have the following values:</p> - <ul> - <li><strong>none</strong> — the entity is not allowed to access &PRESENCE; informations at all. This MUST be the default value.</li> - <li><strong>managed_entity</strong> — the entity is allowed to receive managed entity presence (see below).</li> - <li><strong>roster</strong> — the entity is allowed to receive presence informations of managed entity contacts, see <link url='#roster_presence'>Roster Presence section</link>.</li> - </ul> - <p>If the privilege is granted, the server MUST use a directed presence, as specified in &rfc6121; section 4.6 on the behalf of managed entity each time its presence information change.</p> - </section2> - - <section2 topic='Advertising Permission' anchor='advertise_managed_presence'> - <p>Server advertise "presence" permission in the same way as for "roster" or "message" permissions, except that 'namespace' attribute has the value of "presence", and the 'type' attribute has a value of "managed_entity"</p> - </section2> - - <section2 topic="Server Send presence informations" anchor='server_send_presence'> - <p>Once the "presence" permission is granted, the server send presence informations:</p> -<example caption='server receives new presence from Juliet'><![CDATA[ -<presence from='juliet@capulet.lit/balcony' - id='presence1' - xml:lang='en'> - <show>chat</show> - <status>Staying on the balcony</status> -</presence> -]]></example> - -<example caption='server redirects presence to privileged entity'><![CDATA[ -<presence from='juliet@capulet.lit/balcony' - to='pubsub.capulet.lit' - id='presence1' - xml:lang='en'> - <show>chat</show> - <status>Staying on the balcony</status> -</presence> -]]></example> - - </section2> - - <section2 topic='Roster Presence' anchor='roster_presence'> - <p>In addition to "<link url='#managed_ent_presence'>managed entity presence</link>", a privileged entity may need to know when a contact in managed entity roster is online (for example, it's necessary for a PEP service because of the presence default access model).</p> - <p>As for other permissions, the access in granted in server's configuration, but there is a additional restriction: the privileged entity MUST have read permission on roster namespace (i.e. 'type' attribute in allowed <perm> of namespace <em>jabber:iq:roster</em> MUST have a value of either <strong>get</strong> or <strong>both</strong>).</p> - <p>If the delegation is granted, the server MUST send to the privileged entity every presence information that the privileged entity is receiving. Having "roster" type for "presence" permission imply that you have also implicitly "managed_entity" type.</p><p>The server MUST reject the permission if the privileged entity doesn't have read permission on roster namespace.</p> - <p>Note: this permission should be given carefully, as it gives access to presence of potentially a lot of entities to the privileged entity (see <link url='#security'>security considerations</link>).</p> - </section2> - - <section2 topic='Advertising Permission' anchor='advertise_roster_presence'> - <p>Server advertise roster "presence" permission in the same way as for other permissions, except that the 'namespace' attribute has the value of "presence", and the 'type' attribute has a value of "roster"</p> - <example caption='Server Advertise Roster, Message, Managed Entity Presence and Roster Presence Privileges'><![CDATA[ -<message from='capulet.net' to='pubub.capulet.lit' id='54321'> - <privilege xmlns='urn:xmpp:privilege:0'> - <perm namespace='jabber:iq:roster' type='both'/> - <perm namespace='message'/> - <perm namespace='presence' type='roster'/> - </privilege> -</message> -]]></example> -<p>Note the presence of <em>jabber:iq:roster</em> permission request.</p> - </section2> - - <section2 topic="Privileged Entity Receive Roster Presences" anchor='priv_rec_roster_presence'> -<example caption="server receives new presence from Romeo, which is in Juliet's roster"><![CDATA[ -<presence from='romeo@montaigu.lit/orchard'/> -]]></example> -<example caption='server sends the presence as usually, but also to the privileged entity'><![CDATA[ -<presence from='romeo@montaigu.lit/orchard' - to='juliet@capulet.lit'/> -<presence from='romeo@montaigu.lit/orchard' - to='pubsub.capulet.lit'/> -]]></example> -</section2> -</section1> - -<section1 topic='Security Considerations' anchor='security'> - <ol> - <li>Privileged entitiy has access to sensitive data, and can act as the server itself, permissions should be granted carefuly, only if you absolutely trust the entity.</li> - <li><link url='#roster_presence'>Roster presence</link> is particulary sensitive, because presence informations of whole rosters are shared.</li> - </ol> -</section1> - -<section1 topic='IANA Considerations' anchor='iana'> - <p>This document requires no interaction with &IANA;.</p> -</section1> - -<section1 topic='XMPP Registrar Considerations' anchor='registrar'> - <section2 topic='Protocol Namespaces' anchor='ns'> - <p>The ®ISTRAR; includes 'urn:xmpp:privilege:0' in its registry of protocol namespaces (see &NAMESPACES;).</p> - <ul> - <li>urn:xmpp:privilege:0</li> - </ul> - </section2> - <section2 topic='Protocol Versioning' anchor='registrar-versioning'> - &NSVER; - </section2> -</section1> - -<section1 topic='XML Schema' anchor='schema'> - <code><![CDATA[ -<?xml version='1.0' encoding='UTF-8'?> - -<xs:schema - xmlns:xs='http://www.w3.org/2001/XMLSchema' - targetNamespace='urn:xmpp:privilege:0' - xmlns='urn:xmpp:privilege:0' - elementFormDefault='qualified'> - - <xs:element name='privilege'> - <xs:complexType> - <xs:element name='perm' - maxOccurs='unbounded'> - <xs:complexType> - <xs:attribute name='namespace' use='required' type='xs:string'/> - <xs:simpleType base='xs:NMTOKEN'> - <xs:enumeration value='jabber:iq:roster'/> - <xs:enumeration value='message'/> - <xs:enumeration value='presence'/> - </xs:simpleType> - <xs:attribute name='type' use='required'> - <xs:simpleType base='xs:NMTOKEN'> - <xs:enumeration value='none'/> - <xs:enumeration value='get'/> - <xs:enumeration value='set'/> - <xs:enumeration value='both'/> - <xs:enumeration value='outgoing'/> - <xs:enumeration value='managed_entity'/> - <xs:enumeration value='roster'/> - </xs:simpleType> - </xs:attribute> - </xs:complexType> - </xs:element> - </xs:complexType> -</xs:element> - -</xs:schema> - ]]></code> -</section1> - -<section1 topic='Acknowledgements' anchor='acks'> - <p>Thanks to Sergey Dobrov, Dave Cridland, Steven Lloyd Watkin, Lance Stout and Johannes Hund for their feedbacks. Thanks to Adrien Cossa for his typos/style corrections.</p> - <p>Privileged entity was initialy written to be a generic identity based access control (IBAC) which allows an entity to access sensitive data. After <link url='http://mail.jabber.org/pipermail/standards/2014-December/029378.html'>a discussion on standard mailing list</link>, it has been decided to restrict the current XEP to immediate needs to build an external PEP service, and to implement separately an Attribute Based Access Control (ABAC) which is more modern, generic and flexible. This XEP is still interesting for being easy to implement and doing the job.</p> - -</section1> - -</xep>