%ents; ]>
File Repository and Sharing While a protocol has been described for initiating a file transfer from one user to another, there is not yet a way for users to designate a set of files as available for retrieval by other users of their choosing. This extension fills that functionality, with additional features such as file versioning, multiple download mirrors across several internet protocols, collaborative modification of the file listing, and all the other benefits of Pubsub. This XMPP Extension Protocol is copyright 1999 - 2007 by the XMPP Standards Foundation (XSF) and is in full conformance with the XSF's Intellectual Property Rights Policy (http://www.xmpp.org/extensions/ipr-policy.shtml). This material may be distributed only subject to the terms and conditions set forth in the Creative Commons Attribution License (http://creativecommons.org/licenses/by/2.5/). 0214 Deferred Standards Track Standards JIG Council XMPP Core XEP-0001 XEP-0060 XEP-0082 XEP-0137 Not yet assigned Nicholas Parker nickbp@gmail.com nickp@jabber.org 0.1 2007-04-20 psa

Initial published version.

0.0.3 2007-03-18 nbp

Added support for Stream Initiation Requests. Clarified purpose of additional mirror types.

0.0.2 2007-01-26 nbp

Rewritten to use Pubsub.

0.0.1 2006-09-01 nbp

First draft.

Describes how a Jabber user may find and retrieve files which other Jabber users have published. The listing of files is done through a Pubsub (XEP-0060) server, allowing multiple users to manage the same listing. Other features include file metadata, revisions, and download mirrors.

Retrieval of the files provided in the listing MAY be performed through any relevant protocol for transferring data (http, ftp, etc), but this protocol emphasizes the use of Stream Initiation (XEP-0137) to establish the connection.

The protocol defined herein provides the following functionality:

  1. Publication of a list of available files to a Pubsub server, with tree structure, file metadata, user permissions, and file versioning.
  2. Request that a file be sent from a Jabber contact directly to oneself using Stream Initiation.
File ListingTop-level Pubsub Collection Node, containing information about files and/or subsections which a user or group of users have published.
SubsectionNon-Root Collection Node which containts files and/or other subsections.
FilePubsub Node, stored within a File Listing, which describes all revisions of a given file. The filename and (optionally) description are provided here.
RevisionPubsub Item which describes a given file revision. Other metadata which can vary between revisions is provided here (file size, checksum, available mirrors, etc).
MirrorA location which has a given Revision available for download. Additional information about a given Mirror MAY be provided for protocols that require it. A list of available protocols is provided below.

The following use cases describe tasks which are already covered by XEP-0060 in a more generic context. These tasks are explicitly described in order to demonstrate the wide range of capabilities afforded by this system and convey the data structure of the file listing itself. Consult XEP-0060 for the full range of node and user management commands as well as their server responses.

Juliet wishes to make her sonnets available for retrieval by the public. She creates a Root Pubsub Collection Node which will contain her file listing:

http://jabber.org/protocol/pubsub#node_config collection http://jabber.org/protocol/pubsub#meta-data Juliet's Sonnets Optional Description ]]>

Juliet also wishes to add a subsection for her sonnets about Romeo. She creates another Pubsub Collection Node under the Root Node:

http://jabber.org/protocol/pubsub#node_config juliets_sonnets collection http://jabber.org/protocol/pubsub#meta-data Sonnets About Romeo Optional Description ]]>

Romeo wishes to view all of Juliet's shared sonnets. To do this, Romeo subscribes to the Root Collection Node:

http://jabber.org/protocol/pubsub#subscribe_options items all ]]>

Juliet has just finished a new sonnet and wishes to announce its availability on her File Listing. She adds the sonnet as a new Pubsub Node stored in her Collection Node, then inserts a first revision of her sonnet as an Item within that Node:

juliets_sonnets http://jabber.org/protocol/pubsub#meta-data sonnet.txt Sonnet 42 5623 2006-12-13T18:30:02Z 59282c5db190bdc3b152c5b38363442bfda8ebdd text/plain My Latest Sonnet! sonnet.txt /source/23A53F01/ /preview/90266EA1/ ]]>

The Item ID is set to 1, signifying the first revision for this file. Subsequent revisions/items will have incremented ID values, like one would see in a versioning system such as CVS or SVN. Implementations MAY follow this convention, but are not required to do so. For example, a given implementation may instead mark revisions using version numbers ("Beta 1", "6.2", etc) or use other arbitrary strings. However, no two revisions of a given file may share the same ID.

Here is a listing of the possible metadata in a file revision (Item), each field is OPTIONAL:

SizeThe size, in bytes, of the file.
ModifiedThe last modified time of the revision. Follows the format described in XEP-0082. If a publisher prefers to only make a single revision available to clients, the publisher MAY instead update this value (and others, such as size and/or checksum) to announce that a new version of the file is available.
ChecksumA checksum of the revision, using the specified hash algorithm. Acceptable types are "sha512", "sha1", "md5", and "crc32".
MimeThe file's MIME type.
DescriptionDescription text for the revision. As an example, could contain release notes.
MirrorsA list of mirrors; their properties are defined below. If no downloads are available, MAY be left empty or removed entirely.

Because Romeo is now subscribed, he receives notice of Juliet's addition:

http://jabber.org/protocol/pubsub#node_config juliets_sonnets http://jabber.org/protocol/pubsub#meta-data Sonnet 42 sonnet.txt 5623 2006-12-13T18:30:02Z 59282c5db190bdc3b152c5b38363442bfda8ebdd text/plain My Latest Sonnet! ... MIRRORS ... ]]>

The above examples give a listing of available mirror protocols in probable configurations. As described in the Implementation Notes, only the sipub mirror type is REQUIRED, the others are only given as examples for common protocols which are not already compatible with SI. Here is a full listing of those protocols and their available settings:

Protocol DescriptionRef AddressPort (default) UserPass
sipub OPTIONAL
http OPTIONALREQUIRED REQUIREDOPTIONAL (80) OPTIONALOPTIONAL
https OPTIONALREQUIRED REQUIREDOPTIONAL (443) OPTIONALOPTIONAL
ftp OPTIONALREQUIRED REQUIREDOPTIONAL (21) OPTIONALOPTIONAL
sftp OPTIONALREQUIRED REQUIREDOPTIONAL (22) OPTIONALOPTIONAL
smb OPTIONALREQUIRED (Incl. Share name) REQUIREDOPTIONAL (445) OPTIONALOPTIONAL

The Description field is where an arbitrary description of the mirror MAY be placed. For example, if a File Listing is advertising mirrors which are located in different geographic locations, then this field may be used to specify those locations.

The Ref field is a unique identifier which is used to request the file from the mirror server. In the above examples, it is used as a path to the file.

The address and port fields describe where the file may be retrieved using the specified protocol. If a port is not provided, the default value (specified in parentheses) is assumed.

The User and Pass fields are for providing credentials which, if given by the File Listing, SHOULD be used when requesting the file. For example, an sftp mirror MAY require that the user log in using specified credentials before the file may be retrieved.

Juliet has revised her sonnet and wishes to publish the new version, while still leaving the original copy available for retrieval. To do this, she inserts a new Item, representing her new revision, into the file's Node:

6102 2007-01-13T18:30:02Z 6aaa20212a99548765b3b15f24f19aaa 97cbc0e445435af94db5cc2133b94ab5faf1399a text/plain A revised copy, fixed some spelling errors. ]]>

Juliet has uploaded a copy of her revised sonnet to a new mirror, and wishes to let her subscribers know about this secondary source. She is able to do this by modifying the revision in question to include a reference to her website, overwriting the existing mirrors in the Item with an updated list:

]]>

Juliet now wishes to allow others to contribute to her sonnet collection. She gives owner access for the entire Listing to Romeo, and publisher access to her nurse:

]]>

Romeo uses his owner access to remove the older revision of Juliet's sonnet:

]]>

Other deletion, modification, and user management operations are available as described in XEP-0060. These examples are provided here to explicitly illustrate the capabilities offered by this system.

Romeo is interested in seeing what files Juliet has made available. To do this, Romeo sends Juliet a request for repositories which she is associated with:

]]>

Juliet responds with a list of Pubsub nodes where she has published files or which she believes would be interesting to Romeo. If no such locations exist, Juliet SHOULD respond with an empty list.

]]>

After browsing Juliet's repository, Romeo has chosen to download her sonnet. The most recent revision of this file contains a listing of available mirrors, and one of them is an SI stream. Romeo sends an SI request to that mirror:

]]>

The rest of the negotiation and transfer occurs as described in XEP-0137.

Since Pubsub is used for the File Listing, the access models described in XEP-0060 MUST be followed. Users MUST NOT be able to view or control information in the File Listing to which they do not have access.

Node IDs MAY take the form of "path/to/file.ext", rather than the randomized strings provided in the above use cases. For example, Juliet's sonnet MAY use a Node ID of "juliets_sonnets/sonnet.txt" rather than "a6190c5d38e22452041d1c5798eff3f5", as long as this ID is unique to the PubSub server. Randomized strings were used in order to explicitly illustrate that Node IDs SHOULD NOT be depended upon for storing information about files.

The "sipub" mirror type MUST be implemented by the client, while the other mirror types are entirely OPTIONAL, and are provided only as examples for custom client implementations which desire use of common protocols which are currently incompatible with SI requests.

If user access to files is restricted, the mirror servers and the File Listing server MUST be able to synchronize these restrictions between them. See Security Considerations.

When restricted files are being distributed, mirrors need to know which users have permission to access which files. If mirrors are not provided this information by the File Listing (or some other entity), unauthorized users could request files from mirrors directly, thus bypassing any such restrictions.

No interaction with the Internet Assigned Numbers Authority (IANA) is required as a result of this XEP.

TODO

TODO