xeps/xep-0359.xml

126 lines
5.9 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>Unique and Stable Stanza IDs</title>
<abstract>This specification describes unique and stable IDs for stanzas.</abstract>
&LEGALNOTICE;
<number>0359</number>
<status>Experimental</status>
<type>Standards Track</type>
<sig>Standards</sig>
<approver>Council</approver>
<dependencies>
<spec>XMPP Core</spec>
</dependencies>
<supersedes/>
<supersededby/>
<shortname>NOT_YET_ASSIGNED (suggested: sid)</shortname>
<author>
<firstname>Florian</firstname>
<surname>Schmaus</surname>
<email>flo@geekplace.eu</email>
<jid>flo@geekplace.eu</jid>
</author>
<revision>
<version>0.1</version>
<date>2015-07-14</date>
<initials>XEP Editor (mam)</initials>
<remark><p>Initial published version approved by the XMPP Council.</p></remark>
</revision>
<revision>
<version>0.0.2</version>
<date>2015-06-22</date>
<initials>fs</initials>
<remark>
<ul>
<li>Rename the XEP from "Message IDs" to "Stanza IDs"</li>
<li>Add 'by' attribute</li>
</ul>
</remark>
</revision>
<revision>
<version>0.0.1</version>
<date>2015-06-01</date>
<initials>fs</initials>
<remark><p>First draft.</p></remark>
</revision>
</header>
<section1 topic='Introduction' anchor='intro'>
<p>Unique and stable IDs for stanzas, which are set by a XMPP service, are beneficial in various ways. They can be used together with &xep0313; to uniquely identify a message within an archive. They are also useful in the context of &xep0045; conferences, in order to identify a message reflected by a MUC service back to the originating entity.</p>
</section1>
<section1 topic='Requirements' anchor='reqs'>
<p>The herein defined stanza IDs must be unique and stable within the scope of the generating XMPP entity.</p>
</section1>
<section1 topic='Use Cases' anchor='usecases'>
<section2 topic='Unique stanza IDs' anchor='stanza-id'>
<example caption='The stanza ID extension.'><![CDATA[
<stanza-id xmlns='urn:xmpp:sid:0'
id='de305d54-75b4-431b-adb2-eb6b9e546013'
by='room@muc.xmpp.org'/>
]]></example>
In order to create a 'stanza-id' extension, the creating XMPP entity generates and sets the value of the 'id' attribute, and puts its own JID as value of the 'by' attribute. The value of the 'id' attribute must be unique and stable, i.e. it MUST NOT change later for some reason, within the scope of the 'by' value. Thus the IDs defined in this extension MUST be unique and stable within the scope of the generating XMPP entity. It is RECOMMENDED that the ID generating service uses UUID and the algorithm defined in RFC 4122, to generate the IDs.
</section2>
<section2 topic='Client generated stanza IDs' anchor='client-id'>
<p>
Some use cases require the client to generate the stanza ID. In this case, the client MUST use 'client-id' as attribute name for the ID.
</p>
<example caption='A message stanza with the stanza ID extension.'><![CDATA[
<message xmlns='jabber:client'
to='room@muc.example.org'
type='groupchat'>
<body>Typical body text</body>
<stanza-id xmlns='urn:xmpp:sid:0' client-id='de305d54-75b4-431b-adb2-eb6b9e546013'/>
</message>]]></example>
<p>
The server MAY add an 'id' attribute to the stanza-id element. In that case, it MUST preserve the content of the 'client-id' attribute.
</p>
<example caption='A message stanza with the stanza ID extension.'><![CDATA[
<message xmlns='jabber:client'
to='room@muc.example.org'
type='groupchat'>
<body>Typical body text</body>
<stanza-id xmlns='urn:xmpp:sid:0'
id='new-id-overrides-client-id'
by='room@muc.example.org'
client-id='de305d54-75b4-431b-adb2-eb6b9e546013'/>
</message>]]></example>
<p>
Otherwise, if the server does not override the ID, it MAY omit the 'client-id' attribute.
</p>
</section2>
</section1>
<section1 topic='Business Rules' anchor='rules'>
<ol>
<li>XMPP entities, which are routing stanzas, MUST NOT strip stanza-id elements from message stanzas.</li>
<li>The values of the 'id' (and 'client-id') attribute SHOULD be unpredictable.</li>
<li>Stanza ID generating entities, which encounter a &lt;stanza-id/&gt; element where 'id' (and 'client-id') is already set and where the 'by' attribute matches their own JID, MUST ignore the existing value of 'id' and override it.</li>
<li>Stanzas MUST posses, in the direct child level of the stanza, at most one 'stanza-id' extension element with the same JID as value of the 'by' attribute.</li>
<li>Stanza ID extension elements which have a 'id' attribute MUST also have the 'by' attribute set.</li>
<li>Stanza ID extension elements MUST either posses a 'id' attribute, a 'client-id' attribute or both.</li>
<li>The value of the 'by' attribute MUST be a normalized JID as defined in &rfc6122;</li>
</ol>
</section1>
<section1 topic='Security Considerations' anchor='security'>
<p>The value of the 'id' attribute should not provide any further information besides the opaque ID itself. Entities observing the value MUST NOT be able to infer any information from it, e.g. the size of the message archive. The value of 'id' and 'client-id' MUST be considered as non-secret values.</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>The &REGISTRAR; includes "urn:xmpp:sid:0" in its registry of protocol namespaces (see &NAMESPACES;).</p>
</section2>
</section1>
<section1 topic='XML Schema' anchor='schema'>
<p>REQUIRED for protocol specifications.</p>
</section1>
<section1 topic='Acknowledgements' anchor='ack'>
<p>Thanks to Thijs Alkemade and Georg Lukas for providing feedback.</p>
</section1>
</xep>