1
0
mirror of https://github.com/moparisthebest/xeps synced 2024-11-28 04:02:20 -05:00

Bump XEP-0359 ("Stanza IDs)" to 0.3

Rename client-id element to origin-id and miscellaneous minor
improvements.
This commit is contained in:
Florian Schmaus 2016-10-27 16:40:26 +02:00
parent 28d98ee78f
commit 037c758021

View File

@ -1,5 +1,7 @@
<?xml version='1.0' encoding='UTF-8'?> <?xml version='1.0' encoding='UTF-8'?>
<!DOCTYPE xep SYSTEM 'xep.dtd' [ <!DOCTYPE xep SYSTEM 'xep.dtd' [
<!ENTITY stanza-id "&lt;stanza-id/&gt;">
<!ENTITY origin-id "&lt;origin-id/&gt;">
<!ENTITY % ents SYSTEM 'xep.ent'> <!ENTITY % ents SYSTEM 'xep.ent'>
%ents; %ents;
]> ]>
@ -21,6 +23,15 @@
<supersededby/> <supersededby/>
<shortname>stanza-id</shortname> <shortname>stanza-id</shortname>
&flow; &flow;
<revision>
<version>0.3.0</version>
<date>2016-10-29</date>
<initials>fs</initials>
<remark>
<p>Rename client-id element to origin-id.</p>
<p>Minor improvements.</p>
</remark>
</revision>
<revision> <revision>
<version>0.2.1</version> <version>0.2.1</version>
<date>2015-09-22</date> <date>2015-09-22</date>
@ -66,10 +77,7 @@
</revision> </revision>
</header> </header>
<section1 topic='Introduction' anchor='intro'> <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> <p>This XEP introduces unique and stable IDs for stanzas, which are beneficial in various ways. For example, 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, as they allow 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>
<section1 topic='Use Cases' anchor='usecases'> <section1 topic='Use Cases' anchor='usecases'>
<section2 topic='Unique stanza IDs' anchor='stanza-id'> <section2 topic='Unique stanza IDs' anchor='stanza-id'>
@ -78,21 +86,21 @@
id='de305d54-75b4-431b-adb2-eb6b9e546013' id='de305d54-75b4-431b-adb2-eb6b9e546013'
by='room@muc.xmpp.org'/> by='room@muc.xmpp.org'/>
]]></example> ]]></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 XMPP address 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. In order to create a &stanza-id; extension element, the creating XMPP entity generates and sets the value of the 'id' attribute, and puts its own XMPP address 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 &rfc4122; to generate the IDs.
</section2> </section2>
<section2 topic='Client generated stanza IDs' anchor='client-id'> <section2 topic='Origin generated stanza IDs' anchor='origin-id'>
<p> <p>
Some use cases require the client to generate the stanza ID. In this case, the client MUST use the 'client-id' element. Some use cases require the originating entity, e.g. a client, to generate the stanza ID. In this case, the client MUST use the &origin-id; element extension element qualified by the 'urn:xmpp:sid:0' namespace. Note that originating entities often want to conceal their XMPP address and therefore the &origin-id; element has no 'by' attribute.
</p> </p>
<example caption='A message stanza with the stanza ID extension.'><![CDATA[ <example caption='A message stanza with the stanza ID extension.'><![CDATA[
<message xmlns='jabber:client' <message xmlns='jabber:client'
to='room@muc.example.org' to='room@muc.example.org'
type='groupchat'> type='groupchat'>
<body>Typical body text</body> <body>Typical body text</body>
<client-id xmlns='urn:xmpp:sid:0' id='de305d54-75b4-431b-adb2-eb6b9e546013'/> <origin-id xmlns='urn:xmpp:sid:0' id='de305d54-75b4-431b-adb2-eb6b9e546013'/>
</message>]]></example> </message>]]></example>
<p> <p>
The server or component MAY add a stanza-id element. In that case, it MUST preserve the content of the 'client-id' element. The server or component MAY add a &stanza-id; element. In that case, it MUST preserve the content of the &origin-id; element.
</p> </p>
<example caption='A message stanza with the stanza ID extension.'><![CDATA[ <example caption='A message stanza with the stanza ID extension.'><![CDATA[
<message xmlns='jabber:client' <message xmlns='jabber:client'
@ -102,7 +110,7 @@
<stanza-id xmlns='urn:xmpp:sid:0' <stanza-id xmlns='urn:xmpp:sid:0'
id='5f3dbc5e-e1d3-4077-a492-693f3769c7ad' id='5f3dbc5e-e1d3-4077-a492-693f3769c7ad'
by='room@muc.example.org'/> by='room@muc.example.org'/>
<client-id xmlns='urn:xmpp:sid:0' id='de305d54-75b4-431b-adb2-eb6b9e546013'/> <origin-id xmlns='urn:xmpp:sid:0' id='de305d54-75b4-431b-adb2-eb6b9e546013'/>
</message>]]></example> </message>]]></example>
</section2> </section2>
</section1> </section1>
@ -110,10 +118,10 @@
<ol> <ol>
<li>XMPP entities, which are routing stanzas, MUST NOT strip any elements qualified by the 'urn:xmpp:sid:0' namespace from message stanzas. They SHOULD however ensure that those elements contain only the attributes defined herein, and take appropriate countermeasures if this is not the case (e.g. removing those attributes).</li> <li>XMPP entities, which are routing stanzas, MUST NOT strip any elements qualified by the 'urn:xmpp:sid:0' namespace from message stanzas. They SHOULD however ensure that those elements contain only the attributes defined herein, and take appropriate countermeasures if this is not the case (e.g. removing those attributes).</li>
<li>The values of the 'id' attribute SHOULD be unpredictable.</li> <li>The values of the 'id' attribute SHOULD be unpredictable.</li>
<li>Stanza ID generating entities, which encounter a &lt;stanza-id/&gt; element where 'id' is already set and where the 'by' attribute matches their own XMPP address, MUST ignore the existing value of 'id' and override it.</li> <li>Stanza ID generating entities, which encounter a &stanza-id; element where 'id' is already set and where the 'by' attribute matches their own XMPP address, 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 XMPP address as value of the 'by' attribute.</li> <li>Stanzas MUST posses, in the direct child level of the stanza, at most one &stanza-id; extension element with the same XMPP address as value of the 'by' attribute.</li>
<li>Every &lt;stanza-id&gt; extension element MUST have the 'id' attribute and the 'by' attribute set.</li> <li>Every &stanza-id; extension element MUST have the 'id' attribute and the 'by' attribute set.</li>
<li>Every &lt;stanza-id&gt; and &lt;client-id&gt; extension element MUST always posses an 'id' attribute and MUST NOT have any child elements or text content.</li> <li>Every &stanza-id; and &origin-id; extension element MUST always posses an 'id' attribute and MUST NOT have any child elements or text content.</li>
<li>The value of the 'by' attribute MUST be the XMPP address of the entity assigning the unique and stable stanza ID. Note that XMPP addresses are normalized as defined in &rfc6122;</li> <li>The value of the 'by' attribute MUST be the XMPP address of the entity assigning the unique and stable stanza ID. Note that XMPP addresses are normalized as defined in &rfc6122;</li>
</ol> </ol>
</section1> </section1>