Mercurial > sat_docs
comparison xmpp/xep-proto-privileged-component.xml @ 32:a3f262d5b594
xeps: typos/style fixes
author | souliane <souliane@mailoo.org> |
---|---|
date | Tue, 18 Nov 2014 13:20:14 +0100 |
parents | 91d56a6e4b0d |
children | b70084aa0af7 |
comparison
equal
deleted
inserted
replaced
31:91d56a6e4b0d | 32:a3f262d5b594 |
---|---|
67 </revision> | 67 </revision> |
68 </header> | 68 </header> |
69 | 69 |
70 <section1 topic='Introduction' anchor='intro'> | 70 <section1 topic='Introduction' anchor='intro'> |
71 <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> | 71 <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> |
72 <p>Privileged entity have numerous advantages, including:</p> | 72 <p>Privileged entities have numerous advantages, including:</p> |
73 <ul> | 73 <ul> |
74 <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> | 74 <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> |
75 <li>better integration of components: a gateway can add items to an entity roster itself</li> | 75 <li>better integration of components: a gateway can add items to an entity roster itself</li> |
76 <li>possibility to overpass a server limitation</li> | 76 <li>possibility to overpass a server limitation</li> |
77 <li>quick development cycle: developers can implement the components they need without waiting for a new server release</li> | 77 <li>quick development cycle: developers can implement the components they need without waiting for a new server release</li> |
84 <ul> | 84 <ul> |
85 <li><strong>admin</strong> mode, where it is installed by the server administrator.</li> | 85 <li><strong>admin</strong> mode, where it is installed by the server administrator.</li> |
86 <li><strong>client</strong> mode, where it can be installed by any user</li> | 86 <li><strong>client</strong> mode, where it can be installed by any user</li> |
87 </ul> | 87 </ul> |
88 <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> | 88 <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> |
89 <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> | 89 <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> |
90 <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> | 90 <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> |
91 </section1> | 91 </section1> |
92 | 92 |
93 <section1 topic='Glossary' anchor='glossary'> | 93 <section1 topic='Glossary' anchor='glossary'> |
94 <ul> | 94 <ul> |
95 <li><strong>Privileged entity</strong> — the entity which has or wants a privileged status.</li> | 95 <li><strong>Privileged entity</strong> — the entity which has a privileged status.</li> |
96 <li><strong>Managed entity</strong> — the entity that the privileged entity wants to manage.</li> | 96 <li><strong>Managed entity</strong> — the entity that is managed by a privileged entity.</li> |
97 </ul> | 97 </ul> |
98 </section1> | 98 </section1> |
99 | 99 |
100 <section1 topic='Admin Mode Use Cases' anchor='admin_usecases'> | 100 <section1 topic='Admin Mode Use Cases' anchor='admin_usecases'> |
101 | 101 |
102 <section2 topic='Permission Request Use Case' anchor='admin_perm'> | 102 <section2 topic='Permission Request Use Case' anchor='admin_perm'> |
103 <section3 topic='Entity request privileged status of admin' anchor='req_status'> | 103 <section3 topic='Entity Requests Admin Privilege' anchor='req_status'> |
104 <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> | 104 <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> |
105 <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> | 105 <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> |
106 <ul> | 106 <ul> |
107 <li><strong>get</strong> — the entity wants to send &IQ; stanza of type <em>'get'</em></li> | 107 <li><strong>get</strong> — the entity needs the privilege to send &IQ; stanzas of type <em>'get'</em></li> |
108 <li><strong>set</strong> — the entity wants to send &IQ; stanza of type <em>'set'</em></li> | 108 <li><strong>set</strong> — the entity needs the privilege to send &IQ; stanzas of type <em>'set'</em></li> |
109 <li><strong>both</strong> — the entity wants to send &IQ; stanza of type <em>'get'</em> and <em>'set'</em></li> | 109 <li><strong>both</strong> — the entity needs the privilege to send &IQ; stanzas of type <em>'get'</em> and <em>'set'</em></li> |
110 </ul> | 110 </ul> |
111 <example caption='Entity asks for admin privilege'><![CDATA[ | 111 <example caption='Entity asks for admin privilege'><![CDATA[ |
112 <iq from='pubsub.capulet.net' type='get' id='privilege1'> | 112 <iq from='pubsub.capulet.net' type='get' id='privilege1'> |
113 <query xmlns='urn:xmpp:privilege:0' type='request' privilege='admin'> | 113 <query xmlns='urn:xmpp:privilege:0' type='request' privilege='admin'> |
114 <perm namespace='jabber:iq:roster' type='both'/> | 114 <perm namespace='jabber:iq:roster' type='both'/> |
115 <perm namespace='http://jabber.org/protocol/pubsub' type='both'/> | 115 <perm namespace='http://jabber.org/protocol/pubsub' type='both'/> |
116 </query> | 116 </query> |
117 </iq> | 117 </iq> |
118 ]]></example> | 118 ]]></example> |
119 </section3> | 119 </section3> |
120 <section3 topic='Server Accept Admin Privilege' anchor='accept_status'> | 120 <section3 topic='Server Accepts Admin Privilege' anchor='accept_status'> |
121 <p>If the server accept the privileged status (e.g.: admin status specified in configuration), it MUST return an &IQ; result stanza with a "allowed" &QUERY; type, and allowed permissions in <perm/> elements:</p> | 121 <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> |
122 <example caption='Server accept admin privilege'><![CDATA[ | 122 <example caption='Server accepts admin privilege'><![CDATA[ |
123 <iq from='capulet.net' to='pubsub.capulet.net' type='result' id='privilege1'> | 123 <iq from='capulet.net' to='pubsub.capulet.net' type='result' id='privilege1'> |
124 <query xmlns='urn:xmpp:privilege:0' | 124 <query xmlns='urn:xmpp:privilege:0' |
125 type='allowed'> | 125 type='allowed'> |
126 <perm namespace='jabber:iq:roster' type='both'/> | 126 <perm namespace='jabber:iq:roster' type='both'/> |
127 <perm namespace='http://jabber.org/protocol/pubsub' type='both'/> | 127 <perm namespace='http://jabber.org/protocol/pubsub' type='both'/> |
128 </query> | 128 </query> |
129 </iq> | 129 </iq> |
130 ]]></example> | 130 ]]></example> |
131 <p>Note: the granted permissions MAY be different from the requested ones, according to server's configuration.</p> | 131 <p>Note: the granted permissions MAY be different from the requested ones, according to server's configuration.</p> |
132 </section3> | 132 </section3> |
133 <section3 topic='Server Reject Admin Privilege' anchor='reject_status'> | 133 <section3 topic='Server Rejects Admin Privilege' anchor='reject_status'> |
134 <p>If the server reject the privileged status, it MUST return a &forbidden; error:</p> | 134 <p>If the server rejects the privileged status, it MUST return a &forbidden; error:</p> |
135 <example caption='Server reject admin privilege'><![CDATA[ | 135 <example caption='Server rejects admin privilege'><![CDATA[ |
136 <iq from='capulet.net' to='pubsub.capulet.net' type='error' id='privilege1'> | 136 <iq from='capulet.net' to='pubsub.capulet.net' type='error' id='privilege1'> |
137 <error type='cancel'> | 137 <error type='cancel'> |
138 <forbidden xmlns='urn:ietf:params:xml:ns:xmpp-stanzas'/> | 138 <forbidden xmlns='urn:ietf:params:xml:ns:xmpp-stanzas'/> |
139 </error> | 139 </error> |
140 </iq> | 140 </iq> |
141 ]]></example> | 141 ]]></example> |
142 </section3> | 142 </section3> |
143 </section2> | 143 </section2> |
144 | 144 |
145 <section2 topic='Privileged Entity Send &IQ; Stanzas' anchor='priv_iq_admin'> | 145 <section2 topic='Privileged Entity Sends &IQ; Stanzas' anchor='priv_iq_admin'> |
146 <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> | 146 <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> |
147 <example caption='Privileged Entity Send A Roster Stanza'><![CDATA[ | 147 <example caption='Privileged Entity Sends A Roster Stanza'><![CDATA[ |
148 <iq id='roster1' | 148 <iq id='roster1' |
149 xmlns='urn:xmpp:privilege:0' | 149 xmlns='urn:xmpp:privilege:0' |
150 to='juliet@example.com' | 150 to='juliet@example.com' |
151 type='get' | 151 type='get' |
152 id='roster1'> | 152 id='roster1'> |
153 <query xmlns='jabber:iq:roster'/> | 153 <query xmlns='jabber:iq:roster'/> |
154 </iq> | 154 </iq> |
155 ]]></example> | 155 ]]></example> |
156 | 156 |
157 <p>The server then answer normaly, as it would have done with the managed entity:</p> | 157 <p>The server then answers normally, as it would have done to the managed entity:</p> |
158 <example caption='Server Answer To Privileged Entity'><![CDATA[ | 158 <example caption='Server Answers To Privileged Entity'><![CDATA[ |
159 <iq id='roster1' | 159 <iq id='roster1' |
160 from='juliet@example.com' | 160 from='juliet@example.com' |
161 to='pubsub.capulet.net' | 161 to='pubsub.capulet.net' |
162 type='result'> | 162 type='result'> |
163 <query xmlns='jabber:iq:roster' ver='ver7'> | 163 <query xmlns='jabber:iq:roster' ver='ver7'> |
175 <pubsub xmlns='http://jabber.org/protocol/pubsub'> | 175 <pubsub xmlns='http://jabber.org/protocol/pubsub'> |
176 <items node='storage:bookmarks'/> | 176 <items node='storage:bookmarks'/> |
177 </pubsub> | 177 </pubsub> |
178 </iq> | 178 </iq> |
179 ]]></example> | 179 ]]></example> |
180 <p>and server answer:</p> | 180 <p>and server answers:</p> |
181 | 181 |
182 <example caption='Server Returns Bookmarks'><![CDATA[ | 182 <example caption='Server Returns Bookmarks'><![CDATA[ |
183 <iq id='bookmark1' | 183 <iq id='bookmark1' |
184 to='sync.capulet.net' | 184 to='sync.capulet.net' |
185 type='result'> | 185 type='result'> |
204 <section1 topic='Client Mode Use Cases' anchor='client_usecases'> | 204 <section1 topic='Client Mode Use Cases' anchor='client_usecases'> |
205 <section2 topic='Permission Request Use Case' anchor='client_perm'> | 205 <section2 topic='Permission Request Use Case' anchor='client_perm'> |
206 <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> | 206 <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> |
207 <ol> | 207 <ol> |
208 <li>the privilege type is <em>client</em> instead of <em>admin</em></li> | 208 <li>the privilege type is <em>client</em> instead of <em>admin</em></li> |
209 <li>the privilege is done per entity, so the managed entity MUST be specified in a 'to' attribute</li> | 209 <li>the privilege is given per entity, so the managed entity MUST be specified in a 'to' attribute</li> |
210 </ol> | 210 </ol> |
211 <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: | 211 <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: |
212 </p> | 212 </p> |
213 <example caption='Entity Asks For User Privilege'><![CDATA[ | 213 <example caption='Entity asks for user privilege'><![CDATA[ |
214 <iq from='priv.montaigu.net' to='capulet.net' type='get' id='privilege1'> | 214 <iq from='priv.montaigu.net' to='capulet.net' type='get' id='privilege1'> |
215 <query xmlns='urn:xmpp:privilege:0' | 215 <query xmlns='urn:xmpp:privilege:0' |
216 type='request' | 216 type='request' |
217 privilege='client' | 217 privilege='client' |
218 to='juliet@capulet.net'> | 218 to='juliet@capulet.net'> |
219 <perm namespace='jabber:iq:roster' type='both'/> | 219 <perm namespace='jabber:iq:roster' type='both'/> |
220 <perm namespace='http://jabber.org/protocol/pubsub' type='get'/> | 220 <perm namespace='http://jabber.org/protocol/pubsub' type='get'/> |
221 </query> | 221 </query> |
222 </iq> | 222 </iq> |
223 ]]></example> | 223 ]]></example> |
224 <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. | 224 <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. |
225 </p> | 225 </p> |
226 <example caption='Server Asks User For The Permission'><![CDATA[ | 226 <example caption='Server asks user for the permission'><![CDATA[ |
227 <message from='capulet.net' to='juliet@capulet.net'> | 227 <message from='capulet.net' to='juliet@capulet.net'> |
228 <body> | 228 <body> |
229 priv.montaigu.net wants some privileges. | 229 priv.montaigu.net wants some privileges. |
230 Do you you allow him to use the following features ? | 230 Do you you allow him to use the following features? |
231 | 231 |
232 Be careful ! According permissions to entity is a serious thing, | 232 Be careful! According permissions to an entity is a serious thing, |
233 think twice that you can trust the entity before doing this. | 233 think twice that you can trust the entity before doing this. |
234 </body> | 234 </body> |
235 <x xmlns='jabber:x:data' type='form'> | 235 <x xmlns='jabber:x:data' type='form'> |
236 <title>Privileges request</title> | 236 <title>Privileges request</title> |
237 <instructions>priv.montaigu.net wants to use the following features: | 237 <instructions>priv.montaigu.net wants to use the following features: |
271 <field var='jabber:iq:roster'><value>both</value></field> | 271 <field var='jabber:iq:roster'><value>both</value></field> |
272 <field var='http://jabber.org/protocol/pubsub'><value>none</value></field> | 272 <field var='http://jabber.org/protocol/pubsub'><value>none</value></field> |
273 </x> | 273 </x> |
274 </message> | 274 </message> |
275 ]]></example> | 275 ]]></example> |
276 <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> | 276 <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> |
277 <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> | 277 <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> |
278 <example caption='Server notify accepted permissions'><![CDATA[ | 278 <example caption='Server notify accepted permissions'><![CDATA[ |
279 <iq from='capulet.net' to='priv.montaigu.net' type='set' id='privilege2'> | 279 <iq from='capulet.net' to='priv.montaigu.net' type='set' id='privilege2'> |
280 <query xmlns='urn:xmpp:privilege:0' | 280 <query xmlns='urn:xmpp:privilege:0' |
281 type='allowed' | 281 type='allowed' |
282 from='juliet@capulet.net'> | 282 from='juliet@capulet.net'> |
285 </query> | 285 </query> |
286 </iq> | 286 </iq> |
287 ]]></example> | 287 ]]></example> |
288 <p>The privileged entity can now act according to permission granted to him.</p> | 288 <p>The privileged entity can now act according to permission granted to him.</p> |
289 </section2> | 289 </section2> |
290 <section2 topic='Privileged Entity Send &IQ; Stanzas' anchor='priv_iq_client'> | 290 <section2 topic='Privileged Entity Sends &IQ; Stanzas' anchor='priv_iq_client'> |
291 <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> | 291 <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> |
292 <example caption='Entity Request bookmarks'><![CDATA[ | 292 <example caption='Entity Request bookmarks'><![CDATA[ |
293 <iq to='juliet@capulet.lit' type='get' id='bookmark1'> | 293 <iq to='juliet@capulet.lit' type='get' id='bookmark1'> |
294 <pubsub xmlns='http://jabber.org/protocol/pubsub'> | 294 <pubsub xmlns='http://jabber.org/protocol/pubsub'> |
295 <items node='storage:bookmarks'/> | 295 <items node='storage:bookmarks'/> |
296 </pubsub> | 296 </pubsub> |
306 ]]></example> | 306 ]]></example> |
307 </section2> | 307 </section2> |
308 </section1> | 308 </section1> |
309 | 309 |
310 <section1 topic='Special permissions' anchor='special'> | 310 <section1 topic='Special permissions' anchor='special'> |
311 <p>In some case, 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> | 311 <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> |
312 | 312 |
313 <section2 topic='message permission' anchor='message'> | 313 <section2 topic='Message Permission' anchor='message'> |
314 <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> | 314 <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> |
315 <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> | 315 <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> |
316 <ol> | 316 <ol> |
317 <li>forwarded &MESSAGE; 'type' attribute has the value of "headline"</li> | 317 <li>forwarded &MESSAGE; 'type' attribute has the value of "headline"</li> |
318 <li>forwarded &MESSAGE; 'from' attribute MUST be a bare jid from the server, no resource is allowed</li> | 318 <li>forwarded &MESSAGE; 'from' attribute MUST be a bare JID from the server, no resource is allowed</li> |
319 <li>in client mode, the forwarded &MESSAGE; 'from' attribute can only be one of a managed entity which has explicitly accepted the delegation</li> | 319 <li>in client mode, the forwarded &MESSAGE; 'from' attribute can only be one of a managed entity which has explicitly accepted the delegation</li> |
320 </ol> | 320 </ol> |
321 <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> | 321 <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> |
322 <p>In the following example, pubsub.capulet.lit ask for pubsub and outgoing messages permission</p> | 322 <p>In the following example, <em>pubsub.capulet.lit</em> asks for pubsub and outgoing messages permission</p> |
323 <example caption='entity asks for outgoing messages permission'><![CDATA[ | 323 <example caption='entity asks for outgoing messages permission'><![CDATA[ |
324 <iq from='pubsub.capulet.net' type='get' id='privilege1'> | 324 <iq from='pubsub.capulet.net' type='get' id='privilege1'> |
325 <query xmlns='urn:xmpp:privilege:0' type='request' privilege='admin'> | 325 <query xmlns='urn:xmpp:privilege:0' type='request' privilege='admin'> |
326 <perm namespace='message' type='outgoing'/> | 326 <perm namespace='message' type='outgoing'/> |
327 <perm namespace='http://jabber.org/protocol/pubsub' type='both'/> | 327 <perm namespace='http://jabber.org/protocol/pubsub' type='both'/> |
328 </query> | 328 </query> |
329 </iq> | 329 </iq> |
330 ]]></example> | 330 ]]></example> |
331 | 331 |
332 <example caption='server accept permissions'><![CDATA[ | 332 <example caption='server accepts permission'><![CDATA[ |
333 <iq from='capulet.net' to='pubsub.capulet.net' type='result' id='privilege1'> | 333 <iq from='capulet.net' to='pubsub.capulet.net' type='result' id='privilege1'> |
334 <query xmlns='urn:xmpp:privilege:0' type='allowed'> | 334 <query xmlns='urn:xmpp:privilege:0' type='allowed'> |
335 <perm namespace='message' type='outgoing'/> | 335 <perm namespace='message' type='outgoing'/> |
336 <perm namespace='http://jabber.org/protocol/pubsub' type='both'/> | 336 <perm namespace='http://jabber.org/protocol/pubsub' type='both'/> |
337 </query> | 337 </query> |
362 <delay xmlns='urn:xmpp:delay' stamp='2014-11-25T14:34:32Z'/> | 362 <delay xmlns='urn:xmpp:delay' stamp='2014-11-25T14:34:32Z'/> |
363 </message> | 363 </message> |
364 </forwarded> | 364 </forwarded> |
365 </message> | 365 </message> |
366 ]]></example> | 366 ]]></example> |
367 <p>The server see 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> | 367 <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> |
368 <example caption='server send the notification as if it was originating from him'><![CDATA[ | 368 <example caption='server sends the notification as if it was originating from him'><![CDATA[ |
369 <message from='juliet@capulet.lit' | 369 <message from='juliet@capulet.lit' |
370 id='bar' | 370 id='bar' |
371 to='romeo@montague.lit/orchard' | 371 to='romeo@montague.lit/orchard' |
372 type='headline'> | 372 type='headline'> |
373 <event xmlns='http://jabber.org/protocol/pubsub#event'> | 373 <event xmlns='http://jabber.org/protocol/pubsub#event'> |
388 ]]></example> | 388 ]]></example> |
389 </section2> | 389 </section2> |
390 | 390 |
391 <section2 topic='Managed Entity Presence' anchor='managed_ent_presence'> | 391 <section2 topic='Managed Entity Presence' anchor='managed_ent_presence'> |
392 <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> | 392 <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> |
393 <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, and the server MUST reject the permission by setting the allowed type to "none". If an entity need presence information in client mode, it SHOULD request it using the normal &PRESENCE; subscription mechanism.</p> | 393 <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> |
394 <example caption='privileged entity asks for pusub privilege with presence'><![CDATA[ | 394 <example caption='privileged entity asks for pusub privilege with presence'><![CDATA[ |
395 <iq from='pubsub.capulet.net' type='get' id='privilege1'> | 395 <iq from='pubsub.capulet.net' type='get' id='privilege1'> |
396 <query xmlns='urn:xmpp:privilege:0' type='request' privilege='admin'> | 396 <query xmlns='urn:xmpp:privilege:0' type='request' privilege='admin'> |
397 <perm namespace='presence' type='managed_entity'/> | 397 <perm namespace='presence' type='managed_entity'/> |
398 <perm namespace='http://jabber.org/protocol/pubsub' type='both'/> | 398 <perm namespace='http://jabber.org/protocol/pubsub' type='both'/> |
399 </query> | 399 </query> |
400 </iq> | 400 </iq> |
401 ]]></example> | 401 ]]></example> |
402 | 402 |
403 <example caption='server accept privileges'><![CDATA[ | 403 <example caption='server accepts privileges'><![CDATA[ |
404 <iq from='capulet.net' to='pubsub.capulet.net' type='result' id='privilege1'> | 404 <iq from='capulet.net' to='pubsub.capulet.net' type='result' id='privilege1'> |
405 <query xmlns='urn:xmpp:privilege:0' type='allowed'> | 405 <query xmlns='urn:xmpp:privilege:0' type='allowed'> |
406 <perm namespace='presence' type='managed_entity'/> | 406 <perm namespace='presence' type='managed_entity'/> |
407 <perm namespace='http://jabber.org/protocol/pubsub' type='both'/> | 407 <perm namespace='http://jabber.org/protocol/pubsub' type='both'/> |
408 </query> | 408 </query> |
409 </iq> | 409 </iq> |
410 ]]></example> | 410 ]]></example> |
411 | 411 |
412 <example caption='server receive new presence from juliet'><![CDATA[ | 412 <example caption='server receives new presence from Juliet'><![CDATA[ |
413 <presence from='juliet@capulet.lit/balcony' | 413 <presence from='juliet@capulet.lit/balcony' |
414 id='presence1' | 414 id='presence1' |
415 xml:lang='en'> | 415 xml:lang='en'> |
416 <show>chat</show> | 416 <show>chat</show> |
417 <status>Staying on the balcony</status> | 417 <status>Staying on the balcony</status> |
418 </presence> | 418 </presence> |
419 ]]></example> | 419 ]]></example> |
420 <example caption='server redirect presence to privileged entity'><![CDATA[ | 420 <example caption='server redirects presence to privileged entity'><![CDATA[ |
421 <presence from='juliet@capulet.lit/balcony' | 421 <presence from='juliet@capulet.lit/balcony' |
422 to='pubsub.capulet.lit' | 422 to='pubsub.capulet.lit' |
423 id='presence1' | 423 id='presence1' |
424 xml:lang='en'> | 424 xml:lang='en'> |
425 <show>chat</show> | 425 <show>chat</show> |
430 | 430 |
431 <section2 topic='Roster Presence' anchor='roster_presence'> | 431 <section2 topic='Roster Presence' anchor='roster_presence'> |
432 <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> | 432 <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> |
433 <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> | 433 <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> |
434 <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> | 434 <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> |
435 <p>Note: this permission should be given carefully, as it give 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> | 435 <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> |
436 <example caption='privileged entity asks for pusub privilege with presence roster'><![CDATA[ | 436 <example caption='privileged entity asks for pusub privilege with presence roster'><![CDATA[ |
437 <iq from='pubsub.capulet.net' type='get' id='privilege1'> | 437 <iq from='pubsub.capulet.net' type='get' id='privilege1'> |
438 <query xmlns='urn:xmpp:privilege:0' type='request' privilege='admin'> | 438 <query xmlns='urn:xmpp:privilege:0' type='request' privilege='admin'> |
439 <perm namespace='presence' type='roster'/> | 439 <perm namespace='presence' type='roster'/> |
440 <perm namespace='http://jabber.org/protocol/pubsub' type='both'/> | 440 <perm namespace='http://jabber.org/protocol/pubsub' type='both'/> |
442 </query> | 442 </query> |
443 </iq> | 443 </iq> |
444 ]]></example> | 444 ]]></example> |
445 <p>Note the presence of <em>jabber:iq:roster</em> permission request.</p> | 445 <p>Note the presence of <em>jabber:iq:roster</em> permission request.</p> |
446 | 446 |
447 <example caption='server accept privileges'><![CDATA[ | 447 <example caption='server accepts privileges'><![CDATA[ |
448 <iq from='capulet.net' to='pubsub.capulet.net' type='result' id='privilege1'> | 448 <iq from='capulet.net' to='pubsub.capulet.net' type='result' id='privilege1'> |
449 <query xmlns='urn:xmpp:privilege:0' type='allowed'> | 449 <query xmlns='urn:xmpp:privilege:0' type='allowed'> |
450 <perm namespace='presence' type='roster'/> | 450 <perm namespace='presence' type='roster'/> |
451 <perm namespace='http://jabber.org/protocol/pubsub' type='both'/> | 451 <perm namespace='http://jabber.org/protocol/pubsub' type='both'/> |
452 <perm namespace='jabber:iq:roster' type='get'/> | 452 <perm namespace='jabber:iq:roster' type='get'/> |
453 </query> | 453 </query> |
454 </iq> | 454 </iq> |
455 ]]></example> | 455 ]]></example> |
456 | 456 |
457 <example caption="server receive new presence from Romeo, which is in Juliet's roster"><![CDATA[ | 457 <example caption="server receives new presence from Romeo, which is in Juliet's roster"><![CDATA[ |
458 <presence from='romeo@montaigu.lit/orchard'/> | 458 <presence from='romeo@montaigu.lit/orchard'/> |
459 ]]></example> | 459 ]]></example> |
460 <example caption='server send the presence as usually, but also to the privileged entity'><![CDATA[ | 460 <example caption='server sends the presence as usually, but also to the privileged entity'><![CDATA[ |
461 <presence from='romeo@montaigu.lit/orchard' | 461 <presence from='romeo@montaigu.lit/orchard' |
462 to='juliet@capulet.lit'/> | 462 to='juliet@capulet.lit'/> |
463 <presence from='romeo@montaigu.lit/orchard' | 463 <presence from='romeo@montaigu.lit/orchard' |
464 to='pubsub.capulet.lit'/> | 464 to='pubsub.capulet.lit'/> |
465 ]]></example> | 465 ]]></example> |
466 </section2> | 466 </section2> |
467 </section1> | 467 </section1> |
468 | 468 |
469 <section1 topic='Configuration' anchor='configuration'> | 469 <section1 topic='Configuration' anchor='configuration'> |
470 <p>Server SHOULD provide a way to clients to check already granted permission, and revoke them by using &xep0050; on the well-defined command node of <strong>'urn:xmpp:privilege:0#configure'</strong>.</p> | 470 <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> |
471 <p>If present, the configurations 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> | 471 <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> |
472 </section1> | 472 </section1> |
473 | 473 |
474 <section1 topic='Discovering Support' anchor='disco'> | 474 <section1 topic='Discovering Support' anchor='disco'> |
475 <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> | 475 <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> |
476 <example caption="Service Discovery information request"><![CDATA[ | 476 <example caption="Service Discovery information request"><![CDATA[ |
477 <iq from='pubsub.capulet.net' | 477 <iq from='pubsub.capulet.net' |
478 id='disco1' | 478 id='disco1' |
479 to='capulet.net' | 479 to='capulet.net' |
480 type='get'> | 480 type='get'> |
495 ]]></example> | 495 ]]></example> |
496 </section1> | 496 </section1> |
497 | 497 |
498 <section1 topic='Business Rules' anchor='rules'> | 498 <section1 topic='Business Rules' anchor='rules'> |
499 <ol> | 499 <ol> |
500 <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 offer this feature, it SHOULD add a field directly in configuration commands.</li> | 500 <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> |
501 <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> | 501 <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> |
502 <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> | 502 <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> |
503 <li>A server MUST NOT grant permission for this XEP namespace (<strong>'urn:xmpp:privilege:0'</strong>)</li> | 503 <li>A server MUST NOT grant permission for this XEP namespace (<strong>'urn:xmpp:privilege:0'</strong>).</li> |
504 </ol> | 504 </ol> |
505 </section1> | 505 </section1> |
506 | 506 |
507 <section1 topic='Implementation Notes' anchor='impl'> | 507 <section1 topic='Implementation Notes' anchor='impl'> |
508 <p>As admin mode is far more easy to implement than client mode, a server MAY choose to only implement the former</p> | 508 <p>As admin mode is far more easy to implement than client mode, a server MAY choose to only implement the former.</p> |
509 </section1> | 509 </section1> |
510 | 510 |
511 <section1 topic='Security Considerations' anchor='security'> | 511 <section1 topic='Security Considerations' anchor='security'> |
512 <ol> | 512 <ol> |
513 <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> | 513 <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> |
514 <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> | 514 <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> |
515 <li><link url='#roster_presence'>Roster presence</link> is particulary sensitive, because if an entity accept this permission, it give presence information from 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> | 515 <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> |
516 | 516 |
517 <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> | 517 <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> |
518 </ol> | 518 </ol> |
519 </section1> | 519 </section1> |
520 | 520 |
521 <section1 topic='IANA Considerations' anchor='iana'> | 521 <section1 topic='IANA Considerations' anchor='iana'> |
522 <p>This document requires no interaction with &IANA;.</p> | 522 <p>This document requires no interaction with &IANA;.</p> |