comparison xmpp/xep-proto-privileged-component.xml @ 17:c6824592e3ef

privileged entity xep update: - the xep is now for any entity, not only components - updated according to standard@ feedbacks: - <privileged/> element removed - permissions are also managed in admin mode - in permission form, it is now recommended to use namespaces for 'var' attribute - filled the missing required parts - "privileged" and "managed" entity are now the terms used - if client can't revoke permissions by itself, they must be revoked on disconnection - renamed "xmlns" attribute of <perm/> to "namespace" - server must notify privileged entity if permissions change during session - various typos fixes
author Goffi <goffi@goffi.org>
date Wed, 17 Sep 2014 20:38:18 +0200
parents 677de998f9d9
children 91d56a6e4b0d
comparison
equal deleted inserted replaced
16:3d3566f95ddc 17:c6824592e3ef
4 %ents; 4 %ents;
5 ]> 5 ]>
6 <?xml-stylesheet type='text/xsl' href='xep.xsl'?> 6 <?xml-stylesheet type='text/xsl' href='xep.xsl'?>
7 <xep> 7 <xep>
8 <header> 8 <header>
9 <title>privileged component</title> 9 <title>privileged entity</title>
10 <abstract>This specification provides a way for XMPP components to have a privileged access to entities data</abstract> 10 <abstract>This specification provides a way for XMPP entities to have a privileged access to other entities data</abstract>
11 <legal> 11 <legal>
12 <copyright>This XMPP Extension Protocol is copyright (c) 1999 - 2014 by the XMPP Standards Foundation (XSF).</copyright> 12 <copyright>This XMPP Extension Protocol is copyright (c) 1999 - 2014 by the XMPP Standards Foundation (XSF).</copyright>
13 <permissions>Permission is hereby granted, free of charge, to any person obtaining a copy of this specification (the &quot;Specification&quot;), 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> 13 <permissions>Permission is hereby granted, free of charge, to any person obtaining a copy of this specification (the &quot;Specification&quot;), 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>
14 <warranty>## NOTE WELL: This Specification is provided on an &quot;AS IS&quot; 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> 14 <warranty>## NOTE WELL: This Specification is provided on an &quot;AS IS&quot; 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>
15 <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> 15 <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>
33 <surname>Poisson</surname> 33 <surname>Poisson</surname>
34 <email>goffi@goffi.org</email> 34 <email>goffi@goffi.org</email>
35 <jid>goffi@jabber.fr</jid> 35 <jid>goffi@jabber.fr</jid>
36 </author> 36 </author>
37 <revision> 37 <revision>
38 <version>0.0.2</version>
39 <date>2014-09-17</date>
40 <initials>jp</initials>
41 <remark><ul>
42 <li>changed for privileged entity</li>
43 <li>fixes after feedbacks on standard mailing list</li>
44 <li>completed missing required parts</li>
45 </ul>
46 </remark>
47 </revision>
48 <revision>
38 <version>0.0.1</version> 49 <version>0.0.1</version>
39 <date>2014-05-09</date> 50 <date>2014-05-09</date>
40 <initials>jp</initials> 51 <initials>jp</initials>
41 <remark><p>First draft.</p></remark> 52 <remark><p>First draft.</p></remark>
42 </revision> 53 </revision>
43 </header> 54 </header>
44 <section1 topic='Introduction' anchor='intro'> 55 <section1 topic='Introduction' anchor='intro'>
45 <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 to have a "privileged" status, and access an entity data with the same privileges than the entity itself, that means send and receive IQ stanzas on its behalf.</p> 56 <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.</p>
46 <p>Privileged component have numerous advantages, including:</p> 57 <p>Privileged entity have numerous advantages, including:</p>
47 <ul> 58 <ul>
48 <li>a step forward in decentralization: it is possible for a component to do tasks which were before reserved to server itself. For example, a privileged pubsub component can offer roster access model</li> 59 <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>
49 <li>better integration of component: a gateway can add items to an entity roster itslef</li> 60 <li>better integration of components: a gateway can add items to an entity roster itself</li>
50 <li>possibility to overpass a server limitation</li> 61 <li>possibility to overpass a server limitation</li>
51 <li>quick development cycle: developers can implement the component they need without waiting for a new server release</li> 62 <li>quick development cycle: developers can implement the components they need without waiting for a new server release</li>
52 <li>server agnostic</li> 63 <li>server agnostic</li>
53 </ul> 64 </ul>
54 </section1> 65 </section1>
55 <section1 topic='Requirements' anchor='reqs'> 66 <section1 topic='Requirements' anchor='reqs'>
56 <p>A privileged component can be used in two modes:</p> 67 <p>A privileged entity can be used in two modes:</p>
57 <ul> 68 <ul>
58 <li><strong>admin</strong> mode, where it is installed by the server administrator</li> 69 <li><strong>admin</strong> mode, where it is installed by the server administrator</li>
59 <li><strong>client</strong> mode, where it can be installed by any user</li> 70 <li><strong>client</strong> mode, where it can be installed by any user</li>
60 </ul> 71 </ul>
61 <p>In <em>admin</em> mode, the component SHOULD be able to emit IQ stanzas in the same way as any entity, including managing roster or accessing persistent storage</p> 72 <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.</p>
62 <p>In <em>client</em> mode, a component MUST have an explicit autorization for any IQ namespace he wants to use. Client MUST be able to check and revoke granted permssions.</p> 73 <p>In <em>client</em> mode, a privileged entity MUST have an explicit autorization 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>
63 </section1> 74 </section1>
64 <section1 topic='Glossary' anchor='glossary'> 75 <section1 topic='Glossary' anchor='glossary'>
65 <ul> 76 <ul>
66 <li><strong>Component</strong> — the privileged component.</li> 77 <li><strong>Privileged entity</strong> — the entity which has or wants a privileged status.</li>
67 <li><strong>Client</strong> — the entity that the component wants to manage.</li> 78 <li><strong>Managed entity</strong> — the entity that the privileged entity wants to manage.</li>
68 </ul> 79 </ul>
69 </section1> 80 </section1>
70 <section1 topic='Admin Mode Use Cases' anchor='admin_usecases'> 81 <section1 topic='Admin Mode Use Cases' anchor='admin_usecases'>
71 82
72 <section2 topic='Permission Request Use Case' anchor='admin_perm'> 83 <section2 topic='Permission Request Use Case' anchor='admin_perm'>
73 <section3 topic='Component request privileged status of admin' anchor='req_status'> 84 <section3 topic='Entity request privileged status of admin' anchor='req_status'>
74 <p>Once the component is authentified and stream is started as explained in &xep0114;, the component can request its privileged status. It do it by sending an IQ stanza with <strong>'urn:xmpp:tmp:privilege:0'</strong> namespace</p> 85 <p>Once the privileged entity is authentified and stream is started, the entity can request its privileged status. It do it by sending an IQ stanza with <strong>'urn:xmpp:privilege:0'</strong> namespace</p>
75 <example caption='Component asks for admin privilege'><![CDATA[ 86 <p>Namespace permissions are asked with a &lt;perm/&gt; element, which MUST contain a 'namespace' attribute set to the requested namespace and a 'type' attribute which can be:</p>
87 <ul>
88 <li><strong>get</strong> — the entity wants to send &IQ; stanza of type <em>'get'</em></li>
89 <li><strong>set</strong> — the entity wants to send &IQ; stanza of type <em>'set'</em></li>
90 <li><strong>both</strong> — the entity wants to send &IQ; stanza of type <em>'get'</em> and <em>'set'</em></li>
91 </ul>
92 <example caption='Entity asks for admin privilege'><![CDATA[
76 <iq from='pubsub.capulet.net' type='get' id='privilege1'> 93 <iq from='pubsub.capulet.net' type='get' id='privilege1'>
77 <query xmlns='urn:xmpp:tmp:privilege:0' type='request' privilege='admin'/> 94 <query xmlns='urn:xmpp:privilege:0' type='request' privilege='admin'>
95 <perm namespace='jabber:iq:roster' type='both'/>
96 <perm namespace='http://jabber.org/protocol/pubsub' type='both'/>
97 </query>
78 </iq> 98 </iq>
79 ]]></example> 99 ]]></example>
80 </section3> 100 </section3>
81 <section3 topic='Server Accept Admin Privilege' anchor='accept_status'> 101 <section3 topic='Server Accept Admin Privilege' anchor='accept_status'>
82 <p>If the server accept the privileged status (e.g.: admin status specified in configuration), it MUST return empty IQ result stanza:</p> 102 <p>If the server accept the privileged status (e.g.: admin status specified in configuration), it MUST return an IQ result stanza, with allowed permissions in &lt;perm/&gt; elements:</p>
83 <example caption='Server accept admin privilege'><![CDATA[ 103 <example caption='Server accept admin privilege'><![CDATA[
84 <iq from='capulet.net' to='pubsub.capulet.net' type='result' id='privilege1' /> 104 <iq from='capulet.net' to='pubsub.capulet.net' type='result' id='privilege1'>
85 ]]></example> 105 <query xmlns='urn:xmpp:privilege:0'
106 type='allowed'>
107 <perm namespace='jabber:iq:roster' type='both'/>
108 <perm namespace='http://jabber.org/protocol/pubsub' type='both'/>
109 </query>
110 </iq>
111 ]]></example>
112 <p>Note: the granted permissions MAY be different from the requested ones, according to server's configuration.</p>
86 </section3> 113 </section3>
87 <section3 topic='Server Reject Admin Privilege' anchor='reject_status'> 114 <section3 topic='Server Reject Admin Privilege' anchor='reject_status'>
88 <p>If the server reject the privileged status, it MUST return a &forbidden; error:</p> 115 <p>If the server reject the privileged status, it MUST return a &forbidden; error:</p>
89 <example caption='Server reject admin privilege'><![CDATA[ 116 <example caption='Server reject admin privilege'><![CDATA[
90 <iq from='capulet.net' to='pubsub.capulet.net' type='error' id='privilege1'> 117 <iq from='capulet.net' to='pubsub.capulet.net' type='error' id='privilege1'>
94 </iq> 121 </iq>
95 ]]></example> 122 ]]></example>
96 </section3> 123 </section3>
97 </section2> 124 </section2>
98 125
99 <section2 topic='Privileged Component Send IQ Stanzas' anchor='priv_iq_admin'> 126 <section2 topic='Privileged Entity Send IQ Stanzas' anchor='priv_iq_admin'>
100 <p>Sending an IQ stanzas is done by remplacing the &IQ; with a &lt;privilege/&gt; element of namespace <strong>'urn:xmpp:tmp:privilege:0'</strong>, and including it in a global IQ stanza. The &lt;privilege/&gt; element is then similar to the IQ stanza the client would have sent. In the following example, the PubSub service want to know juliet's roster because she own a node with roster access model:</p> 127 <p>Sending an IQ stanzas 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 own a node with access model based on publiser's roster:</p>
101 <example caption='Privileged Component Send A Roster Stanza'><![CDATA[ 128 <example caption='Privileged Entity Send A Roster Stanza'><![CDATA[
102 <iq from='pubsub.capulet.net' type='get' id='roster1'> 129 <iq id='roster1'
103 <privilege xmlns='urn:xmpp:tmp:privilege:0' 130 xmlns='urn:xmpp:privilege:0'
104 from='juliet@example.com' 131 to='juliet@example.com'
105 type='get'> 132 type='get'
133 id='roster1'>
106 <query xmlns='jabber:iq:roster'/> 134 <query xmlns='jabber:iq:roster'/>
107 </privilege> 135 </iq>
108 </iq> 136 ]]></example>
109 ]]></example> 137
110 138 <p>The server then answer normaly, as it would have done with the managed entity:</p>
111 <p>The server then answer normaly, as it would have done with the client entity:</p> 139 <example caption='Server Answer To Privileged Entity'><![CDATA[
112 <example caption='Server Answer To Privileged Component'><![CDATA[
113 <iq id='roster1' 140 <iq id='roster1'
114 to='pubsub.caputet.net' 141 to='pubsub.capulet.net'
115 type='result'> 142 type='result'>
116 <query xmlns='jabber:iq:roster' ver='ver7'> 143 <query xmlns='jabber:iq:roster' ver='ver7'>
117 <item jid='nurse@example.com'/> 144 <item jid='nurse@example.com'/>
118 <item jid='romeo@example.net'/> 145 <item jid='romeo@example.net'/>
119 </query> 146 </query>
120 </iq> 147 </iq>
121 ]]></example> 148 ]]></example>
122 149
123 <p>In the following example, the sync.capulet.net privileged component want to access client's bookmarks to synchronize them with an online service. It can request the bookmarks in the following way:</p> 150 <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>
124 <example caption='Privileged Component Request Bookmarks'><![CDATA[ 151 <example caption='Privileged Entity Request Bookmarks'><![CDATA[
125 <iq from='pubsub.capulet.net' type='get' id='bookmark1'> 152 <iq id='bookmark1'
126 <privilege xmlns='urn:xmpp:tmp:privilege:0' 153 to='juliet@capulet.lit'
127 from='juliet@capulet.lit' 154 type='get'>
128 type='get'> 155 <pubsub xmlns='http://jabber.org/protocol/pubsub'>
129 <pubsub xmlns='http://jabber.org/protocol/pubsub'> 156 <items node='storage:bookmarks'/>
130 <items node='storage:bookmarks'/> 157 </pubsub>
131 </pubsub>
132 </privilege>
133 </iq> 158 </iq>
134 ]]></example> 159 ]]></example>
135 <p>and server answer:</p> 160 <p>and server answer:</p>
136 161
137 <example caption='Server Return Bookmarks'><![CDATA[ 162 <example caption='Server Return Bookmarks'><![CDATA[
138 <iq id='bookmark1' 163 <iq id='bookmark1'
139 to='pubsub.caputet.net' 164 to='pubsub.capulet.net'
140 type='result'> 165 type='result'>
141 <pubsub xmlns='http://jabber.org/protocol/pubsub'> 166 <pubsub xmlns='http://jabber.org/protocol/pubsub'>
142 <items node='storage:bookmarks'> 167 <items node='storage:bookmarks'>
143 <item id='current'> 168 <item id='current'>
144 <storage xmlns='storage:bookmarks'> 169 <storage xmlns='storage:bookmarks'>
157 </section1> 182 </section1>
158 183
159 184
160 <section1 topic='Client Mode Use Cases' anchor='client_usecases'> 185 <section1 topic='Client Mode Use Cases' anchor='client_usecases'>
161 <section2 topic='Permission Request Use Case' anchor='client_perm'> 186 <section2 topic='Permission Request Use Case' anchor='client_perm'>
162 <p>In <em>client</em> mode, the component is not certified by the server administrator, so the permissions MUST be <strong>explicitly</strong> allowed by the client. This is initiated by the component (it can be after an interaction with a client, like a subscription). It's done in a the same way as for <em>admin</em> mode with the following exceptions:</p> 187 <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>
163 <ol> 188 <ol>
164 <li>the privilege type is <em>client</em> instead of <em>admin</em></li> 189 <li>the privilege type is <em>client</em> instead of <em>admin</em></li>
165 <li>the privilege is done per entity, so the entity MUST be specified in a 'to' attribute</li> 190 <li>the privilege is done per entity, so the managed entity MUST be specified in a 'to' attribute</li>
166 <li>permission are explicitly asked for every needed namespace</li>
167 </ol> 191 </ol>
168 <p>Namespace permission are asked with a &lt;perm/&gt; element, which MUST contain a 'xmlns' attribute and a 'type' attribute which can be:</p> 192 <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:
169 <ul>
170 <li><strong>get</strong> — the component wants to send &IQ; stanza of type <em>'get'</em></li>
171 <li><strong>set</strong> — the component wants to send &IQ; stanza of type <em>'set'</em></li>
172 <li><strong>both</strong> — the component wants to send &IQ; stanza of type <em>'get'</em> and <em>'set'</em></li>
173 </ul>
174 <p>If a component 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:
175 </p> 193 </p>
176 <example caption='Component Asks For User Privilege'><![CDATA[ 194 <example caption='Entity Asks For User Privilege'><![CDATA[
177 <iq from='priv.montaigu.net' to='capulet.net' type='get' id='privilege1'> 195 <iq from='priv.montaigu.net' to='capulet.net' type='get' id='privilege1'>
178 <query xmlns='urn:xmpp:tmp:privilege:0' 196 <query xmlns='urn:xmpp:privilege:0'
179 type='request' 197 type='request'
180 privilege='client' 198 privilege='client'
181 to='juliet@capulet.net'> 199 to='juliet@capulet.net'>
182 <perm xmlns='jabber:iq:roster' type='both'/> 200 <perm namespace='jabber:iq:roster' type='both'/>
183 <perm xmlns='http://jabber.org/protocol/pubsub' type='get'/> 201 <perm namespace='http://jabber.org/protocol/pubsub' type='get'/>
184 </query> 202 </query>
185 </iq> 203 </iq>
186 ]]></example> 204 ]]></example>
187 <p>Once received the permission request, the server ask to the client if it grant access to the requested permission using &xep0004;. The form SHOULD allow to fine tune the granted permissions. The server use a challenge which it MUST have generated himself. 205 <p>Once received the permission request, the server ask to the client if it grant access to the requested permission using &xep0004;. The form SHOULD allow to fine tune the granted permissions. The server use a challenge which it MUST have generated himself.
188 </p> 206 </p>
190 <message from='capulet.net' to='juliet@capulet.net'> 208 <message from='capulet.net' to='juliet@capulet.net'>
191 <body> 209 <body>
192 priv.montaigu.net wants some privileges. 210 priv.montaigu.net wants some privileges.
193 Do you you allow him to use the following features ? 211 Do you you allow him to use the following features ?
194 212
195 Be careful ! According permissions to component is a serious thing, 213 Be careful ! According permissions to entity is a serious thing,
196 think twice that you can trust the component before doing this. 214 think twice that you can trust the entity before doing this.
197 </body> 215 </body>
198 <x xmlns='jabber:x:data' type='form'> 216 <x xmlns='jabber:x:data' type='form'>
199 <title>Privileges request</title> 217 <title>Privileges request</title>
200 <instructions>priv.montaigu.net wants to use the following features: 218 <instructions>priv.montaigu.net wants to use the following features:
201 Do you allow it?</instructions> 219 Do you allow it?</instructions>
202 <field type='hidden' var='challenge'><value>5439123</value></field> 220 <field type='hidden' var='challenge'><value>5439123</value></field>
203 <field type='hidden' var='FORM_TYPE'> 221 <field type='hidden' var='FORM_TYPE'>
204 <value>urn:xmpp:tmp:privilege:0</value> 222 <value>urn:xmpp:privilege:0</value>
205 </field> 223 </field>
206 <field type='list-single' 224 <field type='list-single'
207 label='Manage roster (jabber:iq:roster) READ/WRITE' 225 label='Manage roster (jabber:iq:roster) READ/WRITE'
208 var='jabber:iq:roster'> 226 var='jabber:iq:roster'>
209 <value>0</value> 227 <value>0</value>
210 <option label='No'><value>0</value></option> 228 <option label='None'><value>none</value></option>
211 <option label='Read only (get)'><value>get</value></option> 229 <option label='Read only (get)'><value>get</value></option>
212 <option label='Write only (set)'><value>set</value></option> 230 <option label='Write only (set)'><value>set</value></option>
213 <option label='Read and write (both)'><value>both</value></option> 231 <option label='Read and write (both)'><value>both</value></option>
214 </field> 232 </field>
215 <field type='list-single' 233 <field type='list-single'
220 <option label='Read only (get)'><value>get</value></option> 238 <option label='Read only (get)'><value>get</value></option>
221 </field> 239 </field>
222 </x> 240 </x>
223 </message> 241 </message>
224 ]]></example> 242 ]]></example>
225 <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).</p> 243 <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>
226 <p>The client can then answer to the form:</p> 244 <p>The client can then answer to the form:</p>
227 <example caption='Client Answer To The Form'><![CDATA[ 245 <example caption='Client Answer To The Form'><![CDATA[
228 <message from='juliet@capulet.net' to='capulet.net'> 246 <message from='juliet@capulet.net' to='capulet.net'>
229 <x xmlns='jabber:x:data' type='submit'> 247 <x xmlns='jabber:x:data' type='submit'>
230 <field var='FORM_TYPE'> 248 <field var='FORM_TYPE'>
235 <field var='http://jabber.org/protocol/pubsub'><value>none</value></field> 253 <field var='http://jabber.org/protocol/pubsub'><value>none</value></field>
236 </x> 254 </x>
237 </message> 255 </message>
238 ]]></example> 256 ]]></example>
239 <p>Here juliet accept that <em>priv.montaigu.net</em> use 'set' and 'get' to manage her roster, but doesn't want it to do any 'get' on her pubsub nodes.</p> 257 <p>Here juliet accept that <em>priv.montaigu.net</em> use 'set' and 'get' to manage her roster, but doesn't want it to do any 'get' on her pubsub nodes.</p>
240 <p>Finaly, the server notify the component of the permission granted. For this it use a &QUERY; element with the 'allowed' type, and put the client jid in a 'from' attribute:</p> 258 <p>Finaly, the server notify the entity of the permissions granted. For this it use a &QUERY; element with the 'allowed' type, and put the client jid in a 'from' attribute:</p>
241 <example caption='Server notify accepted permissions'><![CDATA[ 259 <example caption='Server notify accepted permissions'><![CDATA[
242 <iq from='capulet.net' to='priv.montaigu.net' type='set' id='privilege2'> 260 <iq from='capulet.net' to='priv.montaigu.net' type='set' id='privilege2'>
243 <query xmlns='urn:xmpp:tmp:privilege:0' 261 <query xmlns='urn:xmpp:privilege:0'
244 type='allowed' 262 type='allowed'
245 from='juliet@capulet.net'> 263 from='juliet@capulet.net'>
246 <perm xmlns='jabber:iq:roster' type='both'/> 264 <perm namespace='jabber:iq:roster' type='both'/>
247 <perm xmlns='http://jabber.org/protocol/pubsub' type='none'/> 265 <perm namespace='http://jabber.org/protocol/pubsub' type='none'/>
248 </query> 266 </query>
249 </iq> 267 </iq>
250 ]]></example> 268 ]]></example>
251 <p>The privileged component can now act according to permission granted to him.</p> 269 <p>The privileged entity can now act according to permission granted to him.</p>
252 </section2> 270 </section2>
253 <section2 topic='Privileged Component Send IQ Stanzas' anchor='priv_iq_client'> 271 <section2 topic='Privileged Entity Send IQ Stanzas' anchor='priv_iq_client'>
254 <p>sending IQ stanza is done in the exact same way as for <link url='#priv_iq_admin'>admin mode</link>. If a component want to sent a non authorized IQ, it get a &forbidden; error:</p> 272 <p>sending IQ stanza is done in the exact same way as for <link url='#priv_iq_admin'>admin mode</link>. If an entity want to sent a non authorized IQ, it get a &forbidden; error:</p>
255 <example caption='Component Request bookmarks'><![CDATA[ 273 <example caption='Entity Request bookmarks'><![CDATA[
256 <iq from='priv.montaigu.net' to='capulet.net' type='get' id='bookmark1'> 274 <iq to='juliet@capulet.lit' type='get' id='bookmark1'>
257 <privilege xmlns='urn:xmpp:tmp:privilege:0' 275 <pubsub xmlns='http://jabber.org/protocol/pubsub'>
258 from='juliet@capulet.lit' 276 <items node='storage:bookmarks'/>
259 type='get'> 277 </pubsub>
260 <pubsub xmlns='http://jabber.org/protocol/pubsub'>
261 <items node='storage:bookmarks'/>
262 </pubsub>
263 </privilege>
264 </iq> 278 </iq>
265 ]]></example> 279 ]]></example>
266 280
267 <example caption='The Stanza Is Not Autorized !'><![CDATA[ 281 <example caption='The Stanza Is Not Autorized !'><![CDATA[
268 <iq from='capulet.net' to='priv.montaigu.net' type='error' id='bookmark1'> 282 <iq from='capulet.net' to='priv.montaigu.net' type='error' id='bookmark1'>
273 ]]></example> 287 ]]></example>
274 </section2> 288 </section2>
275 289
276 </section1> 290 </section1>
277 <section1 topic='Discovering Support' anchor='disco'> 291 <section1 topic='Discovering Support' anchor='disco'>
278 <p>If a server or a component supports the component privilege protocol, it MUST report that fact by including a service discovery feature of "urn:xmpp:tmp:privilege:0" in response to a &xep0030; information request:</p> 292 <p>If a server or an entity supports the entity privilege 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>
279 <example caption="Service Discovery information request"><![CDATA[ 293 <example caption="Service Discovery information request"><![CDATA[
280 <iq from='pubsub.capulet.net' 294 <iq from='pubsub.capulet.net'
281 id='disco1' 295 id='disco1'
282 to='capulet.net' 296 to='capulet.net'
283 type='get'> 297 type='get'>
289 id='disco1' 303 id='disco1'
290 to='pubsub.capulet.net' 304 to='pubsub.capulet.net'
291 type='result'> 305 type='result'>
292 <query xmlns='http://jabber.org/protocol/disco#info'> 306 <query xmlns='http://jabber.org/protocol/disco#info'>
293 ... 307 ...
294 <feature var='urn:xmpp:tmp:privilege:0'/> 308 <feature var='urn:xmpp:privilege:0'/>
295 ... 309 ...
296 </query> 310 </query>
297 </iq> 311 </iq>
298 ]]></example> 312 ]]></example>
299 </section1> 313 </section1>
300 <section1 topic='Business Rules' anchor='rules'> 314 <section1 topic='Business Rules' anchor='rules'>
301 <ol> 315 <ol>
302 <li>Server MAY keep permission granted to an component by a client from one session to an other, but if it do so, it MUST provide a way to client to check already granted permission, and revoke them (possibly using &xep0050;).</li> 316 <li>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 a way to client to check already granted permission, and revoke them (possibly using &xep0050;).</li>
303 <li>If a client can't check or revoke permission (e.g. it doesn't support &xep0050;), the server MUST NOT keep granted permission from one session to an other, and permission will be asked on each new session.</li> 317 <li>If a client can't check or revoke permission (e.g. it doesn't support &xep0050;), the server MUST NOT keep granted permission from one session to an other, and permission will be asked on each new session.</li>
318 <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>
304 </ol> 319 </ol>
305 </section1> 320 </section1>
306 <section1 topic='Implementation Notes' anchor='impl'> 321 <section1 topic='Implementation Notes' anchor='impl'>
307 <p>As admin mode is far more easy to implement than client mode, a server MAY choose to only implement the former</p> 322 <p>As admin mode is far more easy to implement than client mode, a server MAY choose to only implement the former</p>
308 </section1> 323 </section1>
309 <section1 topic='Security Considerations' anchor='security'> 324 <section1 topic='Security Considerations' anchor='security'>
310 <ol> 325 <ol>
311 <li>Privileged component nearly have the same possibility as the server itself, <em>admin</em> permission should be granted carefuly, only if you absolutely trust the component.</li> 326 <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>
312 <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> 327 <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>
313 328
314 <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> 329 <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>
315 </ol> 330 </ol>
316 </section1> 331 </section1>
317 <section1 topic='IANA Considerations' anchor='iana'> 332 <section1 topic='IANA Considerations' anchor='iana'>
318 <p>REQUIRED. TODO</p> 333 <p>This document requires no interaction with &IANA;.</p>
319 </section1> 334 </section1>
320 <section1 topic='XMPP Registrar Considerations' anchor='registrar'> 335 <section1 topic='XMPP Registrar Considerations' anchor='registrar'>
321 <p>REQUIRED. TODO</p> 336 <section2 topic='Protocol Namespaces' anchor='ns'>
337 <p>The &REGISTRAR; includes 'urn:xmpp:privilege:0' in its registry of protocol namespaces (see &NAMESPACES;).</p>
338 <ul>
339 <li>urn:xmpp:privilege:0</li>
340 </ul>
341 </section2>
342 <section2 topic='Protocol Versioning' anchor='registrar-versioning'>
343 &NSVER;
344 </section2>
322 </section1> 345 </section1>
323 <section1 topic='XML Schema' anchor='schema'> 346 <section1 topic='XML Schema' anchor='schema'>
324 <p>REQUIRED for protocol specifications. TODO</p> 347 <code><![CDATA[
348 <?xml version='1.0' encoding='UTF-8'?>
349
350 <xs:schema
351 xmlns:xs='http://www.w3.org/2001/XMLSchema'
352 targetNamespace='urn:xmpp:privilege:0'
353 xmlns='urn:xmpp:privilege:0'
354 elementFormDefault='qualified'>
355
356 <xs:element name='query'>
357 <xs:complexType>
358 <xs:attribute name='type' use='required'>
359 <xs:simpleType base='xs:NMTOKEN'>
360 <xs:enumeration value='request'/>
361 <xs:enumeration value='allowed'/>
362 </xs:simpleType>
363 </xs:attribute>
364 <xs:attribute name='privilege' use='optional'>
365 <xs:simpleType base='xs:NMTOKEN'>
366 <xs:enumeration value='admin'/>
367 <xs:enumeration value='client'/>
368 </xs:simpleType>
369 </xs:attribute>
370 <xs:attribute name='to' use='optional' type='xs:string'/>
371 </xs:attribute>
372 <xs:element name='perm'
373 maxOccurs='unbounded'>
374 <xs:complexType>
375 <xs:attribute name='namespace' use='required' type='xs:string'/>
376 <xs:attribute name='type' use='required'>
377 <xs:simpleType base='xs:NMTOKEN'>
378 <xs:enumeration value='none'/>
379 <xs:enumeration value='get'/>
380 <xs:enumeration value='set'/>
381 <xs:enumeration value='both'/>
382 </xs:simpleType>
383 </xs:attribute>
384 </xs:complexType>
385 </xs:element>
386 </xs:complexType>
387 </xs:element>
388
389 </xs:schema>
390 ]]></code>
391 </section1>
392 <section1 topic='Acknowledgements' anchor='acks'>
393 <p>Thanks to Sergey Dobrov, Dave Cridland and Steven Lloyd Watkin for their feedbacks.</p>
325 </section1> 394 </section1>
326 </xep> 395 </xep>