-
Notifications
You must be signed in to change notification settings - Fork 0
/
xep-0066.xml
319 lines (311 loc) · 13.7 KB
/
xep-0066.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
<?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>Out of Band Data</title>
<abstract>This specification defines two XMPP protocol extensions for communicating URIs, one for use in XMPP message stanzas and the other for use in a structured request-response interaction via XMPP IQ stanzas. Among other things, this enables one entity to inform another entity about a file that is available at an HTTP URL.</abstract>
&LEGALNOTICE;
<number>0066</number>
<status>Draft</status>
<type>Standards Track</type>
<sig>Standards</sig>
<approver>Council</approver>
<dependencies>
<spec>XMPP Core</spec>
</dependencies>
<supersedes/>
<supersededby/>
<shortname>oob</shortname>
<schemaloc>
<ns>jabber:iq:oob</ns>
<url>http://www.xmpp.org/schemas/iq-oob.xsd</url>
</schemaloc>
<schemaloc>
<ns>jabber:x:oob</ns>
<url>http://www.xmpp.org/schemas/x-oob.xsd</url>
</schemaloc>
&stpeter;
<revision>
<version>1.5</version>
<date>2006-08-16</date>
<initials>psa</initials>
<remark><p>Per a vote of the Jabber Council, converted to Standards Track.</p></remark>
</revision>
<revision>
<version>1.4</version>
<date>2006-01-11</date>
<initials>psa</initials>
<remark><p>Removed example of including URL in presence stanza.</p></remark>
</revision>
<revision>
<version>1.3</version>
<date>2004-10-18</date>
<initials>psa</initials>
<remark><p>Added non-normative section on integration with stream initiation (XEP-0095); added optional sid attribute to jabber:iq:oob schema.</p></remark>
</revision>
<revision>
<version>1.2</version>
<date>2004-04-13</date>
<initials>psa</initials>
<remark><p>Clarified that IQ use is for basic file transfer whereas message and presence use is for communication of URIs; added presence example; added references to file transfer specifications as well as related open issue.</p></remark>
</revision>
<revision>
<version>1.1</version>
<date>2004-02-10</date>
<initials>psa</initials>
<remark><p>Editorial adjustments and clarifications; added references to relevant RFCs.</p></remark>
</revision>
<revision>
<version>1.0</version>
<date>2003-10-08</date>
<initials>psa</initials>
<remark><p>Per a vote of the Jabber Council, changed status to Active.</p></remark>
</revision>
<revision>
<version>0.3</version>
<date>2003-06-22</date>
<initials>psa</initials>
<remark><p>Made several small editorial changes; added XML schemas.</p></remark>
</revision>
<revision>
<version>0.2</version>
<date>2003-01-08</date>
<initials>psa</initials>
<remark><p>Added information about non-HTTP URIs.</p></remark>
</revision>
<revision>
<version>0.1</version>
<date>2002-12-16</date>
<initials>psa</initials>
<remark><p>Initial version.</p></remark>
</revision>
</header>
<section1 topic='Introduction' anchor='intro'>
<p>This document defines two XMPP protocol extensions for communicating URIs between Jabber entities, where the data formats are qualified by the 'jabber:iq:oob' and 'jabber:x:oob' namespaces. Although these mechanisms were originally used for out-of-band (OOB) data transfer, they are also used more generally to exchange or communicate URIs.</p>
</section1>
<section1 topic='jabber:iq:oob' anchor='iq-oob'>
<p>The intent of the 'jabber:iq:oob' was to provide a "least common denominator" mechanism for basic file transfers. Although &xep0096; defines a more generic method for communicating file exchange options, the 'jabber:iq:oob' namespace can be included as one option therein since it provides a fallback mechanism when clients do not support file transfer options such as those defined in &xep0065; and &xep0047;.</p>
<p>To initiate an out-of-band file transfer with an intended recipient using the 'jabber:iq:oob' namespace (whether or not negotiated via &xep0096;), the sending application sends an &IQ; of type 'set' to the recipient containing a &QUERY; child element qualified by the 'jabber:iq:oob' namespace; the &QUERY; MUST in turn contain a <url/> child specifying the URL of the file to be transferred, and MAY contain an optional <desc/> child describing the file. This usage is shown in the following example.</p>
<example caption="Sender Initiates Request-Response"><![CDATA[
<iq type='set'
from='[email protected]/work'
to='[email protected]/home'
id='oob1'>
<query xmlns='jabber:iq:oob'>
<url>http://www.jabber.org/images/psa-license.jpg</url>
<desc>A license to Jabber!</desc>
</query>
</iq>
]]></example>
<p>The expected result is for the recipient to retrieve the file via an HTTP GET request and to then inform the sender of successful receipt of the file. The receiving application MUST NOT send the IQ result until it has retrieved the complete file (e.g., it MUST NOT send the IQ result if it has merely attempted to retrieve the file or the URL provided seems to be valid):</p>
<example caption="Recipient Informs Sender of Success"><![CDATA[
<iq type='result'
from='[email protected]/home'
to='[email protected]/work'
id='oob1'/>
]]></example>
<p>If the recipient attempts to retrieve the file but is unable to do so, the receiving application MUST return an &IQ; of type 'error' to the sender specifying a Not Found condition:</p>
<example caption="Recipient Informs Sender of Failure"><![CDATA[
<iq type='error'
from='[email protected]/home'
to='[email protected]/work'
id='oob1'>
<query xmlns='jabber:iq:oob'>
<url>http://www.jabber.org/images/psa-license.jpg</url>
<desc>A license to Jabber!</desc>
</query>
<error code='404' type='cancel'>
<item-not-found xmlns='urn:ietf:params:xml:ns:xmpp-stanzas'/>
</error>
</iq>
]]></example>
<p>If the recipient rejects the request outright, the receiving application MUST return an &IQ; of type 'error' to the sender specifying a Not Acceptable condition:</p>
<example caption="Recipient Rejects Request"><![CDATA[
<iq type='error'
from='[email protected]/home'
to='[email protected]/work'
id='oob1'>
<query xmlns='jabber:iq:oob'>
<url>http://www.jabber.org/images/psa-license.jpg</url>
<desc>A license to Jabber!</desc>
</query>
<error code='406' type='modify'>
<not-acceptable xmlns='urn:ietf:params:xml:ns:xmpp-stanzas'/>
</error>
</iq>
]]></example>
</section1>
<section1 topic='jabber:x:oob' anchor='x-oob'>
<p>The 'jabber:x:oob' namespace is used to communicate a URI to another user or application. This is done by including an &X; child element qualified by the 'jabber:x:oob' namespace in either a &MESSAGE; and &PRESENCE; stanza; the &X; child MUST contain a <url/> child specifying the URL of the resource, and MAY contain an optional <desc/> child describing the resource.</p>
<example caption="Sender Communicates a URI"><![CDATA[
<message from='[email protected]/work'
to='[email protected]/home'>
<body>Yeah, but do you have a license to Jabber?</body>
<x xmlns='jabber:x:oob'>
<url>http://www.jabber.org/images/psa-license.jpg</url>
</x>
</message>
]]></example>
</section1>
<section1 topic='Determining Support' anchor='disco'>
<p>If an entity supports the out of band data protocol, it MUST report that by including a service discovery feature of "jabber:iq:oob" and/or "jabber:x:oob" in response to a &xep0030; information request:</p>
<example caption="Service Discovery information request"><![CDATA[
<iq type='get'
from='[email protected]/balcony'
to='[email protected]/orchard'
id='disco1'>
<query xmlns='http://jabber.org/protocol/disco#info'/>
</iq>
]]></example>
<example caption="Service Discovery information response"><![CDATA[
<iq type='result'
from='[email protected]/orchard'
to='[email protected]/balcony'
id='disco1'>
<query xmlns='http://jabber.org/protocol/disco#info'>
...
<feature var='jabber:iq:oob'/>
<feature var='jabber:x:oob'/>
...
</query>
</iq>
]]></example>
</section1>
<section1 topic='Use With Non-HTTP URI Schemes' anchor='nonhttp'>
<p>The value of the <url/> element is not limited to URIs that conform to the http: URI scheme (as specified by &rfc2616;). For example, file transfers could also be effected using ftp: URIs as (specified by &rfc0959;). Going further afield, several existing Jabber clients use the callto: URI scheme to initiate voice conferencing via NetMeeting or GnomeMeeting. Other out-of-band communications could be initiated in a similar way via URI schemes such as sip: (as specified by &rfc3261;). All of these usages are allowed by the existing OOB namespaces, as long as the value of the <url/> element is a valid URI (as specified by &rfc3986;).</p>
</section1>
<section1 topic='Integration With Stream Initiation' anchor='si'>
<p><em>This section is non-normative.</em></p>
<p>&xep0095; defines methods for negotiating content streams between any two entities, and XEP-0096 defines a profile of stream initiation for file transfer. Although the use of jabber:iq:oob is not recommended by XEP-0096, it could be offered as one option (e.g., a fallback if SOCKS5 Bytestreams and In-Band Bytestreams are not available). If so, the value of the feature negotiation option MUST be "jabber:iq:oob" and the &QUERY; element within the &IQ; stanza qualified by the 'jabber:iq:oob' namespace MUST possess a 'sid' attribute whose value is the StreamID negotiated by stream initiation.</p>
<p>A sample protocol flow is shown below.</p>
<example caption='Stream Initiation Offer'>
<![CDATA[
<iq type='set'
from='[email protected]/orchard'
to='[email protected]/chamber'
id='offer1'>
<si xmlns='http://jabber.org/protocol/si'
id='a0'
mime-type='text/plain'
profile='http://jabber.org/protocol/si/profile/file-transfer'>
<file xmlns='http://jabber.org/protocol/si/profile/file-transfer'
name='test.txt'
size='1022'/>
<feature xmlns='http://jabber.org/protocol/feature-neg'>
<x xmlns='jabber:x:data' type='form'>
<field var='stream-method' type='list-single'>
<option><value>http://jabber.org/protocol/bytestreams</value></option>
<option><value>http://jabber.org/protocol/ibb</value></option>
<option><value>jabber:iq:oob</value></option>
</field>
</x>
</feature>
</si>
</iq>
]]>
</example>
<example caption='Stream Initiation Result'>
<![CDATA[
<iq type='result'
from='[email protected]/chamber'>
to='[email protected]/orchard'
id='offer1'>
<si xmlns='http://jabber.org/protocol/si'
id='a0'
profile='http://jabber.org/protocol/si/profile/file-transfer'>
<feature xmlns='http://jabber.org/protocol/feature-neg'>
<x xmlns='jabber:x:data' type='submit'>
<field var='stream-method'>
<value>jabber:iq:oob</value>
</field>
</x>
</feature>
</si>
</iq>
]]>
</example>
<example caption="Sender Initiates Request-Response"><![CDATA[
<iq type='set'
from='[email protected]/orchard'
to='[email protected]/chamber'>
id='send1'>
<query xmlns='jabber:iq:oob'
sid='a0'>
<url>http://www.shakespeare.lit/files/letter.txt</url>
</query>
</iq>
]]></example>
<example caption="Recipient Informs Sender of Success"><![CDATA[
<iq type='result'
from='[email protected]/chamber'
to='[email protected]/orchard'
id='send1'/>
]]></example>
</section1>
<section1 topic='Security Considerations' anchor='security'>
<p>As with any mechanism that communicates a URI, care must be taken by the receiving application to ensure that the resource retrieved does not contain harmful or malicious data (e.g., a virus-infected file).</p>
</section1>
<section1 topic='IANA Considerations' anchor='iana'>
<p>This document requires no interaction with &IANA;.</p>
</section1>
<section1 topic='XMPP Registrar Considerations' anchor='registrar'>
<p>The 'jabber:iq:oob' and 'jabber:x:oob' namespaces are included in the protocol namespaces registry maintained by the ®ISTRAR; (see &NAMESPACES;).</p>
</section1>
<section1 topic='XML Schemas' anchor='schemas'>
<section2 topic='jabber:iq:oob' anchor='schemas-iq'>
<code><![CDATA[
<?xml version='1.0' encoding='UTF-8'?>
<xs:schema
xmlns:xs='http://www.w3.org/2001/XMLSchema'
targetNamespace='jabber:iq:oob'
xmlns='jabber:iq:oob'
elementFormDefault='qualified'>
<xs:annotation>
<xs:documentation>
The protocol documented by this schema is defined in
XEP-0066: http://www.xmpp.org/extensions/xep-0066.html
</xs:documentation>
</xs:annotation>
<xs:element name='query'>
<xs:complexType>
<xs:sequence>
<xs:element name='url' type='xs:string' minOccurs='1'/>
<xs:element name='desc' type='xs:string' minOccurs='0'/>
</xs:sequence>
<xs:attribute name='sid' type='xs:string' use='optional'/>
</xs:complexType>
</xs:element>
</xs:schema>
]]></code>
</section2>
<section2 topic='jabber:x:oob' anchor='schemas-x'>
<code><![CDATA[
<?xml version='1.0' encoding='UTF-8'?>
<xs:schema
xmlns:xs='http://www.w3.org/2001/XMLSchema'
targetNamespace='jabber:x:oob'
xmlns='jabber:x:oob'
elementFormDefault='qualified'>
<xs:annotation>
<xs:documentation>
The protocol documented by this schema is defined in
XEP-0066: http://www.xmpp.org/extensions/xep-0066.html
</xs:documentation>
</xs:annotation>
<xs:element name='x'>
<xs:complexType>
<xs:sequence>
<xs:element name='url' type='xs:string' minOccurs='1'/>
<xs:element name='desc' type='xs:string' minOccurs='0'/>
</xs:sequence>
</xs:complexType>
</xs:element>
</xs:schema>
]]></code>
</section2>
</section1>
</xep>