-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathxep-0214.xml
595 lines (572 loc) · 28.2 KB
/
xep-0214.xml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
<?xml version='1.0' encoding='UTF-8'?>
<!DOCTYPE xep SYSTEM 'xep.dtd' [
<!ENTITY % ents SYSTEM 'xep.ent'>
%ents;
]>
<?xml-stylesheet type='text/xsl' href='xep.xsl'?>
<xep>
<header>
<title>File Repository and Sharing</title>
<abstract>While a protocol has been described for initiating a file transfer from one user to another, there is not yet a defined way for users to designate a set of files as available for retrieval by other users of their choosing. This extension defines a common syntax for this purpose which is based on PubSub Collections.</abstract>
&LEGALNOTICE;
<number>0214</number>
<status>Deferred</status>
<type>Standards Track</type>
<sig>Standards</sig>
<approver>Council</approver>
<dependencies>
<spec>XMPP Core</spec>
<spec>XEP-0001</spec>
<spec>XEP-0060</spec>
<spec>XEP-0082</spec>
<spec>XEP-0137</spec>
<spec>XEP-0248</spec>
</dependencies>
<supersedes/>
<supersededby/>
<shortname>NOT_YET_ASSIGNED</shortname>
<author>
<firstname>Nicholas</firstname>
<surname>Parker</surname>
<email>nickbp@gmail.com</email>
<jid>nickp@jabber.org</jid>
</author>
<revision>
<version>0.3.1</version>
<date>2022-03-22</date>
<initials>gl</initials>
<remark><p>Fix incorrect reference to sipub namespace.</p></remark>
</revision>
<revision>
<version>0.3.0</version>
<date>2021-08-03</date>
<initials>rm</initials>
<remark><p>Revert change from version 0.2.1 which changed meta-data to metadata in wire protocol. That was an unintended breaking change which has now been reverted.</p></remark>
</revision>
<revision>
<version>0.2.1</version>
<date>2018-11-03</date>
<initials>pep</initials>
<remark>Fix a bunch of typos, batch-style.</remark>
</revision>
<revision>
<version>0.2</version>
<date>2009-01-05</date>
<initials>nbp</initials>
<remark><p>Non-functional rewording and refactoring. Now reflects the move of PubSub Collections into a separate extension.</p></remark>
</revision>
<revision>
<version>0.1</version>
<date>2007-04-20</date>
<initials>psa</initials>
<remark><p>Initial published version.</p></remark>
</revision>
<revision>
<version>0.0.3</version>
<date>2007-03-18</date>
<initials>nbp</initials>
<remark><p>Added support for Stream Initiation Requests. Clarified purpose of additional mirror types.</p></remark>
</revision>
<revision>
<version>0.0.2</version>
<date>2007-01-26</date>
<initials>nbp</initials>
<remark><p>Rewritten to use Pubsub.</p></remark>
</revision>
<revision>
<version>0.0.1</version>
<date>2006-09-01</date>
<initials>nbp</initials>
<remark><p>First draft.</p></remark>
</revision>
</header>
<section1 topic='Introduction' anchor='intro'>
<p>This document defines a common format which allows a Jabber user to submit, find, and retrieve files within XMPP. The file listing itself is stored on a &xep0060; server, allowing multiple users to manage the same listing. Other features specified by this extension include file metadata, revisions, and download mirrors.</p>
<p>Retrieval of files provided in a listing MAY be performed through any relevant protocol for transferring data (http, ftp, etc). This protocol standardizes the use of &xep0137; to establish the file transfer, but also allows for usage of outside protocols such as http or ftp.</p>
</section1>
<section1 topic='Requirements' anchor='reqs'>
<p>The protocol defined herein provides the following functionality:</p>
<ol>
<li>Publication of a list of available files to a PubSub server, with support for hierarchical listings, file metadata, user privileges, and file versioning.</li>
<li>Request that a file be sent from a Jabber contact directly to oneself using Stream Initiation.</li>
</ol>
</section1>
<section1 topic='Glossary' anchor='glossary'>
<table caption="File Sharing Terms">
<tr>
<th>File Listing</th>
<td>A Root-level Pubsub Collection Node, containing information about files and/or subsections which a user or group of users have published.</td>
</tr>
<tr>
<th>Subsection</th>
<td>A Non-Root Collection Node which contains files and/or other subsections.</td>
</tr>
<tr>
<th>File</th>
<td>A Pubsub Node, stored within a File Listing, which describes all revisions of a given file. The filename and (optional) description are provided here.</td>
</tr>
<tr>
<th>Revision</th>
<td>A Pubsub Item which describes a given file revision. Other metadata which can vary between revisions, such as filesize, checksum, or available mirrors, is provided here.</td>
</tr>
<tr>
<th>Mirror</th>
<td>A location which has a given Revision available for download. Additional information about a Mirror MAY be specified in instances where the protocol requires it. A list of example file transfer protocols is provided below, but others may also be deployed.</td>
</tr>
</table>
</section1>
<section1 topic='Use Cases' anchor='usecases'>
<p>The following use cases describe tasks which are already covered by &xep0060; in a more generic context. These tasks are again being provided here in order to demonstrate the functionality provided by this protocol and convey the structure and syntax of the file listing. As a result of this close relationship, many details of PubSub are omitted here for brevity. Consult &xep0060; and &xep0248; for the full specification of node and user management commands as well as their server responses.</p>
<section2 topic='File Listing' anchor='list'>
<section3 topic='Publication' anchor='list-publication'>
<p>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:</p>
<example caption='Creating a New File Listing'><![CDATA[<iq type='set'
from='juliet@capulet.com/balcony'
to='pubsub.shakespeare.lit'
id='create3'>
<pubsub xmlns='http://jabber.org/protocol/pubsub'>
<create node='juliets_sonnets'/>
<configure>
<x xmlns='jabber:x:data' type='submit'>
<field var='FORM_TYPE' type='hidden'>
<value>http://jabber.org/protocol/pubsub#node_config</value>
</field>
<field var='pubsub#node_type'><value>collection</value></field>
</x>
</configure>
</pubsub>
</iq>
<iq type='set'
from='juliet@capulet.com/balcony'
to='pubsub.shakespeare.lit'
id='config2'>
<pubsub xmlns='http://jabber.org/protocol/pubsub#owner'>
<configure node='juliets_sonnets'/>
<x xmlns='jabber:x:data' type='submit'>
<field var='FORM_TYPE' type='hidden'>
<value>http://jabber.org/protocol/pubsub#meta-data</value>
</field>
<field var='pubsub#title'><value>Juliet's Sonnets</value></field>
<field var='pubsub#description'><value>Optional Description</value></field>
</x>
</configure>
</pubsub>
</iq>
]]></example>
<p>Juliet also wishes to add a subsection for her sonnets about Romeo. She creates another PubSub Collection Node under the Root Node:</p>
<example caption='Adding a Subsection to the Listing'><![CDATA[<iq type='set'
from='juliet@capulet.com/balcony'
to='pubsub.shakespeare.lit'
id='create3'>
<pubsub xmlns='http://jabber.org/protocol/pubsub'>
<create node='35227eec194a4f3971a5f3771e9c2271'/>
<configure>
<x xmlns='jabber:x:data' type='submit'>
<field var='FORM_TYPE' type='hidden'>
<value>http://jabber.org/protocol/pubsub#node_config</value>
</field>
<field var='pubsub#collection'><value>juliets_sonnets</value></field>
<field var='pubsub#node_type'><value>collection</value></field>
</x>
</configure>
</pubsub>
</iq>
<iq type='set'
from='juliet@capulet.com/balcony'
to='pubsub.shakespeare.lit'
id='config2'>
<pubsub xmlns='http://jabber.org/protocol/pubsub'>
<configure node='35227eec194a4f3971a5f3771e9c2271'/>
<x xmlns='jabber:x:data' type='submit'>
<field var='FORM_TYPE' type='hidden'>
<value>http://jabber.org/protocol/pubsub#meta-data</value>
</field>
<field var='pubsub#title'><value>Sonnets About Romeo</value></field>
<field var='pubsub#description'><value>Optional Description</value></field>
</x>
</configure>
</pubsub>
</iq>
]]></example>
</section3>
<section3 topic='Subscription' anchor='list-subscription'>
<p>Romeo wishes to view all of Juliet's shared sonnets. To do this, Romeo subscribes to the Root Collection Node:</p>
<example caption='Subscription to entire File Listing'><![CDATA[<iq type='set'
from='romeo@montague.net/orchard'
to='pubsub.shakespeare.lit'
id='collsub2'>
<pubsub xmlns='http://jabber.org/protocol/pubsub'>
<subscribe jid='romeo@montague.net' node='juliets_sonnets'/>
<options>
<x xmlns='jabber:x:data'>
<field var='FORM_TYPE' type='hidden'>
<value>http://jabber.org/protocol/pubsub#subscribe_options</value>
</field>
<field var='pubsub#subscription_type'><value>items</value></field>
<field var='pubsub#subscription_depth'><value>all</value></field>
</x>
</options>
</pubsub>
</iq>
]]></example>
</section3>
<section3 topic='Addition' anchor='list-addition'>
<p>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:</p>
<example caption='Adding a new File'><![CDATA[<iq type='set'
from='juliet@capulet.com/balcony'
to='pubsub.shakespeare.lit'
id='create4'>
<pubsub xmlns='http://jabber.org/protocol/pubsub#node_config'>
<create node='a6190c5d38e22452041d1c5798eff3f5'/>
<configure>
<x xmlns='jabber:x:data' type='submit'>
<field var='pubsub#collection'><value>juliets_sonnets</value></field>
</x>
</configure>
</pubsub>
</iq>
<iq type='set'
from='juliet@capulet.com/balcony'
to='pubsub.shakespeare.lit'
id='config2'>
<pubsub xmlns='http://jabber.org/protocol/pubsub'>
<configure node='a6190c5d38e22452041d1c5798eff3f5'>
<x xmlns='jabber:x:data' type='submit'>
<field var='FORM_TYPE' type='hidden'>
<value>http://jabber.org/protocol/pubsub#meta-data</value>
</field>
<field var='pubsub#title'><value>sonnet.txt</value></field>
<field var='pubsub#description'><value>Sonnet 42</value></field>
</x>
</configure>
</pubsub>
</iq>
<iq type='set'
from='juliet@capulet.com/balcony'
to='pubsub.shakespeare.lit'
id='publish1'>
<pubsub xmlns='http://jabber.org/protocol/pubsub'>
<publish node='a6190c5d38e22452041d1c5798eff3f5'>
<item id='1'>
<entry xmlns='http://jabber.org/protocol/fileshare#item_metadata'>
<size>5623</size>
<modified>2006-12-13T18:30:02Z</modified>
<checksum type="sha1">59282c5db190bdc3b152c5b38363442bfda8ebdd</checksum>
<mime>text/plain</mime>
<description>My Latest Sonnet!</description>
<mirrors>
<mirror type='sipub' description='File Transfer via capulet.com fileserver'>
<sipub xmlns='http://jabber.org/protocol/sipub'
from='fileserver@capulet.com'
id='publish-sonnet.txt'
mime-type='text/plain'
profile='http://jabber.org/protocol/si/profile/file-transfer'>
<file xmlns='http://jabber.org/protocol/si/profile/file-transfer'
name='sonnet.txt'
size='5623'/>
</sipub>
</mirror>
<mirror type='sipub' description='Jingle HTTP File Transfer via capulet.com fileserver'>
<sipub xmlns='http://jabber.org/protocol/sipub'
from='fileserver-httpft@capulet.com'
id='publish-sonnet.txt'
mime-type='text/plain'
profile='http://jabber.org/protocol/si/profile/jingle-httpft'>
<description xmlns='http://www.xmpp.org/extensions/xep-XXXX.html#ns'>
<manifest>
<file>
<name>sonnet.txt</name>
</file>
</manifest>
<http>
<url name='source-path'>/source/23A53F01/</url>
<url name='preview-path'>/preview/90266EA1/</url>
</http>
</description>
</sipub>
</mirror>
<mirror type='http' description='Shakespeare.lit Torrent'
address='www.shakespeare.lit'
ref='torrents/sonnet.torrent'/>
<mirror type='http' description='Shakespeare.lit Website'
address='www.shakespeare.lit'
ref='~juliet/sonnet.txt'/>
<mirror type='https' description='Shakespeare.lit Website (SSL)'
address='ssl.shakespeare.lit'
ref='~juliet/sonnet.txt'/>
<mirror type='ftp' description='Shakespeare.lit FTP'
user='guest' pass='guest'
address='files.shakespeare.lit' port='21'
ref='public/sonnet.txt'/>
<mirror type='sftp' description='Shakespeare.lit SFTP'
user='guest' pass='guest'
address='ssh.shakespeare.lit' port='22'
ref='public/sonnet.txt'/>
<mirror type='smb' description='Capulet Intranet SMB Share'
user='guest' pass='guest'
address='smbfiles.capulet.com'
ref='juliet/mysonnets/sonnet.txt'/>
</mirrors>
</entry>
</item>
</publish>
</pubsub>
</iq>
]]></example>
<p>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.</p>
<p>Node IDs MAY take the form of "path/to/file.ext", rather than the randomized string "a6190c5d38e22452041d1c5798eff3f5" provided in the above use case. For example, Juliet's sonnet MAY instead use a Node ID of "juliets_sonnets/sonnet.txt", as long as this ID is unique within the PubSub server. Randomized strings are used in this document to illustrate that Node IDs SHOULD NOT be used for providing information about files.</p>
<p>Here is a listing of the possible metadata in a file revision (Item), each field is OPTIONAL:</p>
<table caption="Revision Metadata">
<tr><th>Size</th><td>The size, in bytes, of the file.</td></tr>
<tr><th>Modified</th><td>The last modified time of the revision. Follows the format described in &xep0082;. 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.</td></tr>
<tr><th>Checksum</th><td>A checksum of the revision, using the specified hash algorithm. Acceptable types are "sha512", "sha1", "md5", and "crc32".</td></tr>
<tr><th>Mime</th><td>The file's MIME type.</td></tr>
<tr><th>Description</th><td>Description text for the revision. As an example, could contain release notes.</td></tr>
<tr><th>Mirrors</th><td>A list of mirrors; their properties are defined below. If no downloads are available, MAY be left empty or removed entirely.</td></tr>
</table>
<p>Because Romeo is now subscribed, he receives notice of Juliet's addition:</p>
<example caption='Notification of Addition'><![CDATA[<message from='pubsub.shakespeare.lit' to='romeo@montague.net' id='create4'>
<event xmlns='http://jabber.org/protocol/pubsub#event'>
<collection>
<node id='a6190c5d38e22452041d1c5798eff3f5'>
<x xmlns='jabber:x:data' type='result'>
<field var='FORM_TYPE' type='hidden'>
<value>http://jabber.org/protocol/pubsub#node_config</value>
</field>
<field var='pubsub#collection'><value>juliets_sonnets</value></field>
</x>
</node>
</collection>
</event>
</message>
<message from='pubsub.shakespeare.lit' to='romeo@montague.net' id='config2'>
<event xmlns='http://jabber.org/protocol/pubsub#event'>
<configuration node='a6190c5d38e22452041d1c5798eff3f5'>
<x xmlns='jabber:x:data' type='result'>
<field var='FORM_TYPE' type='hidden'>
<value>http://jabber.org/protocol/pubsub#meta-data</value>
</field>
<field var='pubsub#description'><var>Sonnet 42</var></field>
<field var='pubsub#title'><var>sonnet.txt</var></field>
</x>
</configuration>
</event>
</message>
<message from='pubsub.shakespeare.lit' to='romeo@montague.net' id='foo'>
<event xmlns='http://jabber.org/protocol/pubsub#event'>
<items node='a6190c5d38e22452041d1c5798eff3f5'>
<item id='1'>
<entry xmlns='http://jabber.org/protocol/fileshare#item_config'>
<size>5623</size>
<modified>2006-12-13T18:30:02Z</modified>
<checksum type="sha1">59282c5db190bdc3b152c5b38363442bfda8ebdd</checksum>
<mime>text/plain</mime>
<description>My Latest Sonnet!</description>
<mirrors>
... MIRRORS ...
</mirrors>
</entry>
</item>
</items>
</event>
</message>
]]></example>
<p>The above examples give a listing of several possible file transfer protocols in example configurations. Only the sipub mirror type is REQUIRED; the other types are OPTIONAL. Here is a full listing of those protocols and their available settings:</p>
<table caption="Mirror Types And Their Settings">
<tr><th>Protocol</th>
<th>Description</th><th>Ref</th>
<th>Address</th><th>Port (default)</th>
<th>User</th><th>Pass</th></tr>
<tr><th>sipub (REQUIRED)</th>
<td>OPTIONAL</td><td>N/A</td>
<td>N/A</td><td>N/A</td>
<td>N/A</td><td>N/A</td></tr>
<tr><th>http (OPTIONAL)</th>
<td>OPTIONAL</td><td>REQUIRED</td>
<td>REQUIRED</td><td>OPTIONAL (80)</td>
<td>OPTIONAL</td><td>OPTIONAL</td></tr>
<tr><th>https (OPTIONAL)</th>
<td>OPTIONAL</td><td>REQUIRED</td>
<td>REQUIRED</td><td>OPTIONAL (443)</td>
<td>OPTIONAL</td><td>OPTIONAL</td></tr>
<tr><th>ftp (OPTIONAL)</th>
<td>OPTIONAL</td><td>REQUIRED</td>
<td>REQUIRED</td><td>OPTIONAL (21)</td>
<td>OPTIONAL</td><td>OPTIONAL</td></tr>
<tr><th>sftp (OPTIONAL)</th>
<td>OPTIONAL</td><td>REQUIRED</td>
<td>REQUIRED</td><td>OPTIONAL (22)</td>
<td>OPTIONAL</td><td>OPTIONAL</td></tr>
<tr><th>smb (OPTIONAL)</th>
<td>OPTIONAL</td><td>REQUIRED</td>
<td>REQUIRED</td><td>OPTIONAL (445)</td>
<td>OPTIONAL</td><td>OPTIONAL</td></tr>
</table>
<p>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.</p>
<p>The Ref field is a unique address or identifier for retrieving the file from the mirror server. In the above examples, it is used as a path to the file.</p>
<p>The address and port fields describe the server where the file may be retrieved using the specified protocol. If a port is not provided, the default value (specified in parentheses) MAY be assumed.</p>
<p>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.</p>
</section3>
<section3 topic='New Revisions' anchor='list-newrevisions'>
<p>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:</p>
<example caption='Adding a new Revision'><![CDATA[<iq type='set'
from='juliet@capulet.com/balcony'
to='pubsub.shakespeare.lit'
id='publish1'>
<pubsub xmlns='http://jabber.org/protocol/pubsub'>
<publish node='a6190c5d38e22452041d1c5798eff3f5'>
<item id='2'>
<entry xmlns='http://jabber.org/protocol/fileshare#item_config'>
<size>6102</size>
<modified>2007-01-13T18:30:02Z</modified>
<checksum type="md5">6aaa20212a99548765b3b15f24f19aaa</checksum>
<checksum type="sha1">97cbc0e445435af94db5cc2133b94ab5faf1399a</checksum>
<mime>text/plain</mime>
<description>A revised copy, fixed some spelling errors.</description>
<mirrors>
<mirror type='ftp' description='Shakespeare.lit FTP'
user='guest' pass='guest'
address='files.shakespeare.lit' port='21'
ref='public/juliet/sonnet2.txt'/>
<mirror type='http' description='Shakespeare.lit Website'
address='www.shakespeare.lit'
ref='~juliet/sonnet2.txt'/>
<mirror type='sipub' description='File Transfer via capulet.com fileserver'>
<sipub xmlns='http://jabber.org/protocol/sipub'
from='fileserver@capulet.com'
id='publish-sonnet2.txt'
mime-type='text/plain'
profile='http://jabber.org/protocol/si/profile/file-transfer'>
<file xmlns='http://jabber.org/protocol/si/profile/file-transfer'
name='sonnet2.txt'
size='6102'/>
</sipub>
</mirror>
</mirrors>
</entry>
</item>
</publish>
</pubsub>
</iq>
]]></example>
</section3>
<section3 topic='Modification/Deletion' anchor='list-deletion'>
<p>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:</p>
<example caption='Modifying a Revision'><![CDATA[<iq type='set'
from='juliet@capulet.com/balcony'
to='pubsub.shakespeare.lit'
id='publish1'>
<pubsub xmlns='http://jabber.org/protocol/pubsub'>
<publish node='a6190c5d38e22452041d1c5798eff3f5'>
<item id='2'>
<entry xmlns='http://jabber.org/protocol/fileshare#item_config'>
<mirrors>
<mirror type='ftp' description='Shakespeare.lit FTP'
user='guest' pass='guest'
address='files.shakespeare.lit' port='21'
ref='public/juliet/sonnet2.txt'/>
<mirror type='http' description='Shakespeare.lit Website'
address='www.shakespeare.lit'
ref='~juliet/sonnet2.txt'/>
<mirror type='sipub' description='File Transfer via capulet.com fileserver'>
<sipub xmlns='http://jabber.org/protocol/sipub'
from='fileserver@capulet.com'
id='publish-sonnet2.txt'
mime-type='text/plain'
profile='http://jabber.org/protocol/si/profile/file-transfer'>
<file xmlns='http://jabber.org/protocol/si/profile/file-transfer'
name='sonnet2.txt'
size='6102'/>
</sipub>
</mirror>
<mirror type='http' description='Shakespeare.lit Boston Mirror'
address='www.capulet.com'
ref='~juliet/sonnet2.txt'/>
</mirrors>
</entry>
</item>
</publish>
</pubsub>
</iq>
]]></example>
<p>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:</p>
<example caption='Modifying Users'><![CDATA[<iq type='set'
from='juliet@capulet.com/balcony'
to='pubsub.shakespeare.lit'
id='ent3'>
<pubsub xmlns='http://jabber.org/protocol/pubsub#owner'>
<affiliations node='juliets_sonnets'>
<affiliation jid='nurse@capulet.com' affiliation='publisher'/>
<affiliation jid='romeo@montague.net' affiliation='owner'/>
</affiliations>
</pubsub>
</iq>
]]></example>
<p>Romeo uses his owner access to remove the older revision of Juliet's sonnet:</p>
<example caption='Deleting a Revision'><![CDATA[<iq type='set'
from='romeo@montague.net/orchard'
to='pubsub.shakespeare.lit'
id='retract1'>
<pubsub xmlns='http://jabber.org/protocol/pubsub'>
<retract node='a6190c5d38e22452041d1c5798eff3f5'>
<item id='1'/>
</retract>
</pubsub>
</iq>
]]></example>
<p>Other deletion, modification, and user management operations are available as described in &xep0060; and &xep0248;.</p>
</section3>
</section2>
<section2 topic='File Requests' anchor='file-requests'>
<p>Romeo is interested in seeing what files Juliet has made available. To do this, Romeo sends a request to Juliet for repositories which she is associated with:</p>
<example caption='Request for File Repository listing'><![CDATA[<iq type='get'
from='romeo@montague.net/orchard'
to='juliet@capulet.com'
id='repolistreq'>
<fileshare xmlns='http://jabber.org/protocol/si/profile/fileshare'>
<list/>
</fileshare>
</iq>
]]></example>
<p>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.</p>
<example caption='File Repository listing'><![CDATA[<iq type='get'
from='romeo@montague.net/orchard'
to='juliet@capulet.com'
id='repolist'>
<fileshare xmlns='http://jabber.org/protocol/si/profile/fileshare'>
<list>
<repo address='pubsub.shakespeare.lit'
node='juliets_sonnets' description='My Sonnets'/>
</list>
</fileshare>
</iq>
]]></example>
<p>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 Romeo sees that one of them is an SI stream. Romeo sends an SI request to that mirror:</p>
<example caption='Request that a file be sent'><![CDATA[<iq type='get'
id='sipub-request-0'
from='romeo@montague.net/orchard'
to='fileserver@capulet.com'>
<start xmlns='http://jabber.org/protocol/sipub'
id='publish-sonnet2.txt'/>
</iq>
]]></example>
<p>The rest of the negotiation and file transfer occurs as described in &xep0137;.</p>
</section2>
</section1>
<section1 topic='Implementation Notes' anchor='impl'>
<p>Since PubSub is used for the File Listing, the access models described in &xep0060; and &xep0248; MUST be followed. Users MUST NOT be able to view or control information in the File Listing to which they do not have access.</p>
<p>If user access to files is restricted, the Mirror servers and the PubSub server MUST be able to synchronize these restrictions between them. See <link url='#security'>Security Considerations</link>.</p>
</section1>
<section1 topic='Security Considerations' anchor='security'>
<p>When restricted files are being distributed, mirrors need to know which users have sufficient privileges to access which files. If mirrors are not kept up to date on user privileges, unauthorized users could access files directly from those mirrors, thus bypassing any restrictions being set on the PubSub server.</p>
</section1>
<section1 topic='IANA Considerations' anchor='iana'>
<p>No interaction with the Internet Assigned Numbers Authority (IANA) is required as a result of this XEP.</p>
</section1>
<section1 topic='Jabber Registrar Considerations' anchor='registrar'>
<p>TODO</p>
</section1>
<section1 topic='XML Schema' anchor='schema'>
<p>TODO</p>
</section1>
</xep>