1
0
mirror of https://github.com/moparisthebest/xeps synced 2024-11-10 03:15:00 -05:00
xeps/xep-0231.xml
Peter Saint-Andre 8cf8cce8dc typo
git-svn-id: file:///home/ksmith/gitmigration/svn/xmpp/trunk@1623 4b5297f7-1745-476d-ba37-a9c6900126ab
2008-01-30 21:15:21 +00:00

425 lines
25 KiB
XML

<?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>Data Element</title>
<abstract>This specification defines an XMPP protocol extension for including small bits of binary data in an XML stanza.</abstract>
&LEGALNOTICE;
<number>0231</number>
<status>Experimental</status>
<type>Standards Track</type>
<sig>Standards</sig>
<approver>Council</approver>
<dependencies>
<spec>XMPP Core</spec>
<spec>RFC 2045</spec>
<spec>RFC 2111</spec>
<spec>RFC 4648</spec>
</dependencies>
<supersedes/>
<supersededby/>
<shortname>NOT YET ASSIGNED</shortname>
&stpeter;
<revision>
<version>0.1</version>
<date>2008-01-30</date>
<initials>psa</initials>
<remark><p>Initial published version.</p></remark>
</revision>
<revision>
<version>0.0.4</version>
<date>2008-01-29</date>
<initials>psa</initials>
<remark><p>Separately described service discovery feature for inclusion of the data element in file previews.</p></remark>
</revision>
<revision>
<version>0.0.3</version>
<date>2007-12-27</date>
<initials>psa</initials>
<remark><p>Described use cases for previewing data to be exchanged in file transfers and for inclusion of media information in data forms.</p></remark>
</revision>
<revision>
<version>0.0.2</version>
<date>2007-12-18</date>
<initials>psa</initials>
<remark><p>Changed syntax to not use data: URL scheme; added cid and type attributes; described use cases for messaging and data retrieval.</p></remark>
</revision>
<revision>
<version>0.0.1</version>
<date>2007-11-09</date>
<initials>psa</initials>
<remark><p>First draft.</p></remark>
</revision>
</header>
<section1 topic='Introduction' anchor='intro'>
<p>Sometimes it is desirable to include a small bit of binary data in an XMPP stanza. Typical use cases might be inclusion of an icon or emoticon in a message, a thumbnail in a file transfer request, a rasterized image in a whiteboarding session, or a small bit of media in a data form. At present, there is no lightweight method for including such data in an XMPP stanza, since existing methods (e.g., &xep0047;) are designed for larger blobs of data and therefore require some form of negotiation (e.g., via &xep0096; or &xep0166;). Therefore, this document specifies just such a lightweight method, using a &lt;data/&gt; element that provides semantics similar to the data: URL scheme defined in &rfc2397;.</p>
</section1>
<section1 topic='Format' anchor='format'>
<p>The format for including binary data is straightforward: the data is encapsulated as the XML character data of a &lt;data/&gt; element, where the data MUST be encoded as Base64 in accordance with Section 4 of &rfc4648; (note: the Base64 output MUST NOT include whitespace and MUST set the number of pad bits to zero).</p>
<p>The &lt;data/&gt; element SHOULD be used only to encapsulate small bits of binary data and SHOULD NOT be used for large data transfers. Naturally the definition of "small" and "large" is rather loose. In general, it is recommended that the data should not be more than 4 kilobytes and that dedicated file transfer methods should be used for exchanging blobs of data larger than 4 kilobytes. Naturally, implementations or deployments may impose their own limits.</p>
<p>The following attributes are defined for the &lt;data/&gt; element.</p>
<table caption='Defined Attributes'>
<tr>
<th>Attribute</th>
<th>Description</th>
<th>Inclusion</th>
</tr>
<tr>
<td>alt</td>
<td>A human-readable description of the data.</td>
<td>RECOMMENDED</td>
</tr>
<tr>
<td>cid</td>
<td>A Content-ID that can be mapped to a cid: URL as specified in &rfc2111;.</td>
<td>RECOMMENDED</td>
</tr>
<tr>
<td>type</td>
<td>The MIME type of the data (e.g., "image/png") as described in &rfc2045;.</td>
<td>REQUIRED</td>
</tr>
</table>
<p>The following example illustrates the format (line endings are provided for readability only).</p>
<example caption='Data element format'><![CDATA[
<data xmlns='urn:xmpp:tmp:data-element'
alt='A spot'
cid='f81d4fae-7dec-11d0-a765-00a0c91e6bf6@shakespeare.lit'
type='image/png'>
iVBORw0KGgoAAAANSUhEUgAAAAoAAAAKCAYAAACNMs+9AAAABGdBTUEAALGP
C/xhBQAAAAlwSFlzAAALEwAACxMBAJqcGAAAAAd0SU1FB9YGARc5KB0XV+IA
AAAddEVYdENvbW1lbnQAQ3JlYXRlZCB3aXRoIFRoZSBHSU1Q72QlbgAAAF1J
REFUGNO9zL0NglAAxPEfdLTs4BZM4DIO4C7OwQg2JoQ9LE1exdlYvBBeZ7jq
ch9//q1uH4TLzw4d6+ErXMMcXuHWxId3KOETnnXXV6MJpcq2MLaI97CER3N0
vr4MkhoXe0rZigAAAABJRU5ErkJggg==
</data>
]]></example>
</section1>
<section1 topic='Use Cases' anchor='usecases'>
<section2 topic='Messaging' anchor='message'>
<p>The &lt;data/&gt; element can be used in conjunction with &xep0071; and the cid: URL scheme to point to binary data that is provided in-band within a &MESSAGE; stanza.</p>
<example caption='A message with included data'><![CDATA[
<message from='ladymacbeth@shakespeare.lit/castle'
to='macbeth@chat.shakespeare.lit'
type='groupchat'>
<body>Yet here's a spot.</body>
<html xmlns='http://jabber.org/protocol/xhtml-im'>
<body xmlns='http://www.w3.org/1999/xhtml'>
<p>
Yet here's a spot.
<img alt='A spot'
src='cid:f81d4fae-7dec-11d0-a765-00a0c91e6bf6@shakespeare.lit'/>
</p>
</body>
</html>
<data xmlns='urn:xmpp:tmp:data-element'
alt='A spot'
cid='f81d4fae-7dec-11d0-a765-00a0c91e6bf6@shakespeare.lit'
type='image/png'>
iVBORw0KGgoAAAANSUhEUgAAAAoAAAAKCAYAAACNMs+9AAAABGdBTUEAALGP
C/xhBQAAAAlwSFlzAAALEwAACxMBAJqcGAAAAAd0SU1FB9YGARc5KB0XV+IA
AAAddEVYdENvbW1lbnQAQ3JlYXRlZCB3aXRoIFRoZSBHSU1Q72QlbgAAAF1J
REFUGNO9zL0NglAAxPEfdLTs4BZM4DIO4C7OwQg2JoQ9LE1exdlYvBBeZ7jq
ch9//q1uH4TLzw4d6+ErXMMcXuHWxId3KOETnnXXV6MJpcq2MLaI97CER3N0
vr4MkhoXe0rZigAAAABJRU5ErkJggg==
</data>
</message>
]]></example>
<p>Once the data is provided, a subsequent message in the same session can refer to the data again without including it.</p>
<example caption='A message with referenced data'><![CDATA[
<message from='ladymacbeth@shakespeare.lit/castle'
to='macbeth@chat.shakespeare.lit'
type='groupchat'>
<body>Out, damned spot!</body>
<html xmlns='http://jabber.org/protocol/xhtml-im'>
<body xmlns='http://www.w3.org/1999/xhtml'>
<p>
Out damned spot!
<img alt='A spot'
src='cid:f81d4fae-7dec-11d0-a765-00a0c91e6bf6@shakespeare.lit'/>
</p>
</body>
</html>
</message>
]]></example>
<p>If the receiving entity has not cached the data, it can request the data as described in the next section.</p>
</section2>
<section2 topic='Retrieving Data' anchor='retrieve'>
<p>Data can be requested and transferred using the XMPP &IQ; stanza type by making reference to the 'cid' of the data to be retrieved. In particular, the requesting entity can request data by sending an IQ-get containing an empty &lt;data/&gt; element with a 'cid' attribute.</p>
<example caption='Requesting data'><![CDATA[
<iq from='doctor@shakespeare.lit/pda'
id='get-data-1'
to='gentlewoman@shakespeare.lit/phone'
type='get'>
<data xmlns='urn:xmpp:tmp:data-element'
cid='f81d4fae-7dec-11d0-a765-00a0c91e6bf6@shakespeare.lit'/>
</iq>
]]></example>
<p>The responding entity then would either return an error (e.g., &notfound; if it does not have data matching the Content-ID) or return the data.</p>
<example caption='Returning data'><![CDATA[
<iq from='gentlewoman@shakespeare.lit/phone'
id='get-data-1'
to='doctor@shakespeare.lit/pda'
type='result'>
<data xmlns='urn:xmpp:tmp:data-element'
alt='A spot'
cid='f81d4fae-7dec-11d0-a765-00a0c91e6bf6@shakespeare.lit'
type='image/png'>
iVBORw0KGgoAAAANSUhEUgAAAAoAAAAKCAYAAACNMs+9AAAABGdBTUEAALGP
C/xhBQAAAAlwSFlzAAALEwAACxMBAJqcGAAAAAd0SU1FB9YGARc5KB0XV+IA
AAAddEVYdENvbW1lbnQAQ3JlYXRlZCB3aXRoIFRoZSBHSU1Q72QlbgAAAF1J
REFUGNO9zL0NglAAxPEfdLTs4BZM4DIO4C7OwQg2JoQ9LE1exdlYvBBeZ7jq
ch9//q1uH4TLzw4d6+ErXMMcXuHWxId3KOETnnXXV6MJpcq2MLaI97CER3N0
vr4MkhoXe0rZigAAAABJRU5ErkJggg==
</data>
</iq>
]]></example>
<p>This specification does not place limits on the entities from which data can be requested. In particular, such an entity need not be the "owner" of the data (e.g., it could be a peer in a chatroom or whiteboarding session).</p>
<p>In addition, bits of data could be hosted by XMPP servers, distributed via &xep0060; nodes, or included in data collections that are available via HTTP (e.g., emoticon sets). Such data could be identified by the value of the 'cid' attribute, but methods for specifying those values are out of scope for this specification.</p>
</section2>
<section2 topic='Data Form' anchor='form'>
<p>&xep0221; describes how to include a media element in &xep0004;, e.g. for the purpose of placing a human-viewable "CAPTCHA" in a form that is used for &xep0158; or &xep0077;. The &lt;media/&gt; element described in <cite>XEP-0221</cite> contains one or more &lt;uri/&gt; elements (which point to locations where the media can be downloaded, e.g. via HTTP) as well as a &lt;data/&gt; element that includes the data itself. The proposed &lt;media/&gt; element could be redefined to contain a &lt;data/&gt; element as described herein and shown in the following example.</p>
<example caption='Audio Media Element'><![CDATA[
<media xmlns='http://www.xmpp.org/extensions/xep-0221.html#ns'>
<uri type='audio/x-wav'>http://victim.example.com/challenges/speech.wav?F3A6292C</uri>
<uri type='audio/ogg-speex'>http://victim.example.com/challenges/speech.ogg?F3A6292C</uri>
<uri type='audio/mpeg'>http://victim.example.com/challenges/speech.mp3?F3A6292C</uri>
<data xmlns='urn:xmpp:tmp:data-element'
alt='An audio file'
type='audio/x-wav'>
[ ... base64-encoded-audio ... ]
</data>
</media>
]]></example>
<p>The media could then be included in a data form.</p>
</section2>
<section2 topic='File Transfer Preview' anchor='preview'>
<p>A previous proposal <note>See &lt;<link url='http://www.xmpp.org/extensions/inbox/file-preview.html'>http://www.xmpp.org/extensions/inbox/file-preview.html</link>&gt;.</note> described a method for including a thumbnail or file preview in a file transfer request. Such a preview can be included using the &lt;data/&gt; element, as shown below. However, a preview SHOULD not be included unless the receiving entity advertises (via &xep0030; or &xep0115;) support for the "urn:xmpp:tmp:file-preview" service discovery feature &NSNOTE;.</p>
<example caption='File transfer offer with preview'><![CDATA[
<iq from='romeo@montague.lit/home'
id='offer1'
to='juliet@capulet.com/chamber'
type='set'>
<si xmlns='http://jabber.org/protocol/si'
profile='http://jabber.org/protocol/si/profile/file-transfer'
id='s5b_46e78e4a0ddacc74' >
<file xmlns='http://jabber.org/protocol/si/profile/file-transfer'
size='330527'
name='image.png'>
<data xmlns='urn:xmpp:tmp:data-element'
alt='There be dragons!'
type='image/png'>
iVBORw0KGgoAAAANSUhEUgAAADkAAABACAIAAAAvV0jbAAAACXBIWXMAAA4mAAAOJgGi7yX8AAAc
SUlEQVRogX2aeYwlx33fv31V39d78+Y+d/a+eZMizcukKFlmTB2GEcmypQSJ7SBSnAOG4QAJEhix
EwSxFSeODAVQIimCLFFWRMmRTCuUKFKiKJJ78Nhd7uzu3Oeb9/q+r/xRs29HKyCNQaO6uqr68/vW
7/frqp7H/KPf+gdFkgqyVCQpbh6CLJV1yLMavRxKik1UjFgOamiXQXvXcyzTVmTR63v762lHOiAd
f3B38LgoT0I/Hhlq01uu52i6EAaFSuQoT1QiA9je7Y0MtdkiScfADZ49GItntbIO6Yi7ssCIZZPx
txkzuLRMG0CcZPtBiyTdErMBqCBL+xWJ8oQRS0GWKM2gI70cnAVZivJEM5QoT9jBs2+TqkjS/Sry
rEbvnjlzEkBZhxSdEhdJOigMynQeGLEcaL9fUWrem9de/9jHfnNQ6XoO7UURozwpknTAzVLZaNPb
3ODny0WSLlxdeM999xtqW5AlRRapPYIs0Xmg4vGsNjB1MBsUbv9oDz/wxJ985guO71LDyjq0TJv2
pXCaLlBTKe4tXQVZMlvmbdD7iellnGSqbt519+n99YosAhjMA2P06bNx01voeTB1RZL+0gd+5fDR
Y7W/trR4nfai1tIy7cKz2mgmUoeJ8oQf0CiyGCfZz/Ptv1vWoaG2AejG+JNPPPXmxYuAEycZvfXw
/Q+6+QoA1nbsFtleCohRMM0sYL59bjEJr0nZaepFd5y9RxVJlOVJIFx6+20Kqsii108LpPTyZqhI
SCqqK3fHnUdYhgAoygqAbqh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hAT2u0m+0VXYmD
eL9vAFAnRgyWbU+P9Fa2N1c3wywFMDcxSlFcx/2Pf/zHX/jKVwHMjkyrY+TogWPf/8EPD7em//yL
nx0aH/vyF78UpQXzja89SyOJBtN+H1CK7VgYoTrRmDNYGQC1hEpLuX8e9OcPeqtQMBuL68gKBdTd
JyCuIxvMz9DUaBmkl7bWXWfb5JSJ4VEAn//yl1VJ4KPAGzNH/ToZDGqwsp8lJut5tYksBUBBBVHi
RLFGT8hUAGGWappEG1Cd5ILZydIB934nCW+6mRCDkgk3LRqAAli4fmPh+g3aV9DEGPE6tg7IbQBR
5v4/R2f0swq2hnQAAAAASUVORK5CYII=
</data>
<range/>
</file>
<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>
</field>
</x>
</feature>
</si>
</iq>
]]></example>
</section2>
</section1>
<section1 topic='Security Considerations' anchor='security'>
<p>The ability to include arbitrary binary data implies that it is possible to send scripts, applets, images, and executable code, which may be potentially harmful. To reduce the risk of such exposure, an implementation MAY choose to not display or process such data but instead either completely ignore the data, show only the value of the 'alt' attribute, or prompt a human user for approval (either explicitly via user action or implicitly via a list of approved entities from whom the user will accept binary data without per-event approval).</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'>
<section2 topic='Protocol Namespaces' anchor='ns'>
<p>Until this specification advances to a status of Draft, its associated namespace shall be "urn:xmpp:tmp:data-element"; upon advancement of this specification, the &REGISTRAR; shall issue a permanent namespace in accordance with the process defined in Section 4 of &xep0053;.</p>
</section2>
<section2 topic='Service Discovery Features' anchor='registrar-features'>
<p>If an entity is willing to accept data elements in file transfer requests for the purpose of previewing the file to be sent, it SHOULD advertise support for the "urn:xmpp:tmp:file-preview" feature.</p>
<p>The registry submission is as follows.</p>
<code caption='Registry Submission'><![CDATA[
<var>
<name>urn:xmpp:tmp:file-preview</name>
<desc>Willingness to accept data elements to preview file transfers</desc>
<doc>XEP-0230</doc>
</var>
]]></code>
</section2>
</section1>
<section1 topic='XML Schema' anchor='schema'>
<code><![CDATA[
<?xml version='1.0' encoding='UTF-8'?>
<xs:schema
xmlns:xs='http://www.w3.org/2001/XMLSchema'
targetNamespace='urn:xmpp:tmp:data-element'
xmlns='urn:xmpp:tmp:data-element'
elementFormDefault='qualified'>
<xs:element name='data'>
<xs:complexType>
<xs:simpleContent>
<xs:extension base='xs:base64Binary'>
<xs:attribute name='alt' type='xs:string' use='optional'/>
<xs:attribute name='cid' type='xs:string' use='optional'/>
<xs:attribute name='type' type='xs:string' use='required'/>
</xs:extension>
</xs:simpleContent>
</xs:complexType>
</xs:element>
</xs:schema>
]]></code>
</section1>
<section1 topic='Acknowledgements' anchor='ack'>
<p>Thanks to Rachel Blackman, Dave Cridland, and Tomasz Sterna for their feedback.</p>
</section1>
</xep>