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
© 2008 – 2009 XMPP Standards Foundation. SEE LEGAL NOTICES.
Status

Deferred

WARNING: This document has been automatically Deferred after 12 months of inactivity in its previous Experimental state. Implementation of the protocol described herein is not recommended for production systems. However, exploratory implementations are encouraged to resume the standards process.
Type
Standards Track
Version
0.2 (2009-11-18)
Document Lifecycle
  1. Experimental
  2. Deferred
  3. Proposed
  4. Stable
  5. Final

1. Introduction

To enable lightweight repeaters for Publish-Subscribe (XEP-0060) [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 (XEP-0050) [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>

At this point, the service itself will subscribe to the remote node.

Example 5. Service subscribes to remote node for chaining
<iq type='set'
    from='weatherbot@consumer.tld/Chicagoland'
    to='notify.weather.tld'
    id='sub1'>
  <pubsub xmlns='http://jabber.org/protocol/pubsub'>
    <subscribe
        node='OHR'
        jid='weatherbot@consumer.tld/Chicagoland'/>
  </pubsub>
</iq>

Now subscribers who are local to the consumer.tld XMPP service can subscribe directly to weatherbot@consumer.tld/Chicagoland instead of the remote pubsub node at notify.weather.tld. We therefore refer to weatherbot@consumer.tld/Chicagoland as a "chaining node" and the remote node as a "chained node".

3. Notifications

When a chaining node delivers a notification to its subscribers, it SHOULD include an Extended Stanza Addressing (XEP-0033) [3] header of "ofrom" to specify the chained node or service that generated the notification (note: this header is not yet defined in XEP-0033).

Example 6. Chaining node 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 (XEP-0030) [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 <https://xmpp.org/registrar/namespaces.html>).

7.2 Field Standardization

Field Standardization for Data Forms (XEP-0068) [7] defines a process for standardizing the fields used within Data Forms (XEP-0004) [8] scoped by a particular namespace (see <https://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-0253</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
Deferred
Type
Standards Track
Version
0.2
Last Updated
2009-11-18
Approving Body
XMPP Council
Dependencies
XMPP Core, XEP-0050, XEP-0060
Supersedes
None
Superseded By
None
Short Name
NOT_YET_ASSIGNED
Source Control
HTML

This document in other formats: XML  PDF

Appendix B: Author Information

Ralph Meijer
Email
ralphm@ik.nu
JabberID
ralphm@ik.nu
Peter Saint-Andre
Email
stpeter@stpeter.im
JabberID
stpeter@jabber.org
URI
https://stpeter.im/

Copyright

This XMPP Extension Protocol is copyright © 1999 – 2024 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 <https://xmpp.org/about/xsf/ipr-policy> or obtained by writing to XMPP Standards Foundation, P.O. Box 787, Parker, CO 80134 USA).

Visual Presentation

The HTML representation (you are looking at) is maintained by the XSF. It is based on the YAML CSS Framework, which is licensed under the terms of the CC-BY-SA 2.0 license.

Appendix D: Relation to XMPP

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.

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 <https://xmpp.org/community/> 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 <https://xmpp.org/extensions/xep-0060.html>.

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

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

4. XEP-0030: Service Discovery <https://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 <https://xmpp.org/registrar/>.

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

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

Appendix H: Revision History

Note: Older versions of this specification might be available at https://xmpp.org/extensions/attic/

  1. Version 0.2 (2009-11-18)

    Specifed protocol flow for the chained subscription.

    psa
  2. Version 0.1 (2008-11-13)

    Initial published version.

    psa
  3. Version 0.0.2 (2008-10-07)

    Added ofrom header to notifications.

    psa
  4. Version 0.0.1 (2008-08-12)

    First draft.

    rm/psa

Appendix I: Bib(La)TeX Entry

@report{meijer2008xep0253,
  title = {PubSub Chaining},
  author = {Meijer, Ralph and Saint-Andre, Peter},
  type = {XEP},
  number = {0253},
  version = {0.2},
  institution = {XMPP Standards Foundation},
  url = {https://xmpp.org/extensions/xep-0253.html},
  date = {2008-08-12/2009-11-18},
}

END