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-0066.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>Out of Band Data</title>
  10. <abstract>This specification defines two XMPP protocol extensions for communicating URIs, one for use in XMPP message stanzas and the other for use in a structured request-response interaction via XMPP IQ stanzas. Among other things, this enables one entity to inform another entity about a file that is available at an HTTP URL.</abstract>
  12. <number>0066</number>
  13. <status>Draft</status>
  14. <type>Standards Track</type>
  15. <sig>Standards</sig>
  16. <dependencies>
  17. <spec>XMPP Core</spec>
  18. </dependencies>
  19. <supersedes/>
  20. <supersededby/>
  21. <shortname>oob</shortname>
  22. <schemaloc>
  23. <ns>jabber:iq:oob</ns>
  24. <url></url>
  25. </schemaloc>
  26. <schemaloc>
  27. <ns>jabber:x:oob</ns>
  28. <url></url>
  29. </schemaloc>
  30. &stpeter;
  31. <revision>
  32. <version>1.5</version>
  33. <date>2006-08-16</date>
  34. <initials>psa</initials>
  35. <remark><p>Per a vote of the Jabber Council, converted to Standards Track.</p></remark>
  36. </revision>
  37. <revision>
  38. <version>1.4</version>
  39. <date>2006-01-11</date>
  40. <initials>psa</initials>
  41. <remark><p>Removed example of including URL in presence stanza.</p></remark>
  42. </revision>
  43. <revision>
  44. <version>1.3</version>
  45. <date>2004-10-18</date>
  46. <initials>psa</initials>
  47. <remark><p>Added non-normative section on integration with stream initiation (XEP-0095); added optional sid attribute to jabber:iq:oob schema.</p></remark>
  48. </revision>
  49. <revision>
  50. <version>1.2</version>
  51. <date>2004-04-13</date>
  52. <initials>psa</initials>
  53. <remark><p>Clarified that IQ use is for basic file transfer whereas message and presence use is for communication of URIs; added presence example; added references to file transfer specifications as well as related open issue.</p></remark>
  54. </revision>
  55. <revision>
  56. <version>1.1</version>
  57. <date>2004-02-10</date>
  58. <initials>psa</initials>
  59. <remark><p>Editorial adjustments and clarifications; added references to relevant RFCs.</p></remark>
  60. </revision>
  61. <revision>
  62. <version>1.0</version>
  63. <date>2003-10-08</date>
  64. <initials>psa</initials>
  65. <remark><p>Per a vote of the Jabber Council, changed status to Active.</p></remark>
  66. </revision>
  67. <revision>
  68. <version>0.3</version>
  69. <date>2003-06-22</date>
  70. <initials>psa</initials>
  71. <remark><p>Made several small editorial changes; added XML schemas.</p></remark>
  72. </revision>
  73. <revision>
  74. <version>0.2</version>
  75. <date>2003-01-08</date>
  76. <initials>psa</initials>
  77. <remark><p>Added information about non-HTTP URIs.</p></remark>
  78. </revision>
  79. <revision>
  80. <version>0.1</version>
  81. <date>2002-12-16</date>
  82. <initials>psa</initials>
  83. <remark><p>Initial version.</p></remark>
  84. </revision>
  85. </header>
  86. <section1 topic='Introduction' anchor='intro'>
  87. <p>This document defines two XMPP protocol extensions for communicating URIs between Jabber entities, where the data formats are qualified by the 'jabber:iq:oob' and 'jabber:x:oob' namespaces. Although these mechanisms were originally used for out-of-band (OOB) data transfer, they are also used more generally to exchange or communicate URIs.</p>
  88. </section1>
  89. <section1 topic='jabber:iq:oob' anchor='iq-oob'>
  90. <p>The intent of the 'jabber:iq:oob' was to provide a "least common denominator" mechanism for basic file transfers. Although &xep0096; defines a more generic method for communicating file exchange options, the 'jabber:iq:oob' namespace can be included as one option therein since it provides a fallback mechanism when clients do not support file transfer options such as those defined in &xep0065; and &xep0047;.</p>
  91. <p>To initiate an out-of-band file transfer with an intended recipient using the 'jabber:iq:oob' namespace (whether or not negotiated via <cite>XEP-0096</cite>), the sending application sends an &IQ; of type 'set' to the recipient containing a &QUERY; child element qualified by the 'jabber:iq:oob' namespace; the &QUERY; MUST in turn contain a &lt;url/&gt; child specifying the URL of the file to be transferred, and MAY contain an optional &lt;desc/&gt; child describing the file. This usage is shown in the following example.</p>
  92. <example caption="Sender Initiates Request-Response"><![CDATA[
  93. <iq type='set'
  94. from=''
  95. to=''
  96. id='oob1'>
  97. <query xmlns='jabber:iq:oob'>
  98. <url></url>
  99. <desc>A license to Jabber!</desc>
  100. </query>
  101. </iq>
  102. ]]></example>
  103. <p>The expected result is for the recipient to retrieve the file via an HTTP GET request and to then inform the sender of successful receipt of the file. The receiving application MUST NOT send the IQ result until it has retrieved the complete file (e.g., it MUST NOT send the IQ result if it has merely attempted to retrieve the file or the URL provided seems to be valid):</p>
  104. <example caption="Recipient Informs Sender of Success"><![CDATA[
  105. <iq type='result'
  106. from=''
  107. to=''
  108. id='oob1'/>
  109. ]]></example>
  110. <p>If the recipient attempts to retrieve the file but is unable to do so, the receiving application MUST return an &IQ; of type 'error' to the sender specifying a Not Found condition:</p>
  111. <example caption="Recipient Informs Sender of Failure"><![CDATA[
  112. <iq type='error'
  113. from=''
  114. to=''
  115. id='oob1'>
  116. <query xmlns='jabber:iq:oob'>
  117. <url></url>
  118. <desc>A license to Jabber!</desc>
  119. </query>
  120. <error code='404' type='cancel'>
  121. <item-not-found xmlns='urn:ietf:params:xml:ns:xmpp-stanzas'/>
  122. </error>
  123. </iq>
  124. ]]></example>
  125. <p>If the recipient rejects the request outright, the receiving application MUST return an &IQ; of type 'error' to the sender specifying a Not Acceptable condition:</p>
  126. <example caption="Recipient Rejects Request"><![CDATA[
  127. <iq type='error'
  128. from=''
  129. to=''
  130. id='oob1'>
  131. <query xmlns='jabber:iq:oob'>
  132. <url></url>
  133. <desc>A license to Jabber!</desc>
  134. </query>
  135. <error code='406' type='modify'>
  136. <not-acceptable xmlns='urn:ietf:params:xml:ns:xmpp-stanzas'/>
  137. </error>
  138. </iq>
  139. ]]></example>
  140. </section1>
  141. <section1 topic='jabber:x:oob' anchor='x-oob'>
  142. <p>The 'jabber:x:oob' namespace is used to communicate a URI to another user or application. This is done by including an &X; child element qualified by the 'jabber:x:oob' namespace in either a &MESSAGE; and &PRESENCE; stanza; the &X; child MUST contain a &lt;url/&gt; child specifying the URL of the resource, and MAY contain an optional &lt;desc/&gt; child describing the resource.</p>
  143. <example caption="Sender Communicates a URI"><![CDATA[
  144. <message from=''
  145. to=''>
  146. <body>Yeah, but do you have a license to Jabber?</body>
  147. <x xmlns='jabber:x:oob'>
  148. <url></url>
  149. </x>
  150. </message>
  151. ]]></example>
  152. </section1>
  153. <section1 topic='Determining Support' anchor='disco'>
  154. <p>If an entity supports the out of band data protocol, it MUST report that by including a service discovery feature of "jabber:iq:oob" and/or "jabber:x:oob" in response to a &xep0030; information request:</p>
  155. <example caption="Service Discovery information request"><![CDATA[
  156. <iq type='get'
  157. from='juliet@capulet.lit/balcony'
  158. to='romeo@montague.lit/orchard'
  159. id='disco1'>
  160. <query xmlns=''/>
  161. </iq>
  162. ]]></example>
  163. <example caption="Service Discovery information response"><![CDATA[
  164. <iq type='result'
  165. from='romeo@montague.lit/orchard'
  166. to='juliet@capulet.lit/balcony'
  167. id='disco1'>
  168. <query xmlns=''>
  169. ...
  170. <feature var='jabber:iq:oob'/>
  171. <feature var='jabber:x:oob'/>
  172. ...
  173. </query>
  174. </iq>
  175. ]]></example>
  176. </section1>
  177. <section1 topic='Use With Non-HTTP URI Schemes' anchor='nonhttp'>
  178. <p>The value of the &lt;url/&gt; element is not limited to URIs that conform to the http: URI scheme (as specified by &rfc2616;). For example, file transfers could also be effected using ftp: URIs as (specified by &rfc0959;). Going further afield, several existing Jabber clients use the callto: URI scheme to initiate voice conferencing via NetMeeting or GnomeMeeting. Other out-of-band communications could be initiated in a similar way via URI schemes such as sip: (as specified by &rfc3261;). All of these usages are allowed by the existing OOB namespaces, as long as the value of the &lt;url/&gt; element is a valid URI (as specified by &rfc3986;).</p>
  179. </section1>
  180. <section1 topic='Integration With Stream Initiation' anchor='si'>
  181. <p><em>This section is non-normative.</em></p>
  182. <p>&xep0095; defines methods for negotiating content streams between any two entities, and XEP-0096 defines a profile of stream initiation for file transfer. Although the use of jabber:iq:oob is not recommended by XEP-0096, it could be offered as one option (e.g., a fallback if SOCKS5 Bytestreams and In-Band Bytestreams are not available). If so, the value of the feature negotiation option MUST be "jabber:iq:oob" and the &QUERY; element within the &IQ; stanza qualified by the 'jabber:iq:oob' namespace MUST possess a 'sid' attribute whose value is the StreamID negotiated by stream initiation.</p>
  183. <p>A sample protocol flow is shown below.</p>
  184. <example caption='Stream Initiation Offer'>
  185. <![CDATA[
  186. <iq type='set'
  187. from=''
  188. to=''
  189. id='offer1'>
  190. <si xmlns=''
  191. id='a0'
  192. mime-type='text/plain'
  193. profile=''>
  194. <file xmlns=''
  195. name='test.txt'
  196. size='1022'/>
  197. <feature xmlns=''>
  198. <x xmlns='jabber:x:data' type='form'>
  199. <field var='stream-method' type='list-single'>
  200. <option><value></value></option>
  201. <option><value></value></option>
  202. <option><value>jabber:iq:oob</value></option>
  203. </field>
  204. </x>
  205. </feature>
  206. </si>
  207. </iq>
  208. ]]>
  209. </example>
  210. <example caption='Stream Initiation Result'>
  211. <![CDATA[
  212. <iq type='result'
  213. from=''>
  214. to=''
  215. id='offer1'>
  216. <si xmlns=''
  217. id='a0'
  218. profile=''>
  219. <feature xmlns=''>
  220. <x xmlns='jabber:x:data' type='submit'>
  221. <field var='stream-method'>
  222. <value>jabber:iq:oob</value>
  223. </field>
  224. </x>
  225. </feature>
  226. </si>
  227. </iq>
  228. ]]>
  229. </example>
  230. <example caption="Sender Initiates Request-Response"><![CDATA[
  231. <iq type='set'
  232. from=''
  233. to=''>
  234. id='send1'>
  235. <query xmlns='jabber:iq:oob'
  236. sid='a0'>
  237. <url>http://www.shakespeare.lit/files/letter.txt</url>
  238. </query>
  239. </iq>
  240. ]]></example>
  241. <example caption="Recipient Informs Sender of Success"><![CDATA[
  242. <iq type='result'
  243. from=''
  244. to=''
  245. id='send1'/>
  246. ]]></example>
  247. </section1>
  248. <section1 topic='Security Considerations' anchor='security'>
  249. <p>As with any mechanism that communicates a URI, care must be taken by the receiving application to ensure that the resource retrieved does not contain harmful or malicious data (e.g., a virus-infected file).</p>
  250. </section1>
  251. <section1 topic='IANA Considerations' anchor='iana'>
  252. <p>This document requires no interaction with &IANA;.</p>
  253. </section1>
  254. <section1 topic='XMPP Registrar Considerations' anchor='registrar'>
  255. <p>The 'jabber:iq:oob' and 'jabber:x:oob' namespaces are included in the protocol namespaces registry maintained by the &REGISTRAR; (see &NAMESPACES;).</p>
  256. </section1>
  257. <section1 topic='XML Schemas' anchor='schemas'>
  258. <section2 topic='jabber:iq:oob' anchor='schemas-iq'>
  259. <code><![CDATA[
  260. <?xml version='1.0' encoding='UTF-8'?>
  261. <xs:schema
  262. xmlns:xs=''
  263. targetNamespace='jabber:iq:oob'
  264. xmlns='jabber:iq:oob'
  265. elementFormDefault='qualified'>
  266. <xs:annotation>
  267. <xs:documentation>
  268. The protocol documented by this schema is defined in
  269. XEP-0066:
  270. </xs:documentation>
  271. </xs:annotation>
  272. <xs:element name='query'>
  273. <xs:complexType>
  274. <xs:sequence>
  275. <xs:element name='url' type='xs:string' minOccurs='1'/>
  276. <xs:element name='desc' type='xs:string' minOccurs='0'/>
  277. </xs:sequence>
  278. <xs:attribute name='sid' type='xs:string' use='optional'/>
  279. </xs:complexType>
  280. </xs:element>
  281. </xs:schema>
  282. ]]></code>
  283. </section2>
  284. <section2 topic='jabber:x:oob' anchor='schemas-x'>
  285. <code><![CDATA[
  286. <?xml version='1.0' encoding='UTF-8'?>
  287. <xs:schema
  288. xmlns:xs=''
  289. targetNamespace='jabber:x:oob'
  290. xmlns='jabber:x:oob'
  291. elementFormDefault='qualified'>
  292. <xs:annotation>
  293. <xs:documentation>
  294. The protocol documented by this schema is defined in
  295. XEP-0066:
  296. </xs:documentation>
  297. </xs:annotation>
  298. <xs:element name='x'>
  299. <xs:complexType>
  300. <xs:sequence>
  301. <xs:element name='url' type='xs:string' minOccurs='1'/>
  302. <xs:element name='desc' type='xs:string' minOccurs='0'/>
  303. </xs:sequence>
  304. </xs:complexType>
  305. </xs:element>
  306. </xs:schema>
  307. ]]></code>
  308. </section2>
  309. </section1>
  310. </xep>