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-0129.xml 12KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248
  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>WebDAV File Transfers</title>
  10. <abstract>This document specifies a method for completing file transfers between XMPP entities using WebDAV.</abstract>
  11. &LEGALNOTICE;
  12. <number>0129</number>
  13. <status>Deferred</status>
  14. <type>Standards Track</type>
  15. <sig>Standards</sig>
  16. <dependencies>
  17. <spec>XMPP Core</spec>
  18. <spec>RFC 2518</spec>
  19. <spec>XEP-0030</spec>
  20. <spec>XEP-0066</spec>
  21. <spec>XEP-0070</spec>
  22. </dependencies>
  23. <supersedes/>
  24. <supersededby/>
  25. <shortname>TO BE ASSIGNED</shortname>
  26. &stpeter;
  27. &dizzyd;
  28. <revision>
  29. <version>0.3</version>
  30. <date>2007-04-19</date>
  31. <initials>psa</initials>
  32. <remark><p>Corrected to reflect changes to XEP-0070; incorporated WedDAV feedback.</p></remark>
  33. </revision>
  34. <revision>
  35. <version>0.2</version>
  36. <date>2004-04-13</date>
  37. <initials>psa</initials>
  38. <remark><p>Added information about service discovery.</p></remark>
  39. </revision>
  40. <revision>
  41. <version>0.1</version>
  42. <date>2004-03-12</date>
  43. <initials>psa/ds</initials>
  44. <remark><p>Initial version.</p></remark>
  45. </revision>
  46. </header>
  47. <section1 topic='Introduction' anchor='intro'>
  48. <p>&xep0096; defines mechanisms for transferring files between Jabber users, and defines the preferred approach for file transfers in Jabber applications. Unfortunately, the mechanisms defined therein require that both the sender and recipient be online at the same time. However, sometimes it is desirable for the sender to initiate a file transfer while the recipient is offline. One way to make this possible is for the sender to upload the file to a unique URL, then inform the recipient of the URL. The sender could do this by uploading the file to their own web server, but not everyone has their own web server. Fortunately, there is a well-defined protocol for such file management operations: a set of HTTP extensions known as WebDAV and defined in &rfc2518; (see also the revision-in-progress, &rfc2518bis;).</p>
  49. <p>The use case in which the recipient is offline is the main motivation for this document. Another WebDAV use case presents itself in environments that use, or even require, WebDAV for file transfers using other protocols (e.g., files attached to email messages). The usual rationale for such deployments is virus-checking: the file is put onto the WebDAV server (either by an end-user or a script that, for example, strips attached files off email messages) and then checked for viruses; only after the virus check successfully completes is the recipient allowed to retrieve the file. A further benefit of such deployments is that it enables the sender to provide the file to multiple recipients. Thus the approach defined herein provides the added benefit of being usable in generic WebDAV environments as well.</p>
  50. </section1>
  51. <section1 topic='Requirements' anchor='reqs'>
  52. <p>This document addresses the following requirements:</p>
  53. <ol>
  54. <li>Enable file transfers when recipient is offline.</li>
  55. <li>Use WebDAV for file puts and gets.</li>
  56. </ol>
  57. </section1>
  58. <section1 topic='Terminology' anchor='terms'>
  59. <p>This document inherits terms from <cite>RFC 2518</cite>, &rfc2616;, and &rfc2617;.</p>
  60. </section1>
  61. <section1 topic='Protocol Flow' anchor='protocol'>
  62. <p>The client SHOULD attempt to PUT the file on the server. <note>Alternatively, the client MAY first attempt one or more HEAD requests to determine a unique URL.</note> The PUT request MUST include an "If-None-Match" header as well as an "Authorization" header that specifies appropriate authentication information.</p>
  63. <example caption='Initial PUT Request'><![CDATA[
  64. PUT /missive.html HTTP/1.1
  65. Host: files.shakespeare.lit
  66. Authorization: Basic cm9tZW9AbW9udGFndWUubmV0
  67. If-None-Match: *
  68. Content-Length: xxx
  69. Content-Type: text/html
  70. [body omitted]
  71. ]]></example>
  72. <p>Prior to storing the file, the server MUST verify the user's authentication credentials via any supported method. When the file is stored, the server also MUST set the owner "live" property to ensure that only the user that originally posted this file is allowed to modify the file in any way. Other users MAY be allowed to see properties and retrieve the file (upon authentication) but MUST NOT be able to perform operations such as DELETE, MOVE, and PROPPATCH.</p>
  73. <example caption='HTTP OK'><![CDATA[
  74. HTTP/1.1 200 OK
  75. Date: Thu, 18 Dec 2003 15:01:20 GMT
  76. ]]></example>
  77. <p>In the absence of any other authorization method (e.g., &rfc3744; or &saml;) in use by the deployed WebDAV server, the client SHOULD perform a PROPPATCH request to set the list of Jabber IDs authorized to retrieve this file, and the server MUST NOT allow access until this configuration is completed.</p>
  78. <example caption='PROPPATCH Request'><![CDATA[
  79. PROPPATCH /missive.html HTTP/1.1
  80. Host: files.shakespeare.lit
  81. Authorization: Basic cm9tZW9AbW9udGFndWUubmV0
  82. Content-Type: text/xml
  83. Content-Length: 243
  84. <propertyupdate xmlns='DAV:'>
  85. <set>
  86. <prop>
  87. <jidlist xmlns='http://www.xmpp.org/extensions/xep-0129.html#ns'>
  88. <jid>juliet@capulet.com</jid>
  89. <jid>benvolio@montague.net/home</jid>
  90. <jid>mercutio@capulet.com</jid>
  91. </jidlist>
  92. </prop>
  93. </set>
  94. </propertyupdate>
  95. ]]></example>
  96. <p>Note: The semantics of the JID list defined above are:</p>
  97. <ul>
  98. <li>If a JID is a bare JID (no resource), any fully-qualified form of that JID may access this resource (in the example above, this means that any resource of juliet@capulet.com may access this URL).</li>
  99. <li>If a JID includes a resource identifier, only that specific JID may access this URL (in the example above, this means that only the JID benvolio@montague.net/home may access this URL; benvolio@montague.net/other may not).</li>
  100. <li>If both a full JID and a bare JID are specified in a single JID list, the bare JID takes precedence.</li>
  101. </ul>
  102. <p>The server responds when the properties have been updated. This is typically a 207 (MultiPart) response, which means that the body can contain multiple status codes, as shown in the following example.</p>
  103. <example caption='Server Returns HTTP 207'><![CDATA[
  104. HTTP/1.1 207 MultiPart Response
  105. Date: Thu, 18 Dec 2003 15:03:20 GMT
  106. Content-Type: text/xml; charset=UTF-8
  107. Content-Length: 211
  108. <multistatus xmlns='DAV:'>
  109. <response>
  110. <href>http://files.shakespeare.lit/missive.html</href>
  111. <propstat>
  112. <prop><jidlist xmlns='http://www.xmpp.org/extensions/xep-0129#ns'/></prop>
  113. <status>HTTP/1.1 200 OK</status>
  114. </propstat>
  115. </response>
  116. </multistatus>
  117. ]]></example>
  118. <p>Now that the file is available via WebDAV and the client has specified what Jabber IDs may access the URL, the sender sends a message to the target user(s) containing the URL of the file, encapsulated via &xep0066;. (The example below shows the file being sent to multiple users using the &xep0033; protocol.)</p>
  119. <example caption='Sender Generates XMPP Message with URL'><![CDATA[
  120. <message from='romeo@montague.net/pda' to='multicast.jabber.org'>
  121. <addresses xmlns='http://jabber.org/protocol/address'>
  122. <address type='to' jid='juliet@capulet.com'/>
  123. <address type='to' jid='benvolio@montague.net/home'/>
  124. <address type='cc' jid='mercutio@capulet.com'/>
  125. </addresses>
  126. <x xmlns='jabber:x:oob'>
  127. <url>http://files.shakespeare.lit/missive.html</url>
  128. </x>
  129. </message>
  130. ]]></example>
  131. <p>When the target recipients have received the message, they may then perform an HTTP GET to download the file (the following request is from juliet@capulet.com).</p>
  132. <example caption='Recipient GET Request'><![CDATA[
  133. GET /missive.html HTTP/1.1
  134. Host: files.shakespeare.lit
  135. Authorization: Digest username="juliet@capulet.com",
  136. realm="xmpp",
  137. nonce="ec2cc00f21f71acd35ab9be057970609",
  138. uri="missive.html",
  139. qop=auth,
  140. nc=00000001,
  141. cnonce="0a4f113b",
  142. response="6629fae49393a05397450978507c4ef1",
  143. opaque="5ccc069c403ebaf9f0171e9517f40e41"
  144. ]]></example>
  145. <p>The server then checks to ensure that the provided JID was specified via the jidlist property. If not, the server MUST return an HTTP 403 (Forbidden) error; if so, the server attempts to authorize the user via &xep0070;:</p>
  146. <example caption='Confirmation Request Sent via Message'><![CDATA[
  147. <message type='normal'
  148. from='files.shakespeare.lit'
  149. to='juliet@capulet.com'>
  150. <thread>e0ffe42b28561960c6b12b944a092794b9683a38</thread>
  151. <confirm xmlns='http://jabber.org/protocol/http-auth'
  152. id='0a4f113b'
  153. method='GET'
  154. url='https://files.shakespeare.lit:9345/missive.html'/>
  155. </message>
  156. ]]></example>
  157. <p>If the <cite>XEP-0070</cite> verification is successful, the server then allows the file to be retrieved:</p>
  158. <example caption='Server Returns File'><![CDATA[
  159. HTTP/1.1 200 OK
  160. Date: Thu, 18 Dec 2003 18:00:00 GMT
  161. Content-Type: text/html
  162. Content-Length: xxx
  163. [body omitted]
  164. ]]></example>
  165. </section1>
  166. <section1 topic='Determining Support' anchor='disco'>
  167. <p>In order to discover a WebDAV server that supports this protocol, a client SHOULD use &xep0030;. Support for this protocol MUST be advertised by means of a service discovery feature named "http://www.xmpp.org/extensions/xep-0129.html#ns" &NSNOTE;. An example of the discovery flow is shown below.</p>
  168. <example caption='Client Discovers Services'><![CDATA[
  169. <iq from='romeo@shakespeare.lit/home'
  170. id='disco1'
  171. to='shakespeare.lit'
  172. type='get'>
  173. <query xmlns='http://jabber.org/protocol/disco#items'/>
  174. </iq>
  175. <iq from='shakespeare.lit'
  176. id='disco1'
  177. to='romeo@shakespeare.lit/home'
  178. type='result'>
  179. <query xmlns='http://jabber.org/protocol/disco#items'>
  180. ...
  181. <item jid='files.shakespeare.lit'/>
  182. ...
  183. </query>
  184. </iq>
  185. ]]></example>
  186. <example caption='Client Queries Service Regarding Supported Features'><![CDATA[
  187. <iq from='romeo@shakespeare.lit/home'
  188. id='disco2'
  189. to='files.shakespeare.lit'
  190. type='get'>
  191. <query xmlns='http://jabber.org/protocol/disco#info'/>
  192. </iq>
  193. <iq from='files.shakespeare.lit'
  194. id='disco2'
  195. to='romeo@shakespeare.lit/home'
  196. type='result'>
  197. <query xmlns='http://jabber.org/protocol/disco#info'>
  198. ...
  199. <feature var='http://jabber.org/protocol/http-auth'/>
  200. <feature var='http://www.xmpp.org/extensions/xep-0129.html#ns'/>
  201. ...
  202. </query>
  203. </iq>
  204. ]]></example>
  205. <p>The user now knows that the "files.shakespeare.lit" service supports this protocol.</p>
  206. </section1>
  207. <section1 topic='Security Considerations' anchor='security'>
  208. <p>See <cite>RFC 2518</cite>, <cite>XMPP Core</cite>, and <cite>XEP-0070</cite> for security considerations related to those protocols, which are used by the profile defined herein. The initiating client MUST ensure that appropriate access controls are specified, normally by performing a PROPPATCH request to set the list of Jabber IDs authorized to retrieve the file. The server MUST NOT allow access to the file until access controls have been specified. In addition, the server MUST NOT allow access to the file by any unauthorized entity.</p>
  209. </section1>
  210. <section1 topic='IANA Considerations' anchor='iana'>
  211. <p>This document requires no interaction with &IANA;.</p>
  212. </section1>
  213. <section1 topic='XMPP Registrar Considerations' anchor='registrar'>
  214. <section2 topic='Protocol Namespaces' anchor='ns'>
  215. <p>Until this specification advances to a status of Draft, its associated namespace shall be "http://www.xmpp.org/extensions/xep-0129.html#ns"; upon advancement of this specification, the &REGISTRAR; shall issue one or more permanent namespaces in accordance with the process defined in Section 4 of &xep0053;.</p>
  216. </section2>
  217. </section1>
  218. <section1 topic='XML Schema' anchor='schema'>
  219. <code><![CDATA[
  220. <?xml version='1.0' encoding='UTF-8'?>
  221. <xs:schema
  222. xmlns:xs='http://www.w3.org/2001/XMLSchema'
  223. targetNamespace='http://www.xmpp.org/extensions/xep-0129.html#ns'
  224. xmlns='http://www.xmpp.org/extensions/xep-0129.html#ns'
  225. elementFormDefault='qualified'>
  226. <xs:element name='jidlist'>
  227. <xs:complexType>
  228. <xs:sequence minOccurs='0' maxOccurs='unbounded'>
  229. <xs:element name='jid' type='xs:string'/>
  230. </xs:sequence>
  231. </xs:complexType>
  232. </xs:element>
  233. </xs:schema>
  234. ]]></code>
  235. </section1>
  236. <section1 topic='Acknowledgements' anchor='ack'>
  237. <p>Thanks to Lisa Dusseault and Julian Reschke for their feedback.</p>
  238. </section1>
  239. </xep>