Abstract: | This specification describes unique and stable IDs for stanzas. |
Author: | Florian Schmaus |
Copyright: | © 1999 – 2017 XMPP Standards Foundation. SEE LEGAL NOTICES. |
Status: | Experimental |
Type: | Standards Track |
Version: | 0.4.1 |
Last Updated: | 2017-05-20 |
WARNING: This Standards-Track document is Experimental. Publication as an XMPP Extension Protocol does not imply approval of this proposal by the XMPP Standards Foundation. Implementation of the protocol described herein is encouraged in exploratory implementations, but production systems are advised to carefully consider whether it is appropriate to deploy implementations of this protocol before it advances to a status of Draft.
1. Introduction
2. Use Cases
2.1. Unique stanza IDs
2.2. Origin generated stanza IDs
3. Business Rules
4. Discovering Support
5. Security Considerations
6. IANA Considerations
7. XMPP Registrar Considerations
7.1. Protocol Namespaces
8. XML Schema
9. Acknowledgements
Appendices
A: Document Information
B: Author Information
C: Legal Notices
D: Relation to XMPP
E: Discussion Venue
F: Requirements Conformance
G: Notes
H: Revision History
This XEP introduces unique and stable IDs for stanzas, which are beneficial in various ways. For example, they can be used together with Message Archive Management (XEP-0313) [1] to uniquely identify a message within an archive. They are also useful in the context of Multi-User Chat (XEP-0045) [2] conferences, as they allow to identify a message reflected by a MUC service back to the originating entity.
<stanza-id xmlns='urn:xmpp:sid:0' id='de305d54-75b4-431b-adb2-eb6b9e546013' by='room@muc.xmpp.org'/>
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 RFC 4122 [3] to generate the IDs.
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.
<message xmlns='jabber:client' to='room@muc.example.org' type='groupchat'> <body>Typical body text</body> <origin-id xmlns='urn:xmpp:sid:0' id='de305d54-75b4-431b-adb2-eb6b9e546013'/> </message>
The server or component MAY add a <stanza-id/> element. In that case, it MUST preserve the content of the <origin-id/> element.
<message xmlns='jabber:client' to='room@muc.example.org' type='groupchat'> <body>Typical body text</body> <stanza-id xmlns='urn:xmpp:sid:0' id='5f3dbc5e-e1d3-4077-a492-693f3769c7ad' by='room@muc.example.org'/> <origin-id xmlns='urn:xmpp:sid:0' id='de305d54-75b4-431b-adb2-eb6b9e546013'/> </message>
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.
<iq from='romeo@montague.tld/garden' id='somethingrandom' to='montague.tld' type='get'> <query xmlns='http://jabber.org/protocol/disco#info' /> </iq>
<iq from='montague.tld' to='romeo@montague.tld/garden' id='somethingrandom' type='result'> <query xmlns='http://jabber.org/protocol/disco#info'> … <feature var='urn:xmpp:sid:0'/> … </query> </iq>
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.
This document requires no interaction with the Internet Assigned Numbers Authority (IANA) [5].
This specification defines the following XML namespaces:
The XMPP Registrar [6] shall include the foregoing namespaces in its registry of protocol namespaces (see <https://xmpp.org/registrar/namespaces.html>) and in its disco features registry (<https://xmpp.org/registrar/disco-features.html>) as defined in Service Discovery (XEP-0030) [7].
<var> <name>urn:xmpp:sid:0</name> <desc>Indicates that an entity adds stanza-ids and follows the business rules described in the XEP</desc> <doc>XEP-0359</doc> </var>
<?xml version='1.0' encoding='UTF-8'?> <xs:schema xmlns:xs='http://www.w3.org/2001/XMLSchema' targetNamespace='urn:xmpp:sid:0' elementFormDefault='qualified'> <xs:annotation> <xs:documentation> The protocol documented by this schema is defined in XEP-0359: https://www.xmpp.org/extensions/xep-0359.html </xs:documentation> </xs:annotation> <xs:element name='stanza-id'> <xs:complexType> <xs:attribute name='id' type='xs:string' use='required'/> <xs:attribute name='by' type='xs:string' use='required'/> </xs:complexType> </xs:element> <xs:element name='origin-id'> <xs:complexType> <xs:attribute name='id' type='xs:string' use='required'/> </xs:complexType> </xs:element> </xs:schema>
Thanks to Thijs Alkemade and Georg Lukas for providing feedback.
Series: XEP
Number: 0359
Publisher: XMPP Standards Foundation
Status:
Experimental
Type:
Standards Track
Version: 0.4.1
Last Updated: 2017-05-20
Approving Body: XMPP Council
Dependencies: XMPP Core
Supersedes: None
Superseded By: None
Short Name: stanza-id
Source Control:
HTML
This document in other formats:
XML
PDF
Email:
flo@geekplace.eu
JabberID:
flo@geekplace.eu
The Extensible Messaging and Presence Protocol (XMPP) is defined in the XMPP Core (RFC 6120) and XMPP IM (RFC 6121) specifications contributed by the XMPP Standards Foundation to the Internet Standards Process, which is managed by the Internet Engineering Task Force in accordance with RFC 2026. Any protocol defined in this document has been developed outside the Internet Standards Process and is to be understood as an extension to XMPP rather than as an evolution, development, or modification of XMPP itself.
The primary venue for discussion of XMPP Extension Protocols is the <standards@xmpp.org> discussion list.
Discussion on other xmpp.org discussion lists might also be appropriate; see <http://xmpp.org/about/discuss.shtml> for a complete list.
Errata can be sent to <editor@xmpp.org>.
The following requirements keywords as used in this document are to be interpreted as described in RFC 2119: "MUST", "SHALL", "REQUIRED"; "MUST NOT", "SHALL NOT"; "SHOULD", "RECOMMENDED"; "SHOULD NOT", "NOT RECOMMENDED"; "MAY", "OPTIONAL".
1. XEP-0313: Message Archive Management <https://xmpp.org/extensions/xep-0313.html>.
2. XEP-0045: Multi-User Chat <https://xmpp.org/extensions/xep-0045.html>.
3. RFC 4122: A Universally Unique IDentifier (UUID) URN Namespace <http://tools.ietf.org/html/rfc4122>.
4. RFC 6122: Extensible Messaging and Presence Protocol (XMPP): Address Format <http://tools.ietf.org/html/rfc6122>.
5. The Internet Assigned Numbers Authority (IANA) is the central coordinator for the assignment of unique parameter values for Internet protocols, such as port numbers and URI schemes. For further information, see <http://www.iana.org/>.
6. The XMPP Registrar maintains a list of reserved protocol namespaces as well as registries of parameters used in the context of XMPP extension protocols approved by the XMPP Standards Foundation. For further information, see <https://xmpp.org/registrar/>.
7. XEP-0030: Service Discovery <https://xmpp.org/extensions/xep-0030.html>.
Note: Older versions of this specification might be available at http://xmpp.org/extensions/attic/
Add ability to discover support
(dg)Rename client-id element to origin-id.
Minor improvements.
(fs)Minor fixes (typos, s/JID/XMPP Address, etc.)
(fs)Initial published version approved by the XMPP Council.
(XEP Editor (mam))First draft.
(fs)END