No Description
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

xep-0321.xml 14KB

  1. <?xml version='1.0' encoding='UTF-8'?>
  2. <!DOCTYPE xep SYSTEM 'xep.dtd' [
  3. <!ENTITY % ents SYSTEM 'xep.ent'>
  4. %ents;
  5. ]>
  6. <?xml-stylesheet type='text/xsl' href='xep.xsl'?>
  7. <xep>
  8. <header>
  9. <title>Remote Roster Management</title>
  10. <abstract>This document defines a way remote entities may manage user's roster to provide a simple way to keep rosters in sync.</abstract>
  12. <number>0321</number>
  13. <status>Deferred</status>
  14. <type>Standards Track</type>
  15. <sig>Standards</sig>
  16. <approver>Council</approver>
  17. <dependencies>
  18. <spec>XMPP Core</spec>
  19. <spec>XEP-0001</spec>
  20. <spec>XEP-0004</spec>
  21. <spec>XEP-0100</spec>
  22. </dependencies>
  23. <supersedes/>
  24. <supersededby/>
  25. <shortname>NOT_YET_ASSIGNED</shortname>
  26. <author>
  27. <firstname>Sergey</firstname>
  28. <surname>Dobrov</surname>
  29. <email></email>
  30. <jid></jid>
  31. </author>
  32. <author>
  33. <firstname>Jan</firstname>
  34. <surname>Kalu&#382;a</surname>
  35. <email></email>
  36. <jid></jid>
  37. </author>
  38. <revision>
  39. <version>0.1</version>
  40. <date>2013-04-16</date>
  41. <initials>psa</initials>
  42. <remark><p>Initial published version approved by the XMPP Council.</p></remark>
  43. </revision>
  44. <revision>
  45. <version>0.0.1</version>
  46. <date>2012-12-07</date>
  47. <initials>snd</initials>
  48. <remark><p>First draft.</p></remark>
  49. </revision>
  50. </header>
  51. <section1 topic='Introduction' anchor='intro'>
  52. <p>It's often desirable for some XMPP based services to make it possible to manage user's roster to provide some contacts there. The most obvious example of such kind of service is a gateway to some legacy IM system (see &xep0100;). The current way that's recommended by the &xep0100; is to use the &xep0144; to synchronize items that's not sutiable in certain situations.</p>
  53. </section1>
  54. <section1 topic='Requirements' anchor='reqs'>
  55. <p>This document addresses the following requirements:</p>
  56. <ol>
  57. <li>Make it possible for remote services or entities to manage user's roster by the same mechanisms that descibed in the &rfc6121;.</li>
  58. <li>Provide a way for users to control which services have permission to manage their roster.</li>
  59. </ol>
  60. </section1>
  61. <section1 topic='Glossary' anchor='glossary'>
  62. <dl>
  63. <di><dt>Remote entity</dt><dd>the entity that wants to modify user's roster.</dd></di>
  64. <di><dt>User</dt><dd>the entity which roster the remote entity wants to have access to.</dd></di>
  65. <di><dt>User's server</dt><dd>the XMPP server User connected to.</dd></di>
  66. <di><dt>Roster</dt><dd>the list of User's contacts as defined in the &rfc6121;.</dd></di>
  67. </dl>
  68. </section1>
  69. <section1 topic='Use Cases' anchor='usecases'>
  70. <section2 topic='Remote entity asks for permission to manage user&apos;s roster' anchor='ask_permission'>
  71. <p>In order to be able to make any changes to the user&apos;s roster the remote entity MUST ask permission to do so first.</p>
  72. <p>NOTE: in order to be able to perform the query, the remote entity MUST have a presence subscription to the User</p>
  73. <example caption='Remote entity asks for permission'><![CDATA[
  74. <iq from='' to='' type='set' id='roster_1'>
  75. <query xmlns='urn:xmpp:tmp:roster-management:0' reason='Manage contacts in the ICQ contact list' type='request'/>
  76. </iq>]]></example>
  77. <p>If the presence subscription is absent, the server MUST NOT proceed with the request but MUST respond with the "forbidden" error:</p>
  78. <example caption="The remote entity has no presence subscription"><![CDATA[
  79. <iq from='' to='' type='error' id='roster_1'>
  80. <error type='modify'>
  81. <forbidden xmlns='urn:ietf:params:xml:ns:xmpp-stanzas'/>
  82. <text xmlns='urn:ietf:params:xml:ns:xmpp-stanzas'>You must have a presence subscription to be able to request remote roster management service.</text>
  83. </error>
  84. </iq>]]></example>
  85. <p>The user's server SHOULD then generate a form request using &xep0004; to client in order to ask user if they are OK with granting the permission to the remote entity. The "challenge" form field is generated by the server and is used to identify the client's response. The server also MUST immediatly answer to the request IQ.</p>
  86. <p>NOTE: if the entity is already granted with the permission, the server SHOULD immediatly answer with a success response and skip querying the user.</p>
  87. <example caption='Server asks user for the permission'><![CDATA[
  88. <message from=''
  89. to=''>
  90. <body> wants to be able to manage your roster with following reason:
  91. Manage contacts in the ICQ contact list
  92. Do you want to allow it? Send "yes 5439123" or "no 5439123" back, pleas.</body>
  93. <x xmlns='jabber:x:data' type='form'>
  94. <title>Roster management permission request</title>
  95. <instructions> wants to be able to manage your roster with following reason:
  96. Manage contacts in the ICQ contact list.
  97. Do you allow it?</instructions>
  98. <field type='hidden' var='challenge'><value>5439123</value></field>
  99. <field type='hidden' var='FORM_TYPE'>
  100. <value>urn:xmpp:tmp:roster-management:0</value>
  101. </field>
  102. <field type='boolean'
  103. label='Allow to edit roster?'
  104. var='answer'>
  105. <value>1</value>
  106. </field>
  107. </x>
  108. </message>]]></example>
  109. <p>The client can answer by submit the form or with a text message response:</p>
  110. <example caption='Client responds with to the data form'><![CDATA[
  111. <message from=''
  112. to=''
  113. xml:lang='en'>
  114. <x xmlns='jabber:x:data' type='submit'>
  115. <field var='FORM_TYPE'>
  116. <value>urn:xmpp:tmp:roster-management:0</value>
  117. </field>
  118. <field var='challenge'><value>5439123</value></field>
  119. <field var='answer'><value>1</value></field>
  120. </x>
  121. </message>]]></example>
  122. <example caption='Client responds with a text message response'><![CDATA[
  123. <message from=''
  124. to=''
  125. xml:lang='en'>
  126. <body>yes 5439123</body>
  127. </message>]]></example>
  128. <section3 topic='The remote entity is allowed to manage roster' anchor='pemission_granted'>
  129. <p>If the user allowed the roster management then the server MUST inform the remote entity that it has been granted the permission:</p>
  130. <example caption='The server informs the remote entity that it&apos;s allowed to manage the User&apos;s roster'><![CDATA[
  131. <iq from='' to='' type='set' id='roster_2'>
  132. <query xmlns='urn:xmpp:tmp:roster-management:0' type="allowed"/>
  133. </iq>]]></example>
  134. </section3>
  135. <section3 topic='The remote entity is allowed to manage roster' anchor='pemission_granted'>
  136. <p>If the user disallowed the roster management then the server MUST inform the remote entity that it hasn&apos;t been granted the permission:</p>
  137. <example caption='The server informs the remote entity that it&apos;s allowed to manage the User&apos;s roster'><![CDATA[
  138. <iq from='' to='' type='set' id='roster_2'>
  139. <query xmlns='urn:xmpp:tmp:roster-management:0' type="rejected"/>
  140. </iq>]]></example>
  141. </section3>
  142. <section3 topic="Reject the permission to manage roster">
  143. <p>In order to reject the permission to manage roster it's enough to reject entity's presence subscription:</p>
  144. <example caption='The user rejects entity&apos;s presence subscription'><![CDATA[
  145. <presence to='' type='unsubscribed'/>]]></example>
  146. <p>If the presence subscription is restored then the permission is needed to be rerequested as defined above.</p>
  147. </section3>
  148. </section2>
  149. <section2 topic='The remote entity requests current user&apos;s roster' anchor='request_roster'>
  150. <p>The remote entity being granted the permission to manage roster can request it from the User's server using usual jabber:iq:roster protocol to be able to edit it:</p>
  151. <example caption='The remote entity requests current roster'><![CDATA[
  152. <iq from='' to='' type='get' id='roster_5'>
  153. <query xmlns='jabber:iq:roster'/>
  154. </iq>]]></example>
  155. <p>The server MUST then answer with User's roster including there only the items that belongs to the entity&apos;s hostname:</p>
  156. <example caption='The server responds with the roster'><![CDATA[
  157. <iq to='' from='' type='result' id='roster_5'>
  158. <query xmlns='jabber:iq:roster'>
  159. <item jid=''
  160. name='Romeo'
  161. subscription='both'>
  162. <group>Friends</group>
  163. </item>
  164. <item jid=''
  165. name='Mercutio'
  166. subscription='from'>
  167. <group>Friends</group>
  168. </item>
  169. <item jid=''
  170. name='Benvolio'
  171. subscription='both'>
  172. <group>Friends</group>
  173. </item>
  174. </query>
  175. </iq>]]></example>
  176. </section2>
  177. <section2 topic='The user updates roster' anchor='user_update'>
  178. <p>If client updates roster and this update affects the remote entity&apos;s contacts (i.e. belongs to it's hostname) then the server MUST forward these items to the remote entity:</p>
  179. <example caption='The user updates roster'><![CDATA[
  180. <iq from='' type='set' id='roster_3'>
  181. <query xmlns='jabber:iq:roster'>
  182. <item jid=''
  183. name='Romeo'
  184. subscription='both'>
  185. <group>Friends</group>
  186. <group>Lovers</group>
  187. </item>
  188. </query>
  189. </iq>]]></example>
  190. <example caption='The server sends push roster request to the remote entity'><![CDATA[
  191. <iq from='' to='' type='set' id='roster_3'>
  192. <query xmlns='jabber:iq:roster'>
  193. <item jid=''
  194. name='Romeo'
  195. subscription='both'>
  196. <group>Friends</group>
  197. <group>Lovers</group>
  198. </item>
  199. </query>
  200. </iq>]]></example>
  201. </section2>
  202. <section2 topic='The remote entity updates the user&apos;s roster' anchor='entity_update'>
  203. <p>The remote entity can also send the push query to the roster with the same semantics as specified for the jabber:iq:roster protocol described in the &rfc6121;:</p>
  204. <example caption='The remote entity sends push roster request'><![CDATA[
  205. <iq to='' type='set' id='roster_3'>
  206. <query xmlns='jabber:iq:roster'>
  207. <item jid=''
  208. name='Romeo'
  209. subscription='both'>
  210. <group>Friends</group>
  211. <group>Lovers</group>
  212. </item>
  213. </query>
  214. </iq>]]></example>
  215. <p>The server MUST then inform the remote entity of success or an error and in the case of success also forward the push request to all connected User's resources.</p>
  216. <p>If the entity tries to make changes into the items it's not allowed to, the server MUST NOT do any changes in the User's roster but respond to the entity with an error:</p>
  217. <example caption='The server responds with an error'><![CDATA[
  218. <iq from='' type='set' id='roster_3'>
  219. <forbidden xmlns='urn:ietf:params:xml:ns:xmpp-stanzas'/>
  220. <text xmlns='urn:ietf:params:xml:ns:xmpp-stanzas'>You have tried to modify the item you don't allowed to.</text>
  221. </iq>]]></example>
  222. </section2>
  223. <section2 topic='Client requests list of components with permissions to edit their roster'>
  224. <p>User can ask the server to provide a list of components or servers which have permissions to edit their roster.</p>
  225. <example caption='User asks the server to get list of components which can edit their roster'><![CDATA[
  226. <iq from='' to='' type='get' id='roster_5'>
  227. <query xmlns='urn:xmpp:tmp:roster-management:0'/>
  228. </iq>
  229. ]]></example>
  230. <p>In this case, server responds with list of components or servers which can edit user's roster.</p>
  231. <example caption='Server responds with list of componentss which can edit user&apos;s roster'><![CDATA[
  232. <iq from='' to='' type='result' id='roster_5'>
  233. <query xmlns='urn:xmpp:tmp:roster-management:0'>
  234. <item jid='' reason='Manage ICQ contacts.'/>
  235. <item jid='' reason='Manage Jabber gateway contacts.'/>
  236. </query>
  237. </iq>
  238. ]]></example>
  239. <p>Eventually, user can reject permission granted to component to edit their roster.</p>
  240. <example caption='User rejects permissions to edit his roster'><![CDATA[
  241. <iq from='' to='' type='set' id='roster_6'>
  242. <query xmlns='urn:xmpp:tmp:roster-management:0' type="reject"/>
  243. </iq>
  244. ]]></example>
  245. </section2>
  246. </section1>
  247. <section1 topic='XML Schema' anchor='schema'>
  248. <code><![CDATA[
  249. <?xml version='1.0' encoding='UTF-8'?>
  250. <xs:schema
  251. xmlns:xs=''
  252. targetNamespace='urn:xmpp:tmp:roster-management:0'
  253. xmlns='urn:xmpp:tmp:roster-management:0'
  254. elementFormDefault='qualified'>
  255. <xs:annotation>
  256. <xs:documentation>
  257. The protocol documented by this schema is defined in
  258. XEP-XXXX:
  259. </xs:documentation>
  260. </xs:annotation>
  261. <xs:element name='query'>
  262. <xs:complexType>
  263. <xs:attribute name='type' use='required'>
  264. <xs:simpleType base='xs:NMTOKEN'>
  265. <xs:enumeration value='request'/>
  266. <xs:enumeration value='allowed'/>
  267. <xs:enumeration value='rejected'/>
  268. </xs:simpleType>
  269. </xs:attribute>
  270. <xs:attribute name='reason' use='optional' type='xs:string'/>
  271. <xs:sequence minOccurs='0'>
  272. <xs:element ref='item' minOccurs='0' maxOccurs='unbounded'/>
  273. </xs:sequence>
  274. </xs:complexType>
  275. </xs:element>
  276. <xs:element name='item'>
  277. <xs:complexType>
  278. <xs:simpleContent>
  279. <xs:extension base='empty'>
  280. <xs:attribute name='jid' type='fullJIDType' use='required'/>
  281. <xs:attribute name='reason' type='xs:string' use='optional'/>
  282. </xs:extension>
  283. </xs:simpleContent>
  284. </xs:complexType>
  285. </xs:element>
  286. </xs:schema>
  287. ]]></code>
  288. </section1>
  289. </xep>