Initial version; changed title to Pubsub Subscription Storage; changed namespace to storage:pubsubs for consistency with other storage XEPs.
0.0.42005-12-11mh
Add resource attribute.
0.0.32005-11-13mh
Add subscription attribute.
0.0.22005-10-28mh
Fix typo and schema.
0.0.12005-10-25mh
First draft.
Publish-Subscribe (XEP-0060)XEP-0060: Publish-Subscribe <https://xmpp.org/extensions/xep-0060.html>. 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 (XEP-0080)XEP-0080: User Geolocation <https://xmpp.org/extensions/xep-0080.html>., User Avatar (XEP-0084)XEP-0084: User Avatar <https://xmpp.org/extensions/xep-0084.html>.) allow information about a certain entity to be published to a Pubsub node. These protocols use Service Discovery (XEP-0030)XEP-0030: Service Discovery <https://xmpp.org/extensions/xep-0030.html>. 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 (XEP-0049)XEP-0049: Private XML Storage <https://xmpp.org/extensions/xep-0049.html>. for storing information about subscriptions.
This protocol enables Jabber clients to do the following:
Remember which pubsub nodes the entity has subscribed to, and what kind of information is available at each node
Update the mappings when subscriptions are added or removed
Correlate incoming pubsub events to subscriptions
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:
jid -- The JID of the pubsub service used
node -- The pubsub node at which the data is available
subscription -- The current subscription state, one of "none", "pending", "unconfigured" and "subscribed"
Additionally, the <subscription/> element MAY possess these attributes:
resource -- The resource that is subscribed to this pubsub node. If the 'resource' attribute is absent, the bare JID is subscribed.
user -- The JID of the owner of this particular piece of data
targetns -- The namespace of the data in question
In this example, the user already has a subscription to Juliet's geolocation, possibly established through another client.
]]>
]]>
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 (XEP-0118)XEP-0118: User Tune <https://xmpp.org/extensions/xep-0118.html>.). Assuming that retrieving happened as in the previous use case, updating the subscriptions proceeds as follows:
]]>
]]>
Having recorded the retrieved mappings, the client is now prepared to identify incoming pubsub events. Assume that the following event arrives:
YesHeart of the Sunrise686
]]>
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 (XEP-0033)XEP-0033: Extended Stanza Addressing <https://xmpp.org/extensions/xep-0033.html>. protocol). This protocol attempts to close that hole. It does so by the following rules and assumptions:
A client MUST add mappings (i.e. associations between a publisher's JID and a pubsub node) only from trustworthy sources, i.e. published disco items (see Service Discovery (XEP-0030)XEP-0030: Service Discovery <https://xmpp.org/extensions/xep-0030.html>.). This relies on disco information not being cracked or falsified.
A client MUST retrieve mappings only from trustworthy sources, i.e. private XML storage. This assumes that no-one but the user is able to change such information.
This document requires no interaction with the Internet Assigned Numbers Authority (IANA)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/>..
No namespaces or parameters need to be registered with the XMPP RegistrarThe 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/>. as a result of this document.