No Description
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

xep-0376.xml 11KB

  1. <?xml version='1.0' encoding='UTF-8'?>
  2. <!DOCTYPE xep SYSTEM 'xep.dtd' [
  3. <!ENTITY % ents SYSTEM 'xep.ent'>
  4. %ents;
  5. ]>
  6. <?xml-stylesheet type='text/xsl' href='xep.xsl'?>
  7. <xep>
  8. <header>
  9. <title>Pubsub Account Management</title>
  10. <abstract>This specification describes a new model for handling remote pubsub services and a protocol for doing so.</abstract>
  12. <number>0376</number>
  13. <status>Deferred</status>
  14. <type>Standards Track</type>
  15. <sig>Standards</sig>
  16. <approver>Council</approver>
  17. <dependencies>
  18. <spec>XMPP Core</spec>
  19. <spec>XEP-0060</spec>
  20. </dependencies>
  21. <supersedes/>
  22. <supersededby/>
  23. <shortname>pam</shortname>
  24. &dcridland;
  25. <revision>
  26. <version>0.2</version>
  27. <date>2017-09-11</date>
  28. <initials>XEP Editor (jwi)</initials>
  29. <remark>Defer due to lack of activity.</remark>
  30. </revision>
  31. <revision>
  32. <version>0.1.1</version>
  33. <date>2016-07-20</date>
  34. <initials>dwd</initials>
  35. <remark><p>Added some concrete protocol around subscription tracking.</p></remark>
  36. </revision>
  37. <revision>
  38. <version>0.1.0</version>
  39. <date>2016-05-20</date>
  40. <initials>XEP Editor: ssw</initials>
  41. <remark><p>Initial version approved by the Council.</p></remark>
  42. </revision>
  43. <revision>
  44. <version>0.0.1</version>
  45. <date>2016-01-28</date>
  46. <initials>dwd</initials>
  47. <remark><p>Initial Version</p></remark>
  48. </revision>
  49. </header>
  50. <section1 topic='Introduction'>
  51. <p>The XMPP way is to have "disposable", or at least easily substituted, clients, maintaining long-term state on the server, and allowing it to be synchronized between clients. In particular, this can be seen on how the roster and presence fan-out operate - clients defer the operation of such things to the server, which manages the shared state and allows servers to access and manipulate it.</p>
  52. <p>Historically, however, we have not done this for some more recently designed services, including Multi User Chat and PubSub. In both cases, different clients may be unaware of what chatrooms (etc) are joined (etc) by which other clients. This causes practical difficulty in seamlessly switching between devices and/or clients.</p>
  53. </section1>
  54. <section1 topic='User Stories' anchor='stories'>
  55. <section2 topic='Device Agility'>
  56. <ul>
  57. <li>When a user subscribes to a publish-subscribe node (presumably via some higher-level abstraction), other online devices are aware of the new subscription immediately, and can choose to reflect the new subscription in their UI.</li>
  58. <li>Not all devices may be capable of handling the particular payload and/or service, and therefore should signal which payload and/or service types they support.</li>
  59. <li>The same capability as point 1 should be possible for unsubscribing.</li>
  60. </ul>
  61. </section2>
  62. <section2 topic='New Devices'>
  63. <ul>
  64. <li>When a user brings a new device online, it should be able to quickly learn all the user's current subscriptions and present them to the user in its UI.</li>
  65. </ul>
  66. </section2>
  67. <section2 topic='Offline Capability'>
  68. <ul>
  69. <li>When the device is offline for an extended period (beyond XEP-0198 resumption capability), it needs to be able to obtain all the events it missed, including when the events occured.</li>
  70. <li>It should be able to tell which of these the user is unlikely to have seen on other devices.</li>
  71. <li>Further, it needs to be able to tell if new subscriptions have been added, or old ones removed.</li>
  72. </ul>
  73. </section2>
  74. <section2 topic='PEP'>
  75. <ul>
  76. <li>A one-way subscription to a user should still allow PEP.</li>
  77. <li>PEP should work the same way as now - users see filtered notifications about the things they care about.</li>
  78. </ul>
  79. </section2>
  80. </section1>
  81. <section1 topic='Protocol' anchor='protocol'>
  82. <section2 topic='Advertising Support' anchor='disco'>
  83. <section3 topic='Clients'>
  84. <p>Clients advertise support for this protocol via &xep0030; using a Disco Feature of 'urn:xmpp:pam:0'. This is required for local servers to detect support.</p>
  85. </section3>
  86. <section3 topic='Servers'>
  87. <p>Servers advertise this support via &xep0030; on the user account (eg, &LOCALBARE;), using the same feature of 'urn:xmpp:pam:0'. This is used both by the local user and also remote pubsub services.</p>
  88. </section3>
  89. </section2>
  90. <section2 topic='Subscribing' anchor='subs'>
  91. <p>When a client wishes to subscribe to a node, either on the local server or remotely, using this protocol it does so by sending an &IQ; of type "set" to its own account, containing a pam element, which in turn has a service attribute (the target service jid) and a payload of a &xep0060; subscribe element (as described in &xep0060; §6.1). Example 32 from &xep0060; is thus performed in this protocol as follows:</p>
  92. <example caption='Client subscribes to a node'><![CDATA[
  93. <iq type='set' id='sub1'>
  94. <pam xmln='urn:xmpp:pam:0' jid='pubsub.shakespeare.lit'>
  95. <subscribe xmlns=''
  96. node='princely_musings'
  97. jid='francisco@denmark.lit'/>
  98. </pam>
  99. </iq>
  100. ]]>
  101. </example>
  102. <p>Note that because the &xep0060; operation is intact within the pam element, local servers MAY interpret the operation, or MAY forward it verbatim. Note that the client SHALL always use its own bare jid (eg, &LOCALBARE;) within a subscribe, servers MUST verify this.</p>
  103. <p>Such a request SHALL cause the local server to send a traditional &xep0060; request, from the account bare jid, to the remote service.</p>
  104. <p>When the remote service replies, the local server SHALL first notify all joined clients of the new subscription (described more in #sublist)...</p>
  105. <example caption='Server notifies about new subscription'><![CDATA[
  106. <message>
  107. <notify ver='aocolb' service='pubsub.shakespeare.lit' xmlns='urn:xmpp:pam:0'>
  108. <subscription xmlns=''
  109. node='princely_musings'
  110. jid='francisco@denmark.lit'
  111. subscription='subscribed'/>
  112. </notify>
  113. </message>
  114. ]]>
  115. </example>
  116. <p>... and then MUST respond to the original &IQ;. Since the subscription has already been notified, this is an empty result &IQ;.</p>
  117. <p>If the local server detects an error, it MUST NOT forward the request, and MUST respond with an &IQ; stanza of type error, which contains an error element which MAY be stamped with the local server as generator. Thus Example 34 from &xep0060; would be very similar:</p>
  118. <example caption='An error generated remotely'><![CDATA[
  119. <iq type='error' id='sub1'>
  120. <error type='modify' by='francisco@denmark.lit'>
  121. <bad-request xmlns='urn:ietf:params:xml:ns:xmpp-stanzas'/>
  122. <invalid-jid xmlns=''/>
  123. </error>
  124. </iq>
  125. ]]>
  126. </example>
  127. <p>If the remote service rejects the subscription request, the local server simply forwards the response back as an &IQ; of type error, with the remote error copied through. The generator MUST be set to the remote service if missing. Thus Example 35 from &xep0060; might look as follows:</p>
  128. <example caption='An error generated remotely'><![CDATA[
  129. <iq type='error' id='sub1'>
  130. <error type='auth' by='pubsub.shakespeare.lit'>
  131. <not-authorized xmlns='urn:ietf:params:xml:ns:xmpp-stanzas'/>
  132. <presence-subscription-required xmlns=''/>
  133. </error>
  134. </iq>
  135. ]]>
  136. </example>
  137. <p>Clients MAY assume that if the generator is missing, the error is generated by the local server and not a remote service.</p>
  138. </section2>
  139. <section2 topic='Unsubscribing' anchor='unsub'>
  140. <p>As above.</p>
  141. </section2>
  142. <section2 topic='Listing Subscriptions' anchor='sublist'>
  143. <p>Clients obtain a current listing of the subscriptions, for example on initial connection, by sending a subscriptions request qualified by the pam namespace. If a client already has the opaque version identifier cached, it MAY include it within a "ver" attribute:</p>
  144. <example caption='Client requests all current subscriptions'><![CDATA[
  145. <iq type='get' id='subscriptions1'>
  146. <subscriptions xml='urn:xmpp:pam:0' ver='asdvcjkasdjb'>
  147. </iq>
  148. ]]>
  149. </example>
  150. <p>The local server responds with either a response containing a subscription list (such as this, similar to &xep0060; Example 21):</p>
  151. <example caption='Complete subscription list'><![CDATA[
  152. <iq type='result' id='subscription1'>
  153. <subscriptions xml='urn:xmpp:pam:0' ver='kjlsadhfsd'>
  154. <subscription service='pubsub.shakespeare.lit' node='node1' jid='francisco@denmark.lit' subscription='subscribed'/>
  155. <subscription service='pubsub.marlowe.lit' node='node2' jid='francisco@denmark.lit' subscription='subscribed'/>
  156. <subscription service='pubsub.marlowe.lit' node='node5' jid='francisco@denmark.lit' subscription='unconfigured'/>
  157. <subscription service='pubsub.shakespeare.lit' node='node6' jid='francisco@denmark.lit' subscription='subscribed' subid='123-abc'/>
  158. <subscription service='pubsub.shakespeare.lit' node='node6' jid='francisco@denmark.lit' subscription='subscribed' subid='004-yyy'/>
  159. </subscriptions>
  160. </iq>
  161. ]]>
  162. </example>
  163. <p>Alternately, a server MAY - if the client has supplied an opaque version identifier - send a sequence of &lt;notify> elements followed by an empty &IQ; result.</p>
  164. <p>Clients MAY persistently store the last "ver" attribute seen from either the &lt;subscriptions> response or the last &lt;notify>, whichever is later. This can then be used to minimize the volume of subscription data transferred during resync.</p>
  165. </section2>
  166. <section2 topic='Auto Subscriptions' anchor='autosub'>
  167. <p>Servers need to subscribe to remote PEP services explicitly those nodes which are of interest. Interest needs to be detirmined by the client issuing a request; but this implies that servers would gradually acrue any node type which the user has had a capable client at any time.</p>
  168. <p>Perhaps timing out node types which have not been requested for over a certain period?</p>
  169. <p>Clients can use +notify to handle auto-subscriptions between clients and their server.</p>
  170. <p>Servers receiving +notify from accounts known to support this protocol ignore them.</p>
  171. </section2>
  172. <section2 topic='Filtering' anchor='filter'>
  173. <p>Clients filter subscriptions using a specific stanza (iq, probably), containing a list of node names. This can be used instead of the odler +notify (which is broadcast).</p>
  174. </section2>
  175. <section2 topic='Interaction with MAM' anchor='mam'>
  176. <p>We probably want to say that events are now archived by MAM, but this may imply that clients need to filter out such events (or explicitly include them). Maybe the mask above affects MAM queries?</p>
  177. </section2>
  178. </section1>
  179. <section1 topic='Security Considerations' anchor='security'>
  180. <p>I have literally no idea. I don't think anything new is introduced that couldn't be discovered by traffic monitoring, although it collects and collates information that previously would not have been so readily available.</p>
  181. </section1>
  182. <section1 topic='XMPP Registrar Considerations' anchor='registrar'>
  183. <p>On publication of this specification, the XMPP Registrar will dance a little jig to the tune of the traditional hornpipe with a tea-cosy upon his or her head.</p>
  184. </section1>
  185. <section1 topic='IANA Considerations' anchor='iana'>
  186. <p>This document requires no interaction with &IANA;.</p>
  187. </section1>
  188. </xep>