Browse Source

XEP-0359: clarifications and removed 'overwrite' wording

This commit changes some of the wording to clarify that the by attribute
for messages tagged by the server should be either the account jid or
the room jid (as opposed to the server jid for example)

To further clarify this the examples (including the disco example) were
all changed to have the same jid/by-attribute. (A room in that example)

The business rules had some wording that an entity would overwrite the
ID in existing 'faked' stanza-ids instead of removing the faked and
re-adding a non-faked one. However that doesn't work for faked messages
that are not archived (don't have a stanza-id).

This commit also makes the XEP explicitly about message stanzas
Daniel Gultsch 1 year ago
parent
commit
b0698c4a00
1 changed files with 25 additions and 13 deletions
  1. 25
    13
      xep-0359.xml

+ 25
- 13
xep-0359.xml View File

@@ -9,7 +9,7 @@
9 9
 <xep>
10 10
 <header>
11 11
   <title>Unique and Stable Stanza IDs</title>
12
-  <abstract>This specification describes unique and stable IDs for stanzas.</abstract>
12
+  <abstract>This specification describes unique and stable IDs for messages.</abstract>
13 13
   &LEGALNOTICE;
14 14
   <number>0359</number>
15 15
   <status>Experimental</status>
@@ -23,6 +23,17 @@
23 23
   <supersededby/>
24 24
   <shortname>stanza-id</shortname>
25 25
   &flow;
26
+  <revision>
27
+	  <version>0.5.0</version>
28
+	  <date>2017-08-23</date>
29
+	  <initials>dg</initials>
30
+	  <remark>
31
+		  <ul>
32
+			  <li>Business rules clarifications</li>
33
+			  <li>Define stanza-ids for messages only</li>
34
+		  </ul>
35
+	  </remark>
36
+  </revision>
26 37
   <revision>
27 38
     <version>0.4.1</version>
28 39
     <date>2017-05-20</date>
@@ -94,14 +105,14 @@
94 105
   </revision>
95 106
 </header>
96 107
 <section1 topic='Introduction' anchor='intro'>
97
-  <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>
108
+  <p>This XEP introduces unique and stable IDs for messages, 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>
98 109
 </section1>
99 110
 <section1 topic='Use Cases' anchor='usecases'>
100 111
   <section2 topic='Unique stanza IDs' anchor='stanza-id'>
101 112
   <example caption='The stanza ID extension.'><![CDATA[
102 113
 <stanza-id xmlns='urn:xmpp:sid:0'
103 114
            id='de305d54-75b4-431b-adb2-eb6b9e546013'
104
-           by='room@muc.xmpp.org'/>
115
+           by='room@muc.example.com'/>
105 116
 ]]></example>
106 117
   <p>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.</p>
107 118
   </section2>
@@ -111,7 +122,7 @@
111 122
 	</p>
112 123
 	<example caption='A message stanza with the stanza ID extension.'><![CDATA[
113 124
 <message xmlns='jabber:client'
114
-         to='room@muc.example.org'
125
+         to='room@muc.example.com'
115 126
          type='groupchat'>
116 127
   <body>Typical body text</body>
117 128
   <origin-id xmlns='urn:xmpp:sid:0' id='de305d54-75b4-431b-adb2-eb6b9e546013'/>
@@ -121,39 +132,39 @@
121 132
 	</p>
122 133
 	<example caption='A message stanza with the stanza ID extension.'><![CDATA[
123 134
 <message xmlns='jabber:client'
124
-         to='room@muc.example.org'
135
+         to='room@muc.example.com'
125 136
          type='groupchat'>
126 137
   <body>Typical body text</body>
127 138
   <stanza-id xmlns='urn:xmpp:sid:0'
128 139
              id='5f3dbc5e-e1d3-4077-a492-693f3769c7ad'
129
-             by='room@muc.example.org'/>
140
+             by='room@muc.example.com'/>
130 141
   <origin-id xmlns='urn:xmpp:sid:0' id='de305d54-75b4-431b-adb2-eb6b9e546013'/>
131 142
 </message>]]></example>
132 143
   </section2>
133 144
 </section1>
134 145
 <section1 topic='Business Rules' anchor='rules'>
135 146
   <ol>
136
-	<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>
137 147
 	<li>The values of the 'id' attribute SHOULD be unpredictable.</li>
138
-	<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>
148
+	<li>Stanza ID generating entities, which encounter a &stanza-id; element where the 'by' attribute matches the 'by' attribute they would otherwise set, MUST delete that element even if they are not adding their own stanza ID.</li>
149
+	<li>Entities, which are routing stanzas, SHOULD NOT strip any elements qualified by the 'urn:xmpp:sid:0' namespace from message stanzas unless the preceding rule applied to those elements.</li>
139 150
 	<li>Stanzas MUST possess, 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>
140 151
 	<li>Every &stanza-id; extension element MUST have the 'id' attribute and the 'by' attribute set.</li>
141 152
 	<li>Every &stanza-id; and &origin-id; extension element MUST always possess an 'id' attribute and MUST NOT have any child elements or text content.</li>
142
-	<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>
153
+	<li>The value of the 'by' attribute MUST be the XMPP address of the entity assigning the unique and stable stanza ID. For one-on-one messages the assigning entity is the account. In groupchats the assigning entity is the room. Note that XMPP addresses are normalized as defined in &rfc6122;.</li>
143 154
   </ol>
144 155
 </section1>
145 156
 <section1 topic='Discovering Support' anchor='disco'>
146
-  <p>An entity that follows the business rules, especially the rule on overriding the ID in elements where the by atttribute matches the entities own XMPP address, SHOULD announce the 'urn:xmpp:sid:0' namespace in its disco features allowing other entities to verify that those business rules are properly enforced.</p>
147
-  <example caption='Client sends service discovery request to server'><![CDATA[
157
+  <p>An entity that follows the business rules, especially the rule on overriding the ID in elements where the by atttribute matches the 'by' attribute they would otherwise set, SHOULD announce the 'urn:xmpp:sid:0' namespace in its disco features allowing other entities to verify that those business rules are properly enforced.</p>
158
+  <example caption='Client sends service discovery request to the room'><![CDATA[
148 159
 <iq from='romeo@montague.tld/garden'
149 160
     id='somethingrandom'
150
-    to='montague.tld'
161
+    to='room@muc.example.com'
151 162
     type='get'>
152 163
   <query xmlns='http://jabber.org/protocol/disco#info' />
153 164
 </iq>
154 165
 ]]></example>
155 166
   <example caption='Servers includes the stanza ID namespace in its features'><![CDATA[
156
-<iq from='montague.tld'
167
+<iq from='room@muc.example.com'
157 168
     to='romeo@montague.tld/garden'
158 169
     id='somethingrandom'
159 170
     type='result'>
@@ -167,6 +178,7 @@
167 178
 </section1>
168 179
 <section1 topic='Security Considerations' anchor='security'>
169 180
   <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' MUST be considered a non-secret value.</p>
181
+  <p>Before processing the stanza ID of a message and using it for deduplication purposes or for MAM catchup, the receiving entity SHOULD ensure that the stanza ID could not have been faked, by verifying that the entity referenced in the by attribute does annouce the 'urn:xmpp:sid:0' namespace in its disco features.</p>
170 182
 </section1>
171 183
 <section1 topic='IANA Considerations' anchor='iana'>
172 184
   <p>This document requires no interaction with &IANA;.</p>

Loading…
Cancel
Save