XEP-0253: PubSub Chaining

Abstract:This specification defines a method for chaining pubsub nodes together, resulting in lightweight repeaters for pubsub notifications.
Authors:Ralph Meijer, Peter Saint-Andre
Copyright:© 1999 - 2009 XMPP Standards Foundation. SEE LEGAL NOTICES.
Status:Experimental
Type:Standards Track
Version:0.1
Last Updated:2008-11-13

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.


Table of Contents


1. Introduction
2. How It Works
3. Notifications
4. Determining Support
5. Security Considerations
6. IANA Considerations
7. XMPP Registrar Considerations
    7.1. Protocol Namespaces
    7.2. Field Standardization
8. 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


1. Introduction

To enable lightweight repeaters for Publish-Subscribe [1] notifications, we need the ability to subscribe one pubsub node to another pubsub node. This specification defines a method for doing so, using Ad-Hoc Commands [2].

2. How It Works

The owner of a pubsub node can subscribe that "local" node to a "remote" node using the flow described below. In these examples, the node owner is admin@consumer.tld, the local node is weatherbot@consumer.tld/Chicagoland, and the remote node has a NodeID of "OHR" at the pubsub service notify.weather.tld.

Example 1. Owner requests chaining

<iq from='admin@consumer.tld/client'
    id='chaining-1'
    to='weatherbot@consumer.tld'
    type='set'
    xml:lang='en'>
  <command xmlns='http://jabber.org/protocol/commands' 
           action='execute'
           node='http://jabber.org/protocol/pubsub#chaining'/>
</iq>
  

Unless an error occurs, the service SHOULD return the appropriate form.

Example 2. Service returns chaining form to node owner

<iq from='weatherbot@consumer.tld'
    id='chaining-1'
    to='admin@consumer.tld/client'
    type='result'
    xml:lang='en'>
  <command xmlns='http://jabber.org/protocol/commands' 
           node='http://jabber.org/protocol/pubsub#chaining'
           sessionid='a73sjjvkla37jfea'
           status='executing'>
    <x xmlns='jabber:x:data' type='form'>
      <title>Chaining Request</title>
      <instructions>Fill out this form to complete your request.</instructions>
      <field type='hidden' var='FORM_TYPE'>
        <value>http://jabber.org/protocol/pubsub#chaining</value>
      </field>
      <field label='The Node ID of the local pubsub node'
             type='text-single'
             var='local-node'>
        <required/>
      </field>
      <field label='The Jabber ID of the remote pubsub service'
             type='jid-single'
             var='remote-service'>
        <required/>
      </field>
      <field label='The NodeID of the remote pubsub node'
             type='text-single'
             var='remote-node'>
        <required/>
      </field>
    </x>
  </command>
</iq>
  

Example 3. Admin submits chaining form to service

<iq from='admin@consumer.tld/client'
    id='chaining-2'
    to='weatherbot@consumer.tld'
    type='submit'
    xml:lang='en'>
  <command xmlns='http://jabber.org/protocol/commands' 
           node='http://jabber.org/protocol/pubsub#chaining'
           sessionid='a73sjjvkla37jfea'
           status='executing'>
    <x xmlns='jabber:x:data' type='submit'>
      <field type='hidden' var='FORM_TYPE'>
        <value>http://jabber.org/protocol/pubsub#chaining</value>
      </field>
      <field var='local-node'>
        <value>Chicagoland</value>
      </field>
      <field var='remote-service'>
        <value>notify.weather.tld</value>
      </field>
      <field var='remote-node'>
        <value>OHR</value>
      </field>
    </x>
  </command>
</iq>
  

Example 4. Service informs admin of completion

<iq from='weatherbot@consumer.tld'
    id='chaining-2'
    to='admin@consumer.tld/client'
    type='result'
    xml:lang='en'>
  <command xmlns='http://jabber.org/protocol/commands' 
           node='http://jabber.org/protocol/pubsub#chaining'
           sessionid='a73sjjvkla37jfea'
           status='completed'/>
</iq>
  

3. Notifications

When a chained pubsub node delivers notifications to its subscribers, it SHOULD include an Extended Stanza Addressing [3] header of "ofrom" (note: this header is not yet defined in XEP-0033).

Example 5. Service notifies subscribers

<message from='weatherbot@consumer.tld/bot' 
         to='subscriber@consumer.tld' 
         id='foo'>
  <event xmlns='http://jabber.org/protocol/pubsub#event'>
    <items node='Chicagoland'>
      <item id='ae890ac52d0df67ed7cfdf51b644e901'>
        <example xmlns='urn:xmpp:example'>message</example>
      </item>
    </items>
  </event>
  <addresses xmlns='http://jabber.org/protocol/address'>
    <address type='ofrom' jid='notify.weather.tld'/>
  </addresses>
</message>
    

4. Determining Support

If a pubsub service supports Ad-Hoc Commands, it MUST advertise the commands it supports via Service Discovery [4] (as described in XEP-0050: Ad-Hoc Commands); such commands exist as well-defined discovery nodes associated with the service. In particular, if a pubsub service supports chaining it MUST advertise a command of "http://jabber.org/protocol/pubsub#chaining".

5. Security Considerations

The ability to subscribe one node to another node introduces the possibility of exposing non-public information in a public way, since the access controls for the node that originates a notification might not be known or enforced by the downstream node. Therefore, the upstream node (or its owner) is advised to make a careful access decision before allowing a downstream node (or any other entity) to subscribe.

Note: The upstream node can discover the identity of the downstream node by sending a service discovery information ("disco#info") request to the downstream node, and MAY cancel or decline the downstream node's subscription if it determines that the node has an identity of "pubsub/leaf" or "pubsub/collection".

6. IANA Considerations

This document requires no interaction with the Internet Assigned Numbers Authority (IANA) [5].

7. XMPP Registrar Considerations

The XMPP Registrar [6] shall include the following information in its registries.

7.1 Protocol Namespaces

The XMPP Registrar shall include 'http://jabber.org/protocol/pubsub#chaining' in its registry of protocol namespaces (see <http://xmpp.org/registrar/namespaces.html>).

7.2 Field Standardization

Field Standardization for Data Forms [7] defines a process for standardizing the fields used within Data Forms [8] scoped by a particular namespace (see <http://xmpp.org/registrar/formtypes.html>). The reserved fields for the 'http://jabber.org/protocol/pubsub#chaining' namespace are specified below.

Registry Submission

<form_type>
  <name>http://jabber.org/protocol/pubsub#chaining</name>
  <doc>XEP-xxxx</doc>
  <desc>Forms used for chaining of pubsub nodes.</desc>
  <field var='local-node'
         type='text-single'
         label='The Node ID of the local node'/>
  <field var='remote-node'
         type='text-single'
         label='The NodeID of the remote node'/>
  <field var='remote-service'
         type='jid-single'
         label='The Jabber ID of the remote pubsub service'/>
</form_type>
    

8. Acknowledgements

Thanks to Joe Hildebrand for his feedback.


Appendices


Appendix A: Document Information

Series: XEP
Number: 0253
Publisher: XMPP Standards Foundation
Status: Experimental
Type: Standards Track
Version: 0.1
Last Updated: 2008-11-13
Approving Body: XMPP Council
Dependencies: XMPP Core, XEP-0050, XEP-0060
Supersedes: None
Superseded By: None
Short Name: NOT_YET_ASSIGNED
Source Control: HTML  RSS


Appendix B: Author Information

Ralph Meijer

Email: ralphm@ik.nu
JabberID: ralphm@ik.nu

Peter Saint-Andre

Email: stpeter@jabber.org
JabberID: stpeter@jabber.org
URI: https://stpeter.im/


Appendix C: Legal Notices

Copyright

This XMPP Extension Protocol is copyright © 1999 - 2009 by the XMPP Standards Foundation (XSF).

Permissions

Permission is hereby granted, free of charge, to any person obtaining a copy of this specification (the "Specification"), to make use of the Specification without restriction, including without limitation the rights to implement the Specification in a software program, deploy the Specification in a network service, and copy, modify, merge, publish, translate, distribute, sublicense, or sell copies of the Specification, and to permit persons to whom the Specification is furnished to do so, subject to the condition that the foregoing copyright notice and this permission notice shall be included in all copies or substantial portions of the Specification. Unless separate permission is granted, modified works that are redistributed shall not contain misleading information regarding the authors, title, number, or publisher of the Specification, and shall not claim endorsement of the modified works by the authors, any organization or project to which the authors belong, or the XMPP Standards Foundation.

Disclaimer of Warranty

## NOTE WELL: This Specification is provided on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, express or implied, including, without limitation, any warranties or conditions of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A PARTICULAR PURPOSE. ##

Limitation of Liability

In no event and under no legal theory, whether in tort (including negligence), contract, or otherwise, unless required by applicable law (such as deliberate and grossly negligent acts) or agreed to in writing, shall the XMPP Standards Foundation or any author of this Specification be liable for damages, including any direct, indirect, special, incidental, or consequential damages of any character arising from, out of, or in connection with the Specification or the implementation, deployment, or other use of the Specification (including but not limited to damages for loss of goodwill, work stoppage, computer failure or malfunction, or any and all other commercial damages or losses), even if the XMPP Standards Foundation or such author has been advised of the possibility of such damages.

IPR Conformance

This XMPP Extension Protocol has been contributed in full conformance with the XSF's Intellectual Property Rights Policy (a copy of which can be found at <http://xmpp.org/extensions/ipr-policy.shtml> or obtained by writing to XMPP Standards Foundation, c/o Peter Saint-Andre, 1899 Wynkoop Street, Suite 600, Denver, CO 80202 USA).

Appendix D: Relation to XMPP

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.


Appendix E: Discussion Venue

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>.


Appendix F: Requirements Conformance

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".


Appendix G: Notes

1. XEP-0060: Publish-Subscribe <http://xmpp.org/extensions/xep-0060.html>.

2. XEP-0050: Ad-Hoc Commands <http://xmpp.org/extensions/xep-0050.html>.

3. XEP-0033: Extended Stanza Addressing <http://xmpp.org/extensions/xep-0033.html>.

4. XEP-0030: Service Discovery <http://xmpp.org/extensions/xep-0030.html>.

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 <http://xmpp.org/registrar/>.

7. XEP-0068: Field Data Standardization for Data Forms <http://xmpp.org/extensions/xep-0068.html>.

8. XEP-0004: Data Forms <http://xmpp.org/extensions/xep-0004.html>.


Appendix H: Revision History

Version 0.1 (2008-11-13)

Initial published version.

(psa)

Version 0.0.2 (2008-10-07)

Added ofrom header to notifications.

(psa)

Version 0.0.1 (2008-08-12)

First draft.

(rm/psa)

END