mirror of
https://github.com/moparisthebest/xeps
synced 2024-11-25 02:32:18 -05:00
0.0.4
This commit is contained in:
parent
aa3e72952b
commit
0e9ce928a3
@ -7,7 +7,7 @@
|
|||||||
<xep>
|
<xep>
|
||||||
<header>
|
<header>
|
||||||
<title>privileged entity</title>
|
<title>privileged entity</title>
|
||||||
<abstract>This specification provides a way for XMPP entities to have a privileged access to other entities data</abstract>
|
<abstract>This specification provides a way for XMPP entities to have a privileged access to some other entities data</abstract>
|
||||||
<legal>
|
<legal>
|
||||||
<copyright>This XMPP Extension Protocol is copyright (c) 1999 - 2014 by the XMPP Standards Foundation (XSF).</copyright>
|
<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>
|
<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>
|
||||||
@ -22,8 +22,6 @@
|
|||||||
<approver>Council</approver>
|
<approver>Council</approver>
|
||||||
<dependencies>
|
<dependencies>
|
||||||
<spec>XMPP Core</spec>
|
<spec>XMPP Core</spec>
|
||||||
<spec>XEP-0114</spec>
|
|
||||||
<spec>XEP-0004</spec>
|
|
||||||
</dependencies>
|
</dependencies>
|
||||||
<supersedes/>
|
<supersedes/>
|
||||||
<supersededby/>
|
<supersededby/>
|
||||||
@ -34,6 +32,19 @@
|
|||||||
<email>goffi@goffi.org</email>
|
<email>goffi@goffi.org</email>
|
||||||
<jid>goffi@jabber.fr</jid>
|
<jid>goffi@jabber.fr</jid>
|
||||||
</author>
|
</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>
|
<revision>
|
||||||
<version>0.0.3</version>
|
<version>0.0.3</version>
|
||||||
<date>2014-11-13</date>
|
<date>2014-11-13</date>
|
||||||
@ -68,26 +79,26 @@
|
|||||||
</header>
|
</header>
|
||||||
|
|
||||||
<section1 topic='Introduction' anchor='intro'>
|
<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 an other entity data with the same privileges than the entity itself, that means send and receive &IQ; stanzas on its behalf (and in <link url='#special'>some cases</link>, send &MESSAGE; or receive &PRESENCE; stanzas).</p>
|
<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>
|
<p>Privileged entities have numerous advantages, including:</p>
|
||||||
<ul>
|
<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>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>better integration of components: a gateway can add items to an entity roster itself</li>
|
||||||
<li>possibility to overpass a server limitation</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>quick development cycle: developers can implement the components they need without waiting for a new server release</li>
|
||||||
<li>server agnostic</li>
|
<li>server agnostic</li>
|
||||||
</ul>
|
</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>
|
||||||
|
|
||||||
<section1 topic='Requirements' anchor='reqs'>
|
<section1 topic='Requirements' anchor='reqs'>
|
||||||
<p>A privileged entity can be used in two modes:</p>
|
<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>
|
<ul>
|
||||||
<li><strong>admin</strong> mode, where it is installed by the server administrator.</li>
|
<li>get and modify the roster of any entity managed by the server</li>
|
||||||
<li><strong>client</strong> mode, where it can be installed by any user</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>
|
</ul>
|
||||||
<p>In <em>admin</em> mode, the privileged entity MAY be able to emit &IQ; stanzas in the same way as any entity, including managing roster or accessing persistent storage. The privilege mechanism MUST be totally transparent for the managed entities.</p>
|
<p>The privilege mechanism MUST be totally transparent for the managed entities.</p>
|
||||||
<p>In <em>client</em> mode, a privileged entity MUST have an explicit authorization for any &IQ; 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>
|
|
||||||
<p>In addition, some <link url='#special'>special permissions</link> can permit to send &MESSAGE; stanzas on behalf of the server or access &PRESENCE; informations.</p>
|
|
||||||
</section1>
|
</section1>
|
||||||
|
|
||||||
<section1 topic='Glossary' anchor='glossary'>
|
<section1 topic='Glossary' anchor='glossary'>
|
||||||
@ -97,56 +108,35 @@
|
|||||||
</ul>
|
</ul>
|
||||||
</section1>
|
</section1>
|
||||||
|
|
||||||
<section1 topic='Admin Mode Use Cases' anchor='admin_usecases'>
|
<section1 topic='Accessing roster' anchor='access_roster'>
|
||||||
|
|
||||||
<section2 topic='Permission Request Use Case' anchor='admin_perm'>
|
<section2 topic='Server Allows Roster Access' anchor='server_roster'>
|
||||||
<section3 topic='Entity Requests Admin Privilege' anchor='req_status'>
|
<p>Roster access is granted in the server configuration. Roster access can have 4 types:</p>
|
||||||
<p>Once an entity is authenticated and stream is started, it can request a privileged status. It does it by sending an &IQ; stanza with <strong>'urn:xmpp:privilege:0'</strong> namespace.</p>
|
|
||||||
<p>The &QUERY; element MUST have a "request" type and MAY have a 'privilege' attribute with the value "admin". Namespace permissions are asked with a <perm/> element, which MUST contain a 'namespace' attribute set to the requested namespace and a 'type' attribute which can be:</p>
|
|
||||||
<ul>
|
<ul>
|
||||||
<li><strong>get</strong> — the entity needs the privilege to send &IQ; stanzas of type <em>'get'</em></li>
|
<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>set</strong> — the entity needs the privilege to send &IQ; stanzas of type <em>'set'</em></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>both</strong> — the entity needs the privilege to send &IQ; stanzas of type <em>'get'</em> and <em>'set'</em></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>
|
</ul>
|
||||||
<example caption='Entity asks for admin privilege'><![CDATA[
|
|
||||||
<iq from='pubsub.capulet.net' type='get' id='privilege1'>
|
|
||||||
<query xmlns='urn:xmpp:privilege:0' type='request' privilege='admin'>
|
|
||||||
<perm namespace='jabber:iq:roster' type='both'/>
|
|
||||||
<perm namespace='http://jabber.org/protocol/pubsub' type='both'/>
|
|
||||||
</query>
|
|
||||||
</iq>
|
|
||||||
]]></example>
|
|
||||||
</section3>
|
|
||||||
<section3 topic='Server Accepts Admin Privilege' anchor='accept_status'>
|
|
||||||
<p>If the server accepts the privileged status (e.g.: admin status specified in configuration), it MUST return an &IQ; result stanza with a &QUERY; element of type "allowed", and listing the allowed permissions in <perm/> elements:</p>
|
|
||||||
<example caption='Server accepts admin privilege'><![CDATA[
|
|
||||||
<iq from='capulet.net' to='pubsub.capulet.net' type='result' id='privilege1'>
|
|
||||||
<query xmlns='urn:xmpp:privilege:0'
|
|
||||||
type='allowed'>
|
|
||||||
<perm namespace='jabber:iq:roster' type='both'/>
|
|
||||||
<perm namespace='http://jabber.org/protocol/pubsub' type='both'/>
|
|
||||||
</query>
|
|
||||||
</iq>
|
|
||||||
]]></example>
|
|
||||||
<p>Note: the granted permissions MAY be different from the requested ones, according to server's configuration.</p>
|
|
||||||
</section3>
|
|
||||||
<section3 topic='Server Rejects Admin Privilege' anchor='reject_status'>
|
|
||||||
<p>If the server rejects the privileged status, it MUST return a &forbidden; error:</p>
|
|
||||||
<example caption='Server rejects admin privilege'><![CDATA[
|
|
||||||
<iq from='capulet.net' to='pubsub.capulet.net' type='error' id='privilege1'>
|
|
||||||
<error type='cancel'>
|
|
||||||
<forbidden xmlns='urn:ietf:params:xml:ns:xmpp-stanzas'/>
|
|
||||||
</error>
|
|
||||||
</iq>
|
|
||||||
]]></example>
|
|
||||||
</section3>
|
|
||||||
</section2>
|
</section2>
|
||||||
|
|
||||||
<section2 topic='Privileged Entity Sends &IQ; Stanzas' anchor='priv_iq_admin'>
|
<section2 topic='Server Advertise Entity Of Allowed Permission' anchor='advertise_roster'>
|
||||||
<p>Sending an &IQ; stanza is done by sending the stanza the way it would be done by the managed entity, except that its JID is in the 'to' attribute. In the following example, the PubSub service want to know Juliet's roster because she owns a node with access model based on publiser's roster:</p>
|
<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='Privileged Entity Sends A Roster Stanza'><![CDATA[
|
<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'
|
<iq id='roster1'
|
||||||
xmlns='urn:xmpp:privilege:0'
|
from='pubsub.capulet.lit'
|
||||||
to='juliet@example.com'
|
to='juliet@example.com'
|
||||||
type='get'
|
type='get'
|
||||||
id='roster1'>
|
id='roster1'>
|
||||||
@ -167,176 +157,37 @@
|
|||||||
</iq>
|
</iq>
|
||||||
]]></example>
|
]]></example>
|
||||||
|
|
||||||
<p>In the following example, the sync.capulet.net privileged entity want to access managed entity's bookmarks to synchronize them with an online service. It can request the bookmarks in the following way:</p>
|
|
||||||
<example caption='Privileged Entity Request Bookmarks'><![CDATA[
|
|
||||||
<iq id='bookmark1'
|
|
||||||
to='juliet@capulet.lit'
|
|
||||||
type='get'>
|
|
||||||
<pubsub xmlns='http://jabber.org/protocol/pubsub'>
|
|
||||||
<items node='storage:bookmarks'/>
|
|
||||||
</pubsub>
|
|
||||||
</iq>
|
|
||||||
]]></example>
|
|
||||||
<p>and server answers:</p>
|
|
||||||
|
|
||||||
<example caption='Server Returns Bookmarks'><![CDATA[
|
|
||||||
<iq id='bookmark1'
|
|
||||||
to='sync.capulet.net'
|
|
||||||
type='result'>
|
|
||||||
<pubsub xmlns='http://jabber.org/protocol/pubsub'>
|
|
||||||
<items node='storage:bookmarks'>
|
|
||||||
<item id='current'>
|
|
||||||
<storage xmlns='storage:bookmarks'>
|
|
||||||
<conference name='The Play's the Thing'
|
|
||||||
autojoin='true'
|
|
||||||
jid='theplay@conference.shakespeare.lit'>
|
|
||||||
<nick>JC</nick>
|
|
||||||
</conference>
|
|
||||||
</storage>
|
|
||||||
</item>
|
|
||||||
</items>
|
|
||||||
</pubsub>
|
|
||||||
</iq>
|
|
||||||
]]></example>
|
|
||||||
</section2>
|
</section2>
|
||||||
</section1>
|
</section1>
|
||||||
|
|
||||||
<section1 topic='Client Mode Use Cases' anchor='client_usecases'>
|
<section1 topic='Message Permission' anchor='message'>
|
||||||
<section2 topic='Permission Request Use Case' anchor='client_perm'>
|
<section2 topic='Authorizing Messages' anchor='auth_mess'>
|
||||||
<p>In <em>client</em> mode, the privileged entity is not certified by the server administrator, so the permissions MUST be <strong>explicitly</strong> allowed by the managed entity. This is initiated by the privileged 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>
|
<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>
|
||||||
<ol>
|
<ul>
|
||||||
<li>the privilege type is <em>client</em> instead of <em>admin</em></li>
|
<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>the privilege is given per entity, so the managed entity MUST be specified in a 'to' attribute</li>
|
<li><strong>outgoing</strong> — the entity is allowed to send &MESSAGE; stanzas in the name of the server, according to following restrictions.</li>
|
||||||
</ol>
|
</ul>
|
||||||
<p>If an entity want a read/write access to a client's roster (Juliet) and a read only access to her pubsub, it can ask the permission like this:
|
|
||||||
</p>
|
|
||||||
<example caption='Entity asks for user privilege'><![CDATA[
|
|
||||||
<iq from='priv.montaigu.net' to='capulet.net' type='get' id='privilege1'>
|
|
||||||
<query xmlns='urn:xmpp:privilege:0'
|
|
||||||
type='request'
|
|
||||||
privilege='client'
|
|
||||||
to='juliet@capulet.net'>
|
|
||||||
<perm namespace='jabber:iq:roster' type='both'/>
|
|
||||||
<perm namespace='http://jabber.org/protocol/pubsub' type='get'/>
|
|
||||||
</query>
|
|
||||||
</iq>
|
|
||||||
]]></example>
|
|
||||||
<p>Once received the permission request, the server asks the client to grant or deny the requested permission using &xep0004;. The form SHOULD allow to fine tune the granted permissions. The server uses a challenge which it MUST have generated himself.
|
|
||||||
</p>
|
|
||||||
<example caption='Server asks user for the permission'><![CDATA[
|
|
||||||
<message from='capulet.net' to='juliet@capulet.net'>
|
|
||||||
<body>
|
|
||||||
priv.montaigu.net wants some privileges.
|
|
||||||
Do you you allow him to use the following features?
|
|
||||||
|
|
||||||
Be careful! According permissions 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>Privileges request</title>
|
|
||||||
<instructions>priv.montaigu.net wants to use 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:privilege:0</value>
|
|
||||||
</field>
|
|
||||||
<field type='list-single'
|
|
||||||
label='Manage roster (jabber:iq:roster) READ/WRITE'
|
|
||||||
var='jabber:iq:roster'>
|
|
||||||
<value>0</value>
|
|
||||||
<option label='None'><value>none</value></option>
|
|
||||||
<option label='Read only (get)'><value>get</value></option>
|
|
||||||
<option label='Write only (set)'><value>set</value></option>
|
|
||||||
<option label='Read and write (both)'><value>both</value></option>
|
|
||||||
</field>
|
|
||||||
<field type='list-single'
|
|
||||||
label='Manage PubSub (http://jabber.org/protocol/pubsub) READ'
|
|
||||||
var='http://jabber.org/protocol/pubsub'>
|
|
||||||
<value>0</value>
|
|
||||||
<option label='None'><value>none</value></option>
|
|
||||||
<option label='Read only (get)'><value>get</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>none</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.net' to='capulet.net'>
|
|
||||||
<x xmlns='jabber:x:data' type='submit'>
|
|
||||||
<field var='FORM_TYPE'>
|
|
||||||
<value></value>
|
|
||||||
</field>
|
|
||||||
<field var='challenge'><value>5439123</value></field>
|
|
||||||
<field var='jabber:iq:roster'><value>both</value></field>
|
|
||||||
<field var='http://jabber.org/protocol/pubsub'><value>none</value></field>
|
|
||||||
</x>
|
|
||||||
</message>
|
|
||||||
]]></example>
|
|
||||||
<p>Here Juliet allows <em>priv.montaigu.net</em> to use 'set' and 'get' in order to manage her roster, but doesn't want it to do any 'get' on her pubsub nodes.</p>
|
|
||||||
<p>Finaly, the server notify the entity of the granted permissions. 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 permissions'><![CDATA[
|
|
||||||
<iq from='capulet.net' to='priv.montaigu.net' type='set' id='privilege2'>
|
|
||||||
<query xmlns='urn:xmpp:privilege:0'
|
|
||||||
type='allowed'
|
|
||||||
from='juliet@capulet.net'>
|
|
||||||
<perm namespace='jabber:iq:roster' type='both'/>
|
|
||||||
<perm namespace='http://jabber.org/protocol/pubsub' type='none'/>
|
|
||||||
</query>
|
|
||||||
</iq>
|
|
||||||
]]></example>
|
|
||||||
<p>The privileged entity can now act according to permission granted to him.</p>
|
|
||||||
</section2>
|
|
||||||
<section2 topic='Privileged Entity Sends &IQ; Stanzas' anchor='priv_iq_client'>
|
|
||||||
<p>Sending &IQ; stanzas is done in the exact same way as for <link url='#priv_iq_admin'>admin mode</link>. If an entity wants to sent a non authorized &IQ;, it will get a &forbidden; error:</p>
|
|
||||||
<example caption='Entity Request bookmarks'><![CDATA[
|
|
||||||
<iq to='juliet@capulet.lit' type='get' id='bookmark1'>
|
|
||||||
<pubsub xmlns='http://jabber.org/protocol/pubsub'>
|
|
||||||
<items node='storage:bookmarks'/>
|
|
||||||
</pubsub>
|
|
||||||
</iq>
|
|
||||||
]]></example>
|
|
||||||
|
|
||||||
<example caption='The Stanza Is Not Autorized !'><![CDATA[
|
|
||||||
<iq from='capulet.net' to='priv.montaigu.net' type='error' id='bookmark1'>
|
|
||||||
<error type='cancel'>
|
|
||||||
<forbidden xmlns='urn:ietf:params:xml:ns:xmpp-stanzas'/>
|
|
||||||
</error>
|
|
||||||
</iq>
|
|
||||||
]]></example>
|
|
||||||
</section2>
|
|
||||||
</section1>
|
|
||||||
|
|
||||||
<section1 topic='Special permissions' anchor='special'>
|
|
||||||
<p>In some cases, an entity may need extra permission beyond what &IQ; stanzas can do. An entity may want to send &MESSAGE; stanzas on behalf of the server, or get &PRESENCE; informations. The special permissions manage these cases with some restrictions.</p>
|
|
||||||
|
|
||||||
<section2 topic='Message Permission' anchor='message'>
|
|
||||||
<p>With some namespaces it can be desirable to send notifications (e.g. PEP service), so the privileged entity must be able to send &MESSAGE; stanzas. To do this, it MUST request it by using a <perm/> element with the special "message" namespace attribute and a 'type' attribute with the value "outgoing" (any other type MUST be rejected with a &forbidden; error).</p>
|
|
||||||
<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>
|
<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>
|
<ol>
|
||||||
<li>forwarded &MESSAGE; 'type' attribute has the value of "headline"</li>
|
<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>
|
<li>forwarded &MESSAGE; 'from' attribute MUST be a bare JID from the server, no resource is allowed</li>
|
||||||
<li>in client mode, the forwarded &MESSAGE; 'from' attribute can only be one of a managed entity which has explicitly accepted the delegation</li>
|
|
||||||
</ol>
|
</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>
|
<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>
|
||||||
<p>In the following example, <em>pubsub.capulet.lit</em> asks for pubsub and outgoing messages permission</p>
|
</section2>
|
||||||
<example caption='entity asks for outgoing messages permission'><![CDATA[
|
|
||||||
<iq from='pubsub.capulet.net' type='get' id='privilege1'>
|
|
||||||
<query xmlns='urn:xmpp:privilege:0' type='request' privilege='admin'>
|
|
||||||
<perm namespace='message' type='outgoing'/>
|
|
||||||
<perm namespace='http://jabber.org/protocol/pubsub' type='both'/>
|
|
||||||
</query>
|
|
||||||
</iq>
|
|
||||||
]]></example>
|
|
||||||
|
|
||||||
<example caption='server accepts permission'><![CDATA[
|
<section2 topic='Advertising Permission' anchor='advertise_mess'>
|
||||||
<iq from='capulet.net' to='pubsub.capulet.net' type='result' id='privilege1'>
|
<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>
|
||||||
<query xmlns='urn:xmpp:privilege:0' type='allowed'>
|
<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'/>
|
<perm namespace='message' type='outgoing'/>
|
||||||
<perm namespace='http://jabber.org/protocol/pubsub' type='both'/>
|
</privilege>
|
||||||
</query>
|
</message>
|
||||||
</iq>
|
]]></example>
|
||||||
]]></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>
|
<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[
|
<example caption='privileged entity send a notificaction message'><![CDATA[
|
||||||
<message from='pubsub.capulet.lit' to='capulet.lit' id='notif1'>
|
<message from='pubsub.capulet.lit' to='capulet.lit' id='notif1'>
|
||||||
@ -387,28 +238,26 @@
|
|||||||
</message>
|
</message>
|
||||||
]]></example>
|
]]></example>
|
||||||
</section2>
|
</section2>
|
||||||
|
</section1>
|
||||||
|
|
||||||
<section2 topic='Managed Entity Presence' anchor='managed_ent_presence'>
|
<section1 topic='Presence Permission' anchor='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 it notificiations). As privileges must be transparent for the managed entity (in admin mode), this presence has to be sent by the server without modifying managed entity roster.</p>
|
<section2 topic='Managed Entity Presence' anchor='managed_ent_presence'>
|
||||||
<p>To do this, the privileged entity MUST ask for presence information when requesting privileges, using a special "presence" namespace attribute and a 'type' attribute with the value "managed_entity".</p><p>If the delegation 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><p>This privilege MUST NOT be requested in client mode, if so the server MUST reject the request by setting the allowed type to "none". If an entity needs presence information in client mode, it SHOULD request it using the normal &PRESENCE; subscription mechanism.</p>
|
<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>
|
||||||
<example caption='privileged entity asks for pusub privilege with presence'><![CDATA[
|
<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>
|
||||||
<iq from='pubsub.capulet.net' type='get' id='privilege1'>
|
<ul>
|
||||||
<query xmlns='urn:xmpp:privilege:0' type='request' privilege='admin'>
|
<li><strong>none</strong> — the entity is not allowed to access &PRESENCE; informations at all. This MUST be the default value.</li>
|
||||||
<perm namespace='presence' type='managed_entity'/>
|
<li><strong>managed_entity</strong> — the entity is allowed to receive managed entity presence (see below).</li>
|
||||||
<perm namespace='http://jabber.org/protocol/pubsub' type='both'/>
|
<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>
|
||||||
</query>
|
</ul>
|
||||||
</iq>
|
<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>
|
||||||
]]></example>
|
</section2>
|
||||||
|
|
||||||
<example caption='server accepts privileges'><![CDATA[
|
<section2 topic='Advertising Permission' anchor='advertise_managed_presence'>
|
||||||
<iq from='capulet.net' to='pubsub.capulet.net' type='result' id='privilege1'>
|
<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>
|
||||||
<query xmlns='urn:xmpp:privilege:0' type='allowed'>
|
</section2>
|
||||||
<perm namespace='presence' type='managed_entity'/>
|
|
||||||
<perm namespace='http://jabber.org/protocol/pubsub' type='both'/>
|
|
||||||
</query>
|
|
||||||
</iq>
|
|
||||||
]]></example>
|
|
||||||
|
|
||||||
|
<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[
|
<example caption='server receives new presence from Juliet'><![CDATA[
|
||||||
<presence from='juliet@capulet.lit/balcony'
|
<presence from='juliet@capulet.lit/balcony'
|
||||||
id='presence1'
|
id='presence1'
|
||||||
@ -417,6 +266,7 @@
|
|||||||
<status>Staying on the balcony</status>
|
<status>Staying on the balcony</status>
|
||||||
</presence>
|
</presence>
|
||||||
]]></example>
|
]]></example>
|
||||||
|
|
||||||
<example caption='server redirects presence to privileged entity'><![CDATA[
|
<example caption='server redirects presence to privileged entity'><![CDATA[
|
||||||
<presence from='juliet@capulet.lit/balcony'
|
<presence from='juliet@capulet.lit/balcony'
|
||||||
to='pubsub.capulet.lit'
|
to='pubsub.capulet.lit'
|
||||||
@ -426,34 +276,31 @@
|
|||||||
<status>Staying on the balcony</status>
|
<status>Staying on the balcony</status>
|
||||||
</presence>
|
</presence>
|
||||||
]]></example>
|
]]></example>
|
||||||
|
|
||||||
</section2>
|
</section2>
|
||||||
|
|
||||||
<section2 topic='Roster Presence' anchor='roster_presence'>
|
<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>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>In this case, privileged entity MUST ask for presence information when requesting privileges, using a special "presence" namespace attribute (as in previous section) and a 'type' attribute with the value "roster". Furthermore, 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>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 managing entity is receiving.</p><p>The server MUST reject the permission if the privileged entity doesn't have read permission on roster namespace.</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>). If allowed in client mode, server SHOULD display an extra warning when requesting permissions to the managed entity.</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>
|
||||||
<example caption='privileged entity asks for pusub privilege with presence roster'><![CDATA[
|
</section2>
|
||||||
<iq from='pubsub.capulet.net' type='get' id='privilege1'>
|
|
||||||
<query xmlns='urn:xmpp:privilege:0' type='request' privilege='admin'>
|
<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'/>
|
<perm namespace='presence' type='roster'/>
|
||||||
<perm namespace='http://jabber.org/protocol/pubsub' type='both'/>
|
</privilege>
|
||||||
<perm namespace='jabber:iq:roster' type='get'/>
|
</message>
|
||||||
</query>
|
|
||||||
</iq>
|
|
||||||
]]></example>
|
]]></example>
|
||||||
<p>Note the presence of <em>jabber:iq:roster</em> permission request.</p>
|
<p>Note the presence of <em>jabber:iq:roster</em> permission request.</p>
|
||||||
|
</section2>
|
||||||
|
|
||||||
<example caption='server accepts privileges'><![CDATA[
|
<section2 topic="Privileged Entity Receive Roster Presences" anchor='priv_rec_roster_presence'>
|
||||||
<iq from='capulet.net' to='pubsub.capulet.net' type='result' id='privilege1'>
|
|
||||||
<query xmlns='urn:xmpp:privilege:0' type='allowed'>
|
|
||||||
<perm namespace='presence' type='roster'/>
|
|
||||||
<perm namespace='http://jabber.org/protocol/pubsub' type='both'/>
|
|
||||||
<perm namespace='jabber:iq:roster' type='get'/>
|
|
||||||
</query>
|
|
||||||
</iq>
|
|
||||||
]]></example>
|
|
||||||
|
|
||||||
<example caption="server receives new presence from Romeo, which is in Juliet's roster"><![CDATA[
|
<example caption="server receives new presence from Romeo, which is in Juliet's roster"><![CDATA[
|
||||||
<presence from='romeo@montaigu.lit/orchard'/>
|
<presence from='romeo@montaigu.lit/orchard'/>
|
||||||
]]></example>
|
]]></example>
|
||||||
@ -466,55 +313,10 @@
|
|||||||
</section2>
|
</section2>
|
||||||
</section1>
|
</section1>
|
||||||
|
|
||||||
<section1 topic='Configuration' anchor='configuration'>
|
|
||||||
<p>Server SHOULD provide a way for clients to check already granted permission, and revoke them by using &xep0050; on the well-defined command node <strong>'urn:xmpp:privilege:0#configure'</strong>.</p>
|
|
||||||
<p>If present, the configuration commands MUST allow at least to check permissions granted to a privileged entity, and to revoke them. A server MAY offer an option to keep permission from one session to an other (see <link url='#rules'>business rules</link>).</p>
|
|
||||||
</section1>
|
|
||||||
|
|
||||||
<section1 topic='Discovering Support' anchor='disco'>
|
|
||||||
<p>If a server or an entity supports the privileged entity protocol, it MUST report that fact by including a service discovery feature of "urn:xmpp:privilege:0" in response to a &xep0030; information request:</p>
|
|
||||||
<example caption="Service Discovery information request"><![CDATA[
|
|
||||||
<iq from='pubsub.capulet.net'
|
|
||||||
id='disco1'
|
|
||||||
to='capulet.net'
|
|
||||||
type='get'>
|
|
||||||
<query xmlns='http://jabber.org/protocol/disco#info'/>
|
|
||||||
</iq>
|
|
||||||
]]></example>
|
|
||||||
<example caption="Service Discovery information response"><![CDATA[
|
|
||||||
<iq from='capulet.net'
|
|
||||||
id='disco1'
|
|
||||||
to='pubsub.capulet.net'
|
|
||||||
type='result'>
|
|
||||||
<query xmlns='http://jabber.org/protocol/disco#info'>
|
|
||||||
...
|
|
||||||
<feature var='urn:xmpp:privilege:0'/>
|
|
||||||
...
|
|
||||||
</query>
|
|
||||||
</iq>
|
|
||||||
]]></example>
|
|
||||||
</section1>
|
|
||||||
|
|
||||||
<section1 topic='Business Rules' anchor='rules'>
|
|
||||||
<ol>
|
|
||||||
<li>In client mode, server MAY keep permission granted to an entity by a client from one session to an other, but if it do so, it MUST provide configuration like explained in the <link url='#configuration'>suitable section</link>. If server offers this feature, it SHOULD add a field directly in configuration commands.</li>
|
|
||||||
<li>If a client can't check or revoke permission (i.e. it doesn't support &xep0050;) when granting permissions, the server MUST NOT keep granted permissions from one session to an other, and permissions will be asked on each new session.</li>
|
|
||||||
<li>If permissions are changed during a session, server MUST notify privileged entity of the new permissions, like in <link url='#client_perm'>permission request use case</link>.</li>
|
|
||||||
<li>A server MUST NOT grant permission for this XEP namespace (<strong>'urn:xmpp:privilege:0'</strong>).</li>
|
|
||||||
</ol>
|
|
||||||
</section1>
|
|
||||||
|
|
||||||
<section1 topic='Implementation Notes' anchor='impl'>
|
|
||||||
<p>As admin mode is far more easy to implement than client mode, a server MAY choose to only implement the former.</p>
|
|
||||||
</section1>
|
|
||||||
|
|
||||||
<section1 topic='Security Considerations' anchor='security'>
|
<section1 topic='Security Considerations' anchor='security'>
|
||||||
<ol>
|
<ol>
|
||||||
<li>Privileged entity nearly have the same possibility as the server itself, <em>admin</em> permission should be granted carefuly, only if you absolutely trust the entity.</li>
|
<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>A server MAY choose to filter allowed namespaces, to avoid giving dangerous permissions. In this case, it MUST always set the allowed type of filtered namespaces to "<strong>none</strong>"</li>
|
<li><link url='#roster_presence'>Roster presence</link> is particulary sensitive, because presence informations of whole rosters are shared.</li>
|
||||||
<li><link url='#roster_presence'>Roster presence</link> is particulary sensitive, because if an entity accept this permission, it shares presence information of its whole roster. For this reason, a server MAY choose to forbid its use in client mode (by always setting the allowed type to "<strong>none</strong>"). A server SHOULD at least disallow it in default configuration.</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>
|
</ol>
|
||||||
</section1>
|
</section1>
|
||||||
|
|
||||||
@ -544,38 +346,32 @@
|
|||||||
xmlns='urn:xmpp:privilege:0'
|
xmlns='urn:xmpp:privilege:0'
|
||||||
elementFormDefault='qualified'>
|
elementFormDefault='qualified'>
|
||||||
|
|
||||||
<xs:element name='query'>
|
<xs:element name='privilege'>
|
||||||
<xs:complexType>
|
<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='privilege' 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='perm'
|
<xs:element name='perm'
|
||||||
maxOccurs='unbounded'>
|
maxOccurs='unbounded'>
|
||||||
<xs:complexType>
|
<xs:complexType>
|
||||||
<xs:attribute name='namespace' use='required' type='xs:string'/>
|
<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:attribute name='type' use='required'>
|
||||||
<xs:simpleType base='xs:NMTOKEN'>
|
<xs:simpleType base='xs:NMTOKEN'>
|
||||||
<xs:enumeration value='none'/>
|
<xs:enumeration value='none'/>
|
||||||
<xs:enumeration value='get'/>
|
<xs:enumeration value='get'/>
|
||||||
<xs:enumeration value='set'/>
|
<xs:enumeration value='set'/>
|
||||||
<xs:enumeration value='both'/>
|
<xs:enumeration value='both'/>
|
||||||
|
<xs:enumeration value='outgoing'/>
|
||||||
|
<xs:enumeration value='managed_entity'/>
|
||||||
|
<xs:enumeration value='roster'/>
|
||||||
</xs:simpleType>
|
</xs:simpleType>
|
||||||
</xs:attribute>
|
</xs:attribute>
|
||||||
</xs:complexType>
|
</xs:complexType>
|
||||||
</xs:element>
|
</xs:element>
|
||||||
</xs:complexType>
|
</xs:complexType>
|
||||||
</xs:element>
|
</xs:element>
|
||||||
|
|
||||||
</xs:schema>
|
</xs:schema>
|
||||||
]]></code>
|
]]></code>
|
||||||
@ -583,7 +379,8 @@
|
|||||||
|
|
||||||
<section1 topic='Acknowledgements' anchor='acks'>
|
<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>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>The client mode permission mechanism is inspired from &xep0321; permission request.</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>
|
</section1>
|
||||||
|
|
||||||
</xep>
|
</xep>
|
||||||
|
Loading…
Reference in New Issue
Block a user