XEP-0359 v0.1: Unique and Stable Stanza IDs

This commit is contained in:
Matthew A. Miller 2015-07-14 10:09:23 -06:00
parent 79b3628e88
commit e3050ef2b8
3 changed files with 126 additions and 108 deletions

View File

@ -1,108 +0,0 @@
<?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 message IDs</title>
<abstract>This specification describes unique and stable IDs for message stanzas.</abstract>
<legal>
<copyright>This XMPP Extension Protocol is copyright (c) 1999 - 2014 by the XMPP Standards Foundation (XSF).</copyright>
<permissions>Permission is hereby granted, free of charge, to any person obtaining a copy of this specification (the &quot;Specification&quot;), to make use of the Specification without restriction, including without limitation the rights to implement the Specification in a software program, deploy the Specification in a network service, and copy, modify, merge, publish, translate, distribute, sublicense, or sell copies of the Specification, and to permit persons to whom the Specification is furnished to do so, subject to the condition that the foregoing copyright notice and this permission notice shall be included in all copies or substantial portions of the Specification. Unless separate permission is granted, modified works that are redistributed shall not contain misleading information regarding the authors, title, number, or publisher of the Specification, and shall not claim endorsement of the modified works by the authors, any organization or project to which the authors belong, or the XMPP Standards Foundation.</permissions>
<warranty>## NOTE WELL: This Specification is provided on an &quot;AS IS&quot; BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, express or implied, including, without limitation, any warranties or conditions of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A PARTICULAR PURPOSE. In no event shall the XMPP Standards Foundation or the authors of this Specification be liable for any claim, damages, or other liability, whether in an action of contract, tort, or otherwise, arising from, out of, or in connection with the Specification or the implementation, deployment, or other use of the Specification. ##</warranty>
<liability>In no event and under no legal theory, whether in tort (including negligence), contract, or otherwise, unless required by applicable law (such as deliberate and grossly negligent acts) or agreed to in writing, shall the XMPP Standards Foundation or any author of this Specification be liable for damages, including any direct, indirect, special, incidental, or consequential damages of any character arising out of the use or inability to use the Specification (including but not limited to damages for loss of goodwill, work stoppage, computer failure or malfunction, or any and all other commercial damages or losses), even if the XMPP Standards Foundation or such author has been advised of the possibility of such damages.</liability>
<conformance>This XMPP Extension Protocol has been contributed in full conformance with the XSF's Intellectual Property Rights Policy (a copy of which may be found at &lt;<link url='http://xmpp.org/extensions/ipr-policy.shtml'>http://xmpp.org/extensions/ipr-policy.shtml</link>&gt; or obtained by writing to XSF, P.O. Box 1641, Denver, CO 80201 USA).</conformance>
</legal>
<number>xxxx</number>
<status>ProtoXEP</status>
<type>Standards Track</type>
<sig>Standards</sig>
<approver>Council</approver>
<dependencies>
<spec>XMPP Core</spec>
</dependencies>
<supersedes/>
<supersededby/>
<shortname>NOT_YET_ASSIGNED (suggested: mid)</shortname>
<author>
<firstname>Florian</firstname>
<surname>Schmaus</surname>
<email>flo@geekplace.eu</email>
<jid>flo@geekplace.eu</jid>
</author>
<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 message 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, to identify a message reflected by a MUC service back to the originating entity. And they could be used together with &xep0280;, so that clients are able to retrieve the archive starting from a given message.</p>
</section1>
<section1 topic='Requirements' anchor='reqs'>
<p>The herein defined messages 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 message IDs' anchor='message-id'>
<example caption='The message ID extension.'><![CDATA[
<message-id xmlns='urn:xmpp:mid:0' id='de305d54-75b4-431b-adb2-eb6b9e546013'/>
]]></example>
The service generates the value of the id attribute. The value must be service local unique and stable, i.e. it MUST NOT change later for some reason. It is RECOMMENDED that the id generating service uses UUID (RFC 4122) to generate the IDs.
</section2>
<section2 topic='Client generated message IDs' anchor='client-id'>
<p>
Some use cases require the client to generate the message ID. In this case, the client MUST use "client-id" as attribute name for the ID.
</p>
<example caption='A message stanza with the message ID extension.'><![CDATA[
<message xmlns='jabber:client'
to='room@muc.example.org'
type='groupchat'>
<body>Typical body text</body>
<message-id xmlns='urn:xmpp:mid:0' client-id='de305d54-75b4-431b-adb2-eb6b9e546013'/>
</message>]]></example>
<p>
The server MAY add an 'id' attribute to the message-id element. In that case, it MUST preserve the content of the 'client-id' attribute.
</p>
<example caption='A message stanza with the message ID extension.'><![CDATA[
<message xmlns='jabber:client'
to='room@muc.example.org'
type='groupchat'>
<body>Typical body text</body>
<message-id xmlns='urn:xmpp:mid:0'
id='new-id-overrides-client-id'
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 the message-id element from message stanzas.</li>
<li>The values of the 'id' attribute SHOULD be unpredictable.</li>
<li>Message ID generating entities, which encounter a &lt;message-id/&gt; element where 'id' and 'client-id' is already set, MUST ignore the existing value of 'id' and override it.</li>
<li>&MESSAGE; stanzas MUST posses at most one 'message-id' extension element in the direct child level of the stanza.</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.</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:mid: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>

125
xep-0359.xml Normal file
View File

@ -0,0 +1,125 @@
<?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>

View File

@ -1339,3 +1339,4 @@ IANA Service Location Protocol, Version 2 (SLPv2) Templates</link></span> <note>
<!ENTITY xep0356 "<span class='ref'><link url='http://xmpp.org/extensions/xep-0356.html'>Privileged Entity (XEP-0356)</link></span> <note>XEP-0356: Privileged Entity &lt;<link url='http://xmpp.org/extensions/xep-0356.html'>http://xmpp.org/extensions/xep-0356.html</link>&gt;.</note>" >
<!ENTITY xep0357 "<span class='ref'><link url='http://xmpp.org/extensions/xep-0357.html'>Push (XEP-0357)</link></span> <note>XEP-0357: Push &lt;<link url='http://xmpp.org/extensions/xep-0357.html'>http://xmpp.org/extensions/xep-0357.html</link>&gt;.</note>" >
<!ENTITY xep0358 "<span class='ref'><link url='http://xmpp.org/extensions/xep-0358.html'>Publishing Available Jingle Sessions (XEP-0358)</link></span> <note>XEP-0358: Publishing Available Jingle Sessions &lt;<link url='http://xmpp.org/extensions/xep-0358.html'>http://xmpp.org/extensions/xep-0358.html</link>&gt;.</note>" >
<!ENTITY xep0359 "<span class='ref'><link url='http://xmpp.org/extensions/xep-0359.html'>Unique and Stable Stanza IDs (XEP-0359)</link></span> <note>XEP-0359: Unique and Stable Stanza IDs &lt;<link url='http://xmpp.org/extensions/xep-0359.html'>http://xmpp.org/extensions/xep-0359.html</link>&gt;.</note>" >