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

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207
  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>File Information Sharing</title>
  10. <abstract>This document specifies a simple extension to existing protocols that allows an entity to request information about files.</abstract>
  11. &LEGALNOTICE;
  12. <number>0329</number>
  13. <status>Deferred</status>
  14. <type>Standards Track</type>
  15. <sig>Standards</sig>
  16. <approver>Council</approver>
  17. <dependencies>
  18. <spec>XMPP Core</spec>
  19. <spec>XEP-0234</spec>
  20. <spec>XEP-0059</spec>
  21. <spec>XEP-0265</spec>
  22. </dependencies>
  23. <supersedes>
  24. <spec>XEP-0135</spec>
  25. </supersedes>
  26. <supersededby/>
  27. <shortname>fis</shortname>
  28. <author>
  29. <firstname>Jefry</firstname>
  30. <surname>Lagrange</surname>
  31. <email>jefry.reyes@gmail.com</email>
  32. <jid>j.lagrange@jabber.org</jid>
  33. </author>
  34. &lance;
  35. <revision>
  36. <version>0.4</version>
  37. <date>2017-09-11</date>
  38. <initials>XEP Editor (jwi)</initials>
  39. <remark>Defer due to lack of activity.</remark>
  40. </revision>
  41. <revision>
  42. <version>0.3</version>
  43. <date>2016-08-07</date>
  44. <initials>egp</initials>
  45. <remark><p>Updated the &xep0234; referenced version to 0.16 or higher.</p></remark>
  46. </revision>
  47. <revision>
  48. <version>0.2</version>
  49. <date>2013-11-19</date>
  50. <initials>jl</initials>
  51. <remark><p>Corrected namespace to use XSF format.</p></remark>
  52. </revision>
  53. <revision>
  54. <version>0.1</version>
  55. <date>2013-06-11</date>
  56. <initials>psa</initials>
  57. <remark><p>Initial published version approved by the XMPP Council.</p></remark>
  58. </revision>
  59. <revision>
  60. <version>0.0.4</version>
  61. <date>2013-01-26</date>
  62. <initials>jl</initials>
  63. <remark>Third draft</remark>
  64. </revision>
  65. </header>
  66. <section1 topic='Introduction' anchor='intro'>
  67. <p>XMPP extensions provide ways of transferring files between peers (such as &xep0234; and &xep0096;). However, file transfer is currently limited to needing that the transfer be initiated by the hosting entity. The &xep0234; extension, provides for a way to request files, but it requires the requesting entity to have information about the file being requested, so that it can be uniquely identified. </p>
  68. <p>This document defines an extension which allows the request of information of files being offered by a hosting entity so they can later be requested in a file transfer; If the requesting entity is interested in the file.</p>
  69. <p>&xep0135; is a previous extention that attempted to solve the same problem as this one, but unfortunetly it didn't generate much interest and it got deprecated. This extention aims be a modern replacement for XEP-0135.</p>
  70. <p>IRC users have been able to bypass the limitations of the protocol by using bots that provide information of files and initiate transfer on command. A major downside of this method is that not every user is capable of sharing its files. The aim of this document is to provide a similar functionality while making it easier for users to offer and request information about files. </p>
  71. <p>Microsoft's MSN proprietary IM client, used to provide similar functionality using "Sharing Folders", but this was replaced by Windows Live SkyDrive </p>
  72. </section1>
  73. <section1 topic='Requirements' anchor='reqs'>
  74. <ol>
  75. <li>Enable a requesting entity to traverse the shared directory of an offering entity (REQUIRED)</li>
  76. <li>Enable a requesting entity to get detailed information about files. (REQUIRED)</li>
  77. </ol>
  78. </section1>
  79. <section1 topic='Assumptions' anchor='assump'>
  80. <!-- Maybe make this into a list -->
  81. <p> This protocol assumes the existence of one or more shared directories (either virtual or physical). The hosting entity must not advertise empty directories. The hosting entity is responsible of maintaining the structure of those directories (such as not allowing two files with the same name and preventing cycles within directories). The hosting entity is in no way required to present the same shared directories to different requesters. In fact, the reason multiple share directories are allowed, is to make it easier for implementers to manage permissions of who can see what files.</p>
  82. </section1>
  83. <section1 topic='Getting Information About Files ' anchor='disco'>
  84. <section2 topic='Traversing Files' anchor='traver'>
  85. <p>If a requesting entity wishes to know what files are being shared by an offering entity, it can do so by sending the following query:</p>
  86. <example caption='Requester queries the root of the shared folder'><![CDATA[
  87. <iq type='get'
  88. from='juliet@capulet.com/chamber'
  89. to='romeo@montague.net/home'
  90. id='1234'>
  91. <query xmlns="urn:xmpp:fis:0" />
  92. </iq>]]></example>
  93. <p> If the offering entity wishes to share files with the requesting entity, it may respond with a list of shared folders. It MUST not include any files in this response.</p>
  94. <example caption='The offering entity responds with shared directories'><![CDATA[
  95. <iq type='result'
  96. from='romeo@montague.net/home'
  97. to='juliet@capulet.com/chamber'
  98. id='1234'>
  99. <query xmlns="urn:xmpp:fis:0">
  100. <directory name='documents'/>
  101. <directory name='pics'/>
  102. <directory name='audio'/>
  103. </query>
  104. </iq>]]></example>
  105. <p>if the offering entity has no files to offer</p>
  106. <example caption='The offering entity responds with no files'><![CDATA[
  107. <iq type='result'
  108. from='romeo@montague.net/home'
  109. to='juliet@capulet.com/chamber'
  110. id='1234'>
  111. <query xmlns="urn:xmpp:fis:0" />
  112. </iq>]]></example>
  113. <p>Requesting the list of files and directories within a directory.</p>
  114. <example caption='The requesting entity wants to know about a particular directory'><![CDATA[
  115. <iq type='get'
  116. from='juliet@capulet.com/chamber'
  117. to='romeo@montague.net/home'
  118. id='1235'>
  119. <query xmlns="urn:xmpp:fis:0" node="documents" />
  120. </iq>]]></example>
  121. <p>When replying with a list of files, the offering entity can choose to either reply with verbose information on the file using the file attributes defined by &xep0234; or it may reply only with the 'name' attribute, which is required and MUST be included in every response.</p>
  122. <p>It is RECOMENDED, when the list files to be sent is small, that a verbose response be made (in order to avoid going back and forth requesting information), and that a non-verbose reponse be made otherwise. This recomendation is made to save bandwidth.</p>
  123. <example caption='The offering entity replies with information about a particular directory'><![CDATA[
  124. <iq type='result'
  125. from='romeo@montague.net/home'
  126. to='juliet@capulet.com/chamber'
  127. id='1235'>
  128. <query xmlns="urn:xmpp:fis:0" node="documents">
  129. <file xmlns='urn:xmpp:jingle:apps:file-transfer:4'>
  130. <name>test.txt</name>
  131. <date>1969-07-21T02:56:15Z</date>
  132. <desc>This is a test. If this were a real file...</desc>
  133. <range/>
  134. <size>1022</size>
  135. <hash xmlns='urn:xmpp:hashes:1' algo='sha-1'>552da749930852c69ae5d2141d3766b1</hash>
  136. </file>
  137. <file xmlns='urn:xmpp:jingle:apps:file-transfer:4'>
  138. <name>test2.txt</name>
  139. </file>
  140. <directory name="secret docs" />
  141. </query>
  142. </iq>]]></example>
  143. <p>If the requesting entity wants to get detailed information about a file. It can do so by providing its full path.</p>
  144. <example caption='The requesting entity wants to know about a particular file'><![CDATA[
  145. <iq type='get'
  146. from='juliet@capulet.com/chamber'
  147. to='romeo@montague.net/home'
  148. id='1236'>
  149. <query xmlns="urn:xmpp:fis:0" node="documents/test2.txt" />
  150. </iq>]]></example>
  151. <example caption='The offering entity responds with more information'><![CDATA[
  152. <iq type='result'
  153. from='romeo@montague.net/home'
  154. to='juliet@capulet.com/chamber'
  155. id='1236'>
  156. <query xmlns="urn:xmpp:fis:0" node="test2.txt">
  157. <file xmlns='urn:xmpp:jingle:apps:file-transfer:4'>
  158. <name>test2.txt</name>
  159. <size>1000</size>
  160. </file>
  161. </query>
  162. </iq>]]></example>
  163. </section2>
  164. </section1>
  165. <section1 topic='Bandwidth Considerations' anchor='bandwidth'>
  166. <p> If a considerable amount of files are being shared by the offering entity, it may be the case that the offering entity response might be too be for the server to handle; As there might be a limitation on the size of the stanzas in the current stream. In order to solve this, extensions have been devised and their implementation are hereby recommended along with the implementation of this extension.</p>
  167. <section2 topic='Using Result Set Management' anchor='resultset'>
  168. <p>&xep0059; defines a way of limiting the results of a request. There are some considerations to use result sets along with this extension.</p>
  169. <p>First, it is defined that the requesting entity is the one that sets the limit of the number of items that can be replied. So it is up to the requesting entity to choose a sensible number.</p>
  170. <p>Second, since this protocol defines a way of handling the directory tree structure by allowing file tags to be children of a directory tags, it becomes difficult to define items for Result Set Management. Therefore, when responding to a request, the offering entity MUST NOT send directory tags with files as their children. </p>
  171. </section2>
  172. <section2 topic='Out of Band Transfer' anchor='out-of-band'>
  173. <p>One obvious way to overcome the limitations of sending large stanzas in-band, is to transfer that information out of band. &xep0265; could be used for that purpose. It is hereby RECOMMENDED its implementation when the offering entity has a massive amount of files that would not be practical to advertise in-band.</p>
  174. <p>It is further recommended that when using XEP-0265, the entire directory structure, along with all the files in the shared folder and subfolders, be exchanged in one single reply. Also, all the files attributes should be included. This is to avoid wasting bandwidth initiating out of band streams going back and forth. </p>
  175. </section2>
  176. </section1>
  177. <section1 topic='Implementation Notes' anchor='implementation'>
  178. <section2 topic='File identification' anchor='file_id'>
  179. <p> As it was previously discussed, when requesting detailed information about a file, only the "name" attribute is required, but it is strongly RECOMMENDED that the hash attribute be included, in order to reduce the chances of sending the wrong file. When requesting the file to be transferred using &xep0234;, the information that must be provided has to identify the file uniquely. It is then RECOMMENDED that when requesting a file, the full path of the file in the shared folder be included in the "name" attribute.</p>
  180. <example><![CDATA[
  181. <iq type='get'
  182. from='juliet@capulet.com/chamber'
  183. to='romeo@montague.net/home'
  184. id='1237'>
  185. <jingle xmlns='urn:xmpp:jingle:1'
  186. action='session-initiate'
  187. initiator='juliet@capulet.com/chamber'
  188. sid='uj3b2'>
  189. <content creator='initiator' name='a-file-request' senders='responder'>
  190. <description xmlns='urn:xmpp:jingle:apps:file-transfer:4'>
  191. <file>
  192. <name>pics/test4.png</name>
  193. <size>10740</size>
  194. </file>
  195. </description>
  196. </content>
  197. </jingle>
  198. </iq>]]></example>
  199. </section2>
  200. <section2 topic='File Sharing in MUCs' anchor='fis_muc'>
  201. <p>For the most part, discovering files in a MUC is exactly the same as what has been described in this document. However, it is RECOMMENDED that a participant in a MUC should have a single shared folder associated with the entire room, as opposed to advertise different files to different participants of the room. This is to reduce the complexity of the client software. Also, due to volatile nature of the participants in a room, keeping track of permissions is more trouble than what it is worth.</p>
  202. </section2>
  203. </section1>
  204. <section1 topic='Security Considerations' anchor='security'>
  205. <p>A denial of service is possible by repeatedly requesting files. Implementers are advised to take this into consideration and include queues and limits into their implementations.</p>
  206. </section1>
  207. </xep>