%ents; ]>
WebDAV File Transfers This document a method for completing Jabber file transfers using WebDAV. &LEGALNOTICE; 0129 Experimental Standards Track Standards XMPP Core RFC 2518 XEP-0030 XEP-0066 XEP-0070 TO BE ASSIGNED &dizzyd; &stpeter; 0.3 2007-02-02 psa

Incorporated WedDAV feedback.

0.2 2004-04-13 psa

Added information about service discovery.

0.1 2004-03-12 psa/ds

Initial version.

&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 his or her 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;).

The use case in which the recipient is offline is the main driver behind 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.

This document addresses the following requirements:

  1. Enable file transfers when recipient is offline.
  2. Use WebDAV for file puts and gets.

This document inherits terms from RFC 2518, &rfc2616;, and &rfc2617;.

The client SHOULD attempt to PUT the file on the server. Alternatively, the client MAY first attempt one or more HEAD requests to determine a unique URL. The PUT request MUST include an "If-None-Match" header as well as an "Authorization" header that specifies appropriate authentication information.

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 DELETE, MOVE, PROPPATCH, etc.

In the absence of any other authorization method (e.g., SAML) in use by the deployed WebDAV server, the client MUST 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.

juliet@capulet.com benvolio@montague.net/home mercutio@capulet.com ]]>

Note: The semantics of the JID list defined above are:

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.

http://files.shakespeare.lit/uniqueurl HTTP/1.1 200 OK ]]>

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, encoded using &xep0066; to ensure backwards compatibility. (The example below shows the file being sent to multiple users using the &xep0033; protocol.)

http://files.shakespeare.lit/uniqueurl ]]>

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).

The server then checks to ensure that the provided JID is on 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;:

e0ffe42b28561960c6b12b944a092794b9683a38 Someone (maybe you) has requested the following file: https://files.shakespeare.lit:9345/missive.html. The transaction identifier is: a7374jnjlalasdf82 If you wish to confirm the request, please reply to this message by typing "OK". If not, please reply with "No". ]]>

If the XEP-0070 verification is successful, the server then allows the file to be retrieved:

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" (see Protocol Namespaces). An example of the discovery flow is shown below.

... ... ]]> ... ... ]]>

The user now knows that the "files.shakespeare.lit" service supports this protocol.

See RFC 2518, XMPP Core, and XEP-0070 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.

This document requires no interaction with &IANA;.

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 ®ISTRAR; shall issue one or more permanent namespaces in accordance with the process defined in Section 4 of &xep0053;.

]]>

Thanks to Lisa Dusseault and Julian Reschke for their feedback.