| Abstract: | This document defines an XMPP protocol extension for storing subscriptions to Pubsub nodes. |
| Author: | Magnus Henoch |
| Copyright: | © 1999 - 2011 XMPP Standards Foundation. SEE LEGAL NOTICES. |
| Status: | Deferred |
| Type: | Historical |
| Version: | 0.1 |
| Last Updated: | 2006-02-09 |
WARNING: Consideration of this document has been Deferred by the XMPP Standards Foundation. Implementation of the protocol described herein is not recommended.
1. Introduction
2. Requirements
3. Protocol
4. Use Cases
4.1. Retrieving Existing Subscriptions
4.2. Updating Subscriptions
4.3. Identifying Incoming Events
5. Security Considerations
6. IANA Considerations
7. XMPP Registrar Considerations
8. XML Schema
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
Publish-Subscribe [1] allows Jabber entities to subscribe to various kinds of information, but provides no way of remembering which nodes a user has subscribed to. Other protocols (e.g. User Geolocation [2], User Avatar [3]) allow information about a certain entity to be published to a Pubsub node. These protocols use Service Discovery [4] to allow other entities to find the pubsub node used by a certain entity, but provide no way of performing the opposite mapping, from pubsub node to information source. This document attempts to fill that void, using Private XML Storage [5] for storing information about subscriptions.
This protocol enables Jabber clients to do the following:
The <subscriptions/> element qualified by the 'storage:pubsubs' namespace is the root element used in the jabber:iq:private transactions. It has zero or more <subscription/> child elements, each of which MUST possess the following attributes:
Additionally, the <subscription/> element MAY possess these attributes:
In this example, the user already has a subscription to Juliet's geolocation, possibly established through another client.
Example 1. Client requests existing subscriptions
<iq type='get' id='retrieve1'>
<query xmlns='jabber:iq:private'>
<subscriptions xmlns='storage:pubsubs'/>
</query>
</iq>
Example 2. Server returns existing subscriptions
<iq type='result' id='retrieve1'>
<query xmlns='jabber:iq:private'>
<subscriptions xmlns='storage:pubsubs'>
<subscription user='juliet@capulet.com'
jid='pubsub.capulet.com'
node='juliet/geoloc'
targetns='http://jabber.org/protocol/geoloc'
subscription='subscribed'/>
</subscriptions>
</query>
</iq>
Due to the nature of XEP-0049, incremental updates are not possible; a client MUST send the entire <subscriptions/> node for each update. Before performing the update, the client SHOULD retrieve the stored subscriptions, and incorporate any changes.
In this example, the user has just subscribed to Romeo's tune (see User Tune [6]). Assuming that retrieving happened as in the previous use case, updating the subscriptions proceeds as follows:
Example 3. Client sends updated subscriptions
<iq type='set' id='update1'>
<query xmlns='jabber:iq:private'>
<subscriptions xmlns='storage:pubsubs'>
<subscription user='juliet@capulet.com'
jid='pubsub.capulet.com'
node='juliet/geoloc'
targetns='http://jabber.org/protocol/geoloc'
subscription='subscribed'/>
<subscription user='romeo@montague.net'
jid='pubsub.montague.net'
node='5017cdc9f4a3d1450445c9096064e459'
targetns='http://jabber.org/protocol/tune'
subscription='subscribed'/>
</subscriptions>
</query>
</iq>
Example 4. Server reports success
<iq type='result' id='update1'/>
Having recorded the retrieved mappings, the client is now prepared to identify incoming pubsub events. Assume that the following event arrives:
Example 5. Client receives pubsub event
<message
from='pubsub.montague.net'
to='mercutio@shakespeare.lit'>
<event xmlns='http://jabber.org/protocol/pubsub#event'>
<items node='5017cdc9f4a3d1450445c9096064e459'>
<item id='current'>
<tune xmlns='http://jabber.org/protocol/tune'>
<artist>Yes</artist>
<title>Heart of the Sunrise</title>
<source>Yessongs</source>
<track>3</track>
<length>686</length>
</tune>
</item>
</items>
</event>
</message>
The client now knows that this information comes from romeo@montague.net.
Pubsub events offer an opportunity to spoof sender addresses e.g. through 'replyto' data (as specified by the Extended Stanza Addressing [7] protocol). This protocol attempts to close that hole. It does so by the following rules and assumptions:
This document requires no interaction with the Internet Assigned Numbers Authority (IANA) [9].
No namespaces or parameters need to be registered with the XMPP Registrar [10] as a result of this document.
<?xml version='1.0' encoding='UTF-8'?>
<xs:schema
xmlns:xs='http://www.w3.org/2001/XMLSchema'
targetNamespace='storage:pubsubs'
xmlns='storage:pubsubs'
elementFormDefault='qualified'>
<xs:element name='subscriptions'>
<xs:complexType>
<xs:sequence>
<xs:element ref='subscription' minOccurs='0' maxOccurs='unbounded'/>
</xs:sequence>
</xs:complexType>
</xs:element>
<xs:element name='subscription'>
<xs:complexType>
<xs:attribute name='jid' type='xs:string' use='required'/>
<xs:attribute name='node' type='xs:string' use='required'/>
<xs:attribute name='subscription' use='required'>
<xs:simpleType>
<xs:restriction base='xs:NCName'>
<xs:enumeration value='none'/>
<xs:enumeration value='pending'/>
<xs:enumeration value='subscribed'/>
<xs:enumeration value='unconfigured'/>
</xs:restriction>
</xs:simpleType>
</xs:attribute>
<xs:attribute name='resource' type='xs:string' use='optional'/>
<xs:attribute name='user' type='xs:string' use='optional'/>
<xs:attribute name='targetns' type='xs:string' use='optional'/>
</xs:complexType>
</xs:element>
</xs:schema>
Series: XEP
Number: 0173
Publisher: XMPP Standards Foundation
Status:
Deferred
Type:
Historical
Version: 0.1
Last Updated: 2006-02-09
Approving Body: XMPP Council
Dependencies: XMPP Core, XEP-0049, XEP-0060
Supersedes: None
Superseded By: None
Short Name: pubsubs
Source Control:
HTML
This document in other formats:
XML
PDF
Email:
henoch@dtek.chalmers.se
JabberID:
legoscia@jabber.cd.chalmers.se
The Extensible Messaging and Presence Protocol (XMPP) is defined in the XMPP Core (RFC 3920) and XMPP IM (RFC 3921) 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-0060: Publish-Subscribe <http://xmpp.org/extensions/xep-0060.html>.
2. XEP-0080: User Geolocation <http://xmpp.org/extensions/xep-0080.html>.
3. XEP-0084: User Avatar <http://xmpp.org/extensions/xep-0084.html>.
4. XEP-0030: Service Discovery <http://xmpp.org/extensions/xep-0030.html>.
5. XEP-0049: Private XML Storage <http://xmpp.org/extensions/xep-0049.html>.
6. XEP-0118: User Tune <http://xmpp.org/extensions/xep-0118.html>.
7. XEP-0033: Extended Stanza Addressing <http://xmpp.org/extensions/xep-0033.html>.
8. XEP-0030: Service Discovery <http://xmpp.org/extensions/xep-0030.html>.
9. 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/>.
10. 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 <http://xmpp.org/registrar/>.
Note: Older versions of this specification might be available at http://xmpp.org/extensions/attic/
Initial version; changed title to Pubsub Subscription Storage; changed namespace to storage:pubsubs for consistency with other storage XEPs.
(psa)Add resource attribute.
(mh)Add subscription attribute.
(mh)Fix typo and schema.
(mh)First draft.
(mh)END