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-0103.xml 16KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335
  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>URL Address Information</title>
  10. <abstract>This document defines a structure for providing information about an Uniform Resource Locator (URL), and a protocol signaling retrieval states.</abstract>
  11. &LEGALNOTICE;
  12. <number>0103</number>
  13. <status>Deferred</status>
  14. <type>Standards Track</type>
  15. <sig>Standards</sig>
  16. <dependencies>
  17. <spec>XMPP Core</spec>
  18. <spec>XEP-0095</spec>
  19. <spec>RFC 3986</spec>
  20. </dependencies>
  21. <supersedes/>
  22. <supersededby/>
  23. <shortname>url-data</shortname>
  24. &linuxwolf;
  25. <revision>
  26. <version>0.4</version>
  27. <date>2004-01-20</date>
  28. <initials>lw</initials>
  29. <remark>Reorganized for Editorial preferences; revised error conditions; added better localization for &lt;desc/&gt;</remark>
  30. </revision>
  31. <revision>
  32. <version>0.4</version>
  33. <date>2003-09-30</date>
  34. <initials>lw</initials>
  35. <remark>Revised &IQ; usage to be "SI" usage</remark>
  36. </revision>
  37. <revision>
  38. <version>0.3</version>
  39. <date>2003-09-19</date>
  40. <initials>lw</initials>
  41. <remark>More fixes to &IQ; usage; Specified additional error code/condition for refused transfers</remark>
  42. </revision>
  43. <revision>
  44. <version>0.2</version>
  45. <date>2003-07-06</date>
  46. <initials>lw</initials>
  47. <remark>Fixed &IQ; usage; Specified error codes/conditions</remark>
  48. </revision>
  49. <revision>
  50. <version>0.1</version>
  51. <date>2003-06-30</date>
  52. <initials>lw</initials>
  53. <remark>Initial version.</remark>
  54. </revision>
  55. </header>
  56. <section1 topic='Introduction'>
  57. <p>As Jabber becomes more widely utilized, applications of the protocol are veering away from traditional use as an IM product and are utilizing it for more generic data transportation and negotiation. While many advances are being made to facilitate non-IM data transportation, they do not address the use of already-established mechanisms of transporting data via URLs. This document provides a method that is compatible with these data transportation mechanisms and that is based on standard Internet Uniform Resource Locators (see &rfc3986;).</p>
  58. </section1>
  59. <section1 topic='Requirements'>
  60. <p>The requirements this protocol fulfills are:</p>
  61. <ul>
  62. <li>Simple usage that can be easily extended</li>
  63. <li>Provide any meta-data necessary for using the URL</li>
  64. <li>Compatibility with &xep0095;</li>
  65. </ul>
  66. </section1>
  67. <section1 topic='Use Cases'>
  68. <section2 topic='"Publishing" URLs'>
  69. <p>The simplest use of this protocol is to provide just a URL to another entity.</p>
  70. <example caption='Exchanging a simple HTTP URL'><![CDATA[
  71. <message from='d20M@festhall.outer-planes.net'
  72. to='linuxwolf@outer-planes.net'>
  73. <body>ANNOUNCEMENT: Next Session</body>
  74. <url-data
  75. xmlns='http://jabber.org/protocol/url-data'
  76. target='http://festhall.outer-planes.net/d20M/announce/latest/'/>
  77. </message>
  78. ]]></example>
  79. <p>If more information is necessary for successfully using the URL, the sender includes meta-information in a scheme-specific format such as that defined in &xep0104;:</p>
  80. <example caption='Exchanging a HTTP URL with Headers'><![CDATA[
  81. <message from='d20M@festhall.outer-planes.net'
  82. to='linuxwolf@outer-planes.net'>
  83. <body>ANNOUNCEMENT: Next Session</body>
  84. <url-data
  85. xmlns='http://jabber.org/protocol/url-data'
  86. xmlns:http='http://jabber.org/protocol/url-data/scheme/http'
  87. target='http://festhall.outer-planes.net/d20M/announce/latest/'>
  88. <http:header name='Cookie'>jsessionid=1324123wdwfq341w1243asdf'</http:header>
  89. </url-data>
  90. </message>
  91. ]]></example>
  92. <p>The above example illustrates supplying a HTTP URL with a cookie header. Additional information could be provided, such as HTTP authentication requirements or even POST data.</p>
  93. <p>To support the use of bulk publishing methods such as &xep0060; or messages of type "headline", the &lt;desc/&gt; element is used to provide a textual description:</p>
  94. <example caption='&MESSAGE; Headines'><![CDATA[
  95. <message
  96. from='d20M@festhall.outer-planes.net'
  97. to='linuxwolf@outer-planes.net'
  98. type='headline'>
  99. <body>Complete list of Session Announcements</body>
  100. <url-data
  101. xmlns='http://jabber.org/protocol/url-data'
  102. xmlns:http='http://jabber.org/protocol/url-data/scheme/http'
  103. target='http://festhall.outer-planes.net/d20M/announce/latest/'>
  104. <http:header name='Cookie'>jsessionid=1324123wdwfq341w1243asdf'</http:header>
  105. <desc>Dept-7 d20M Campaign</desc>
  106. </url-data>
  107. <url-data
  108. xmlns='http://jabber.org/protocol/url-data'
  109. xmlns:http='http://jabber.org/protocol/url-data/scheme/http'
  110. target='http://festhall.outer-planes.net/add2/announce/latest/'>
  111. <http:header name='Cookie'>jsessionid=234asa4123wdwfq341w1243asdf'</http:header>
  112. <desc>Forgotten Realms, 2nd Edition</desc>
  113. </url-data>
  114. <url-data
  115. xmlns='http://jabber.org/protocol/url-data'
  116. xmlns:http='http://jabber.org/protocol/url-data/scheme/http'
  117. target='http://festhall.outer-planes.net/dd3/announce/latest/'>
  118. <http:header name='Cookie'>jsessionid=234asa4123wdwfq341w1242341f'</http:header>
  119. <desc>Greyhawk in 3rd Edition</desc>
  120. </url-data>
  121. </message>
  122. ]]></example>
  123. </section2>
  124. <section2 topic='SI Usage'>
  125. <p>To use "url-data" in conjunction with SI, the "sid" attribute of &lt;url-data/&gt; is used. This attribute MUST be equal to the SI session id.</p>
  126. <p>The general process flow for using "url-data" with SI is as follows<note>The error conditions for SI are fully-documented in that document, and are therefore not included here.</note>:</p>
  127. <ol>
  128. <li>The sender makes a SI request, adding "http://jabber.org/protocols/url-data" as one of the "stream-method" features.</li>
  129. <li>The receiver accepts the SI request, and selects "http://jabber.org/protocols/url-data".</li>
  130. <li>The sender provides an &IQ; with the &lt;url-data/&gt;.</li>
  131. <li>The receiver retrieves the data from the provided URL [E1, E2].</li>
  132. <li>Once retrieval is complete, the Receiver responds to Sender (EUC).</li>
  133. </ol>
  134. <ul>
  135. <li><strong>E1:</strong> The given URL is not supported/understood</li>
  136. <li><strong>E2:</strong> Failure to connect to the given URL</li>
  137. </ul>
  138. <p>The sender starts with an SI request, using the semantics from XEP-0095:</p>
  139. <example caption='Requesting SI transfer'><![CDATA[
  140. <iq type='set' id='offer1' to='receiver@jabber.org/resource'>
  141. <si xmlns='http://jabber.org/protocol/si'
  142. id='a0'
  143. mime-type='text/plain'
  144. profile='http://jabber.org/protocol/si/profile/file-transfer'>
  145. <file xmlns='http://jabber.org/protocol/si/profile/file-transfer'
  146. name='test.txt'
  147. size='1022'/>
  148. <feature xmlns='http://jabber.org/protocol/feature-neg'>
  149. <x xmlns='jabber:x:data' type='form'>
  150. <field var='stream-method' type='list-single'>
  151. <option><value>http://jabber.org/protocol/url-data</value></option>
  152. <option><value>http://jabber.org/protocol/bytestreams</value></option>
  153. <option><value>http://jabber.org/protocol/ibb</value></option>
  154. </field>
  155. </x>
  156. </feature>
  157. </si>
  158. </iq>
  159. ]]></example>
  160. <p>The receiver then accepts the request, specifying "url-data" as the stream method:</p>
  161. <example caption=''><![CDATA[
  162. <iq type='result' to='sender@jabber.org/resource' id='offer1'>
  163. <si xmlns='http://jabber.org/protocol/si'>
  164. <feature xmlns='http://jabber.org/protocol/feature-neg'>
  165. <x xmlns='jabber:x:data' type='submit'>
  166. <field var='stream-method'>
  167. <value>http://jabber.org/protocol/url-data</value>
  168. </field>
  169. </x>
  170. </feature>
  171. </si>
  172. </iq>
  173. ]]></example>
  174. <p>The sender then sends an &IQ; with type "set" to the receiver, providing the &lt;url-data/&gt; element with the URL in the "target" attribute:</p>
  175. <example caption='Providing &lt;url-data/&gt;'><![CDATA[
  176. <iq type='set' from='sender@jabber.org/resource' to='receiver@jabber.org/resource' id='offer2'>
  177. <url-data xmlns='http://jabber.org/protocol/url-data'
  178. sid='a0'
  179. target='http://pass.jabber.org:8519/test.txt'/>
  180. </iq>
  181. ]]></example>
  182. <p>The receiver attempts to retrieve the data from the given URL. The receiver MUST NOT respond to the &IQ; until the data is completely retrieved, or an error occurs. If the retrieval is successful, the receiver responds with an "iq-result":</p>
  183. <example caption='Receiver responds successfully'><![CDATA[
  184. <iq type='result' from='receiver@jabber.org/resource' to='sender@jabber.org/resource' id='offer2'>
  185. <url-data xmlns='http://jabber.org/protocol/url-data'
  186. sid='a0'
  187. target='http://pass.jabber.org:8519/test.txt'/>
  188. </iq>
  189. ]]></example>
  190. <p>Including the &lt;url-data/&gt; element in the result is NOT REQUIRED.</p>
  191. <p>If the receiver does not understand or support the URL, it responds with an "iq-error" with the &lt;malformed-url/&gt; condition:</p>
  192. <example caption='Receiver does not understand/support URL'><![CDATA[
  193. <iq type='error' from='receiver@jabber.org/resource' to='sender@jabber.org/resource' id='offer2'>
  194. <url-data xmlns='http://jabber.org/protocol/url-data'
  195. sid='a0'
  196. target='http://pass.jabber.org:8519/thefile.txt'/>
  197. <error type='cancel' code='400'>Malformed URL
  198. <bad-request xmlns='urn:ietf:params:xml:ns:xmpp-stanzas'/>
  199. <malformed-url xmlns='http://jabber.org/protocol/url-data'/>
  200. </error>
  201. </iq>
  202. ]]></example>
  203. <p>If the receiver fails to retrieve data from the URL, it responds with an "iq-error" with the &lt;transfer-failed/&gt; condition:</p>
  204. <example caption='Receiver does not understand/support URL'><![CDATA[
  205. <iq type='error' from='receiver@jabber.org/resource' to='sender@jabber.org/resource' id='offer2'>
  206. <url-data xmlns='http://jabber.org/protocol/url-data'
  207. sid='a0'
  208. target='http://pass.jabber.org:8519/thefile.txt'/>
  209. <error type='cancel' code='500'>transfer failed
  210. <undefined-condition xmlns='urn:ietf:params:xml:ns:xmpp-stanzas'/>
  211. <transfer-failed xmlns='http://jabber.org/protocol/url-data'/>
  212. </error>
  213. </iq>
  214. ]]></example>
  215. <p>If the receiver refuses to accept the URL, it responds with an "iq-error" with the &lt;transfer-refused/&gt; condition:</p>
  216. <example caption='Receiver does not understand/support URL'><![CDATA[
  217. <iq type='error' from='receiver@jabber.org/resource' to='sender@jabber.org/resource' id='offer2'>
  218. <url-data xmlns='http://jabber.org/protocol/url-data'
  219. sid='a0'
  220. target='http://pass.jabber.org:8519/thefile.txt'/>
  221. <error type='cancel' code='500'>transfer failed
  222. <undefined-condition xmlns='urn:ietf:params:xml:ns:xmpp-stanzas'/>
  223. <transfer-refused xmlns='http://jabber.org/protocol/url-data'/>
  224. </error>
  225. </iq>
  226. ]]></example>
  227. </section2>
  228. </section1>
  229. <section1 topic='Implementation Notes'>
  230. <section2 topic='Schemes'>
  231. <p>The additional information provided by a particular scheme is OPTIONAL. The additional data is provided as XML in a dedicated namespace, and this namespace SHOULD be declared (with an appropriate prefix) within the &lt;url-data/&gt; element.</p>
  232. <p>Entities receiving a &lt;url-data/&gt; element MAY incorporate this information into the use of the URL as necessary. An entity providing a &lt;url-data/&gt; with scheme-specific information SHOULD NOT assume the receiving entity understands it, even if the receiving entity is capable of processing a URL for that scheme.</p>
  233. </section2>
  234. </section1>
  235. <section1 topic='Formal Description'>
  236. <section2 topic='&lt;url-data/&gt; Root Element'>
  237. <p>The &lt;url-data/&gt; element provides the root structure for providing URL addresses. The element has attribute for the target URL and (optional) stream identifier. It contains content for the optional description, and any and all scheme-specific content.</p>
  238. <p>The attribute "target" contains the URL. This attribute MUST be present, and MUST be a valid URL.</p>
  239. <p>The attribute "sid" contains the stream identifier. While this attribute is optional, its usage is REQUIRED when used with Stream Initiation, and MUST contain the Stream Initiation identifier previously agreed to.</p>
  240. </section2>
  241. <section2 topic='&lt;desc/&gt; Element'>
  242. <p>In cases where textual descriptions cannot be provided, this element fullfills this need. It MAY include the "xml:lang" attribute for localization purposes, and its content is the text of the description. Multiple instances of &lt;desc/&gt; MAY be present, but each instance MUST have a different value for "xml:lang" attribute.</p>
  243. </section2>
  244. <section2 topic='Error Conditions'>
  245. <p>To simplify the discussion on error conditions, this document uses the following mapping between namespace URIs and namespace prefixes<note>This mapping is for the purpose of simplifying this discussion, and is not intended to be used in the actual protocol.</note>.</p>
  246. <table caption='Namespace Mappings'>
  247. <tr>
  248. <th>Prefix</th>
  249. <th>URI</th>
  250. </tr>
  251. <tr>
  252. <td>xmpp</td>
  253. <td>urn:ietf:params:xml:ns:xmpp-stanzas</td>
  254. </tr>
  255. <tr>
  256. <td>url</td>
  257. <td>http://jabber.org/protocol/url-data</td>
  258. </tr>
  259. </table>
  260. <p>Below are the errors that can result.</p>
  261. <table caption='Error Conditions/Codes'>
  262. <tr>
  263. <th>Error Type</th>
  264. <th>General Condition</th>
  265. <th>Specific Condition</th>
  266. <th>Description</th>
  267. </tr>
  268. <tr>
  269. <td>modify</td>
  270. <td>&lt;xmpp:bad-request/&gt;</td>
  271. <td>&lt;url:malformed-url/&gt;</td>
  272. <td>The URL is not supported or understood.</td>
  273. </tr>
  274. <tr>
  275. <td>cancel</td>
  276. <td>&lt;xmpp:not-acceptable/&gt;</td>
  277. <td>&lt;url:transfer-refused/&gt;</td>
  278. <td>The URL transfer failed for some unspecified reason.</td>
  279. </tr>
  280. <tr>
  281. <td>cancel</td>
  282. <td>&lt;xmpp:undefined-condition/&gt;</td>
  283. <td>&lt;url:transfer-failed/&gt;</td>
  284. <td>The URL transfer failed for some unspecified reason.</td>
  285. </tr>
  286. </table>
  287. </section2>
  288. <section2 topic='XML Schema'>
  289. <code><![CDATA[
  290. <?xml version='1.0' encoding='UTF-8'?>
  291. <xs:schema
  292. xmlns:xs='http://www.w3.org/2001/XMLSchema'
  293. targetNamespace='http://jabber.org/protocol/url-data'
  294. xmlns='http://jabber.org/protocol/url-data'
  295. elementFormDefault='qualified'>
  296. <xs:import namespace='http://www.w3.org/XML/1998/namespace'
  297. schemaLocation='http://www.w3.org/2001/xml.xsd'/>
  298. <xs:element name='url-data'>
  299. <xs:complexType>
  300. <xs:sequence>
  301. <xs:any namespace='##other' minOccurs='0' maxOccurs='unbounded'/>
  302. <xs:element ref='desc' minOccurs='0' maxOccurs='unbounded'/>
  303. </xs:sequence>
  304. <xs:attribute name='target' type='xs:anyURI' use='required'/>
  305. <xs:attribute name='sid' type='xs:string' use='optional'/>
  306. </xs:complexType>
  307. </xs:element>
  308. <xs:element name='desc' type='xs:string'>
  309. <xs:complexType>
  310. <xs:attribute ref='xml:lang' use='optional'/>
  311. </xs:complexType>
  312. </xs:element>
  313. <xs:element name='malformed-url'/>
  314. <xs:element name='transfer-failed'/>
  315. <xs:element name='transfer-refused'/>
  316. </xs:schema>
  317. ]]></code>
  318. </section2>
  319. </section1>
  320. <section1 topic='Security Considerations'>
  321. <p>This document does not yet have any security considerations.</p>
  322. </section1>
  323. <section1 topic='IANA Considerations'>
  324. <p>This document requires no interaction with &IANA;.</p>
  325. </section1>
  326. <section1 topic='XMPP Registrar Considerations'>
  327. <p>The &REGISTRAR; shall register the namespace "http://jabber.org/protocol/url-data" as a standard namespace. Also, the XMPP Registrar shall register the &xep0020; option "url-data" for use with Stream Initiation.</p>
  328. </section1>
  329. </xep>