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-0297.xml 12KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240
  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>Stanza Forwarding</title>
  10. <abstract>This document defines a protocol to forward a stanza from one entity to another.</abstract>
  11. &LEGALNOTICE;
  12. <number>0297</number>
  13. <status>Draft</status>
  14. <type>Standards Track</type>
  15. <sig>Standards</sig>
  16. <dependencies>
  17. <spec>XMPP Core</spec>
  18. </dependencies>
  19. <supersedes/>
  20. <supersededby/>
  21. <shortname>forward</shortname>
  22. <schemaloc>
  23. <url>http://xmpp.org/schemas/forward.xsd</url>
  24. </schemaloc>
  25. &mwild;
  26. &ksmith;
  27. <revision>
  28. <version>1.0</version>
  29. <date>2013-10-02</date>
  30. <initials>psa</initials>
  31. <remark><p>Per a vote of the XMPP Council, advanced status to Draft.</p></remark>
  32. </revision>
  33. <revision>
  34. <version>0.5</version>
  35. <date>2013-06-05</date>
  36. <initials>mw</initials>
  37. <remark>
  38. <p>Incorporated Last Call feedback, including; clarify that client handling of non-message stanzas, add a disco feature, remove references to deferred XEPs, tighten up the schema to allow only stanzas to be forwarded.</p>
  39. </remark>
  40. </revision>
  41. <revision>
  42. <version>0.4</version>
  43. <date>2012-07-05</date>
  44. <initials>mw</initials>
  45. <remark>
  46. <p>Added recommendation that forwarded messages as part of another specification should be nested under an element of that protocol's namespace.</p>
  47. <p>Adapted text to indicate that stanzas other than messages may be forwarded. Updated title to reflect this.</p>
  48. </remark>
  49. </revision>
  50. <revision>
  51. <version>0.3</version>
  52. <date>2011-07-11</date>
  53. <initials>ks</initials>
  54. <remark><p>Made security considerations more explicit.</p></remark>
  55. </revision>
  56. <revision>
  57. <version>0.2</version>
  58. <date>2011-07-06</date>
  59. <initials>psa</initials>
  60. <remark><p>Corrected XML namespace to reflect official publication.</p></remark>
  61. </revision>
  62. <revision>
  63. <version>0.1</version>
  64. <date>2011-04-11</date>
  65. <initials>psa</initials>
  66. <remark><p>Initial published version.</p></remark>
  67. </revision>
  68. <revision>
  69. <version>0.0.1</version>
  70. <date>2011-03-22</date>
  71. <initials>mw/ks</initials>
  72. <remark><p>First draft.</p></remark>
  73. </revision>
  74. </header>
  75. <section1 topic='Introduction' anchor='intro'>
  76. <p>There are many situations is which an entity needs to forward a previously sent stanza to another entity, such as forwarding an interesting message to a friend, or a server forwarding stored messages from an archive. Here we specify a simple encapsulation method for such forwards. This format can be used in other specifications requiring the forwarding of stanzas, or used in isolation for a user to forward a message to another user (rather like email forwards).</p>
  77. </section1>
  78. <section1 topic='Requirements' anchor='requirements'>
  79. <p>Several properties are desirable when forwarding stanzas:</p>
  80. <ul>
  81. <li>The original sender and receiver should be identified.</li>
  82. <li>Most extension payloads should be included (not only a message &lt;body/&gt;).</li>
  83. <li>It should be possible to annotate the stanza (e.g. with a timestamp) without ambiguity as to the original stanza contents.</li>
  84. <li>It should allow features such as encryption or signing of the original stanza to survive the forwarding.</li>
  85. </ul>
  86. </section1>
  87. <section1 topic='Forwarding a stanza'>
  88. <section2 topic='Overview'>
  89. <p>Let us suppose that a Romeo receives a message from Juliet:</p>
  90. <example caption='Receiving a message'><![CDATA[
  91. <message from='juliet@capulet.lit/orchard'
  92. id='0202197'
  93. to='romeo@montague.lit'
  94. type='chat'>
  95. <body>Yet I should kill thee with much cherishing.</body>
  96. <mood xmlns='http://jabber.org/protocol/mood'>
  97. <amorous/>
  98. </mood>
  99. </message>
  100. ]]></example>
  101. <p>To forward this to Mercutio, Romeo would send a new message with a &lt;forwarded/&gt; payload of namespace 'urn:xmpp:forward:0'.</p>
  102. <example caption='Forwarding a message'><![CDATA[
  103. <message to='mercutio@verona.lit' from='romeo@montague.lit/orchard' type='chat' id='28gs'>
  104. <body>A most courteous exposition!</body>
  105. <forwarded xmlns='urn:xmpp:forward:0'>
  106. <delay xmlns='urn:xmpp:delay' stamp='2010-07-10T23:08:25Z'/>
  107. <message from='juliet@capulet.lit/orchard'
  108. id='0202197'
  109. to='romeo@montague.lit'
  110. type='chat'
  111. xmlns='jabber:client'>
  112. <body>Yet I should kill thee with much cherishing.</body>
  113. <mood xmlns='http://jabber.org/protocol/mood'>
  114. <amorous/>
  115. </mood>
  116. </message>
  117. </forwarded>
  118. </message>
  119. ]]></example>
  120. </section2>
  121. <section2 topic='Business rules'>
  122. <ol>
  123. <li><p>Forwarded stanzas SHOULD include all relevant child elements of the original stanza by default. However, an implementation MAY omit elements it deems irrelevant and safe to discard. An example would be omitting &xep0085; elements from &lt;message&gt; stanzas which typically do not make sense outside the context of a conversation session. However it should be noted that removing such elements can invalidate any digital signature on a stanza. If preserving a signature is important in the context this extension is used then child elements SHOULD NOT be removed.</p></li>
  124. <li><p>The forwarding entity SHOULD add a &lt;delay/&gt; child to the &lt;forwarded/&gt; element to indicate to the recipient the date/time that the forwarding entity received the original stanza. The format of this element is described in &xep0203;.</p></li> <li><p>The namespace of the forwarded stanza MUST be preserved (this is typically 'jabber:client'). If no 'xmlns' is set for the stanza then as per XML namespacing rules it would inherit the 'urn:xmpp:forward:0' namespace, which is wrong.</p></li>
  125. <li><p>When this extension is employed simply for a user to forward a given message to a contact, the outer &lt;message/&gt; SHOULD contain a body (even if empty) and a receiving client should pay particular attention to ensure it renders both the sender's text and the forwarded message unambiguously.</p></li>
  126. <li><p>When a forwarded stanza forms part of an encapsulating protocol, the &lt;forwarded/&gt; element SHOULD be a child of a tag of that protocol, and SHOULD NOT be included as a direct child of the transmitted stanza.</p></li>
  127. </ol>
  128. </section2>
  129. </section1>
  130. <section1 topic="Determining Support" anchor="support">
  131. <p>Clients that implement this specification to display simple forwarded messages (i.e. those not part of another extension)
  132. SHOULD indicate their support via the 'urn:xmpp:forward:0' feature.</p>
  133. <example caption='Client requests features of a contact'><![CDATA[
  134. <iq xmlns='jabber:client'
  135. type='get'
  136. from='romeo@montague.lit/orchard'
  137. to='juliet@capulet.lit/balcony'
  138. id='info1'>
  139. <query xmlns='http://jabber.org/protocol/disco#info'/>
  140. </iq>]]></example>
  141. <example caption='Contact responds with forwarding feature'><![CDATA[
  142. <iq xmlns='jabber:client'
  143. type='result'
  144. to='romeo@montague.net/orchard'
  145. from='juliet@capulet.lit/balcony'
  146. id='info1'>
  147. <query xmlns='http://jabber.org/protocol/disco#info'>
  148. ...
  149. <feature var='urn:xmpp:forward:0'/>
  150. ...
  151. </query>
  152. </iq>]]></example>
  153. <p>Senders SHOULD NOT forward messages using this protocol to recipients that have not indicated support for it. However they may still
  154. format the forward as plain text inside the &lt;body&gt; of a standard message stanza for compatibility with clients lacking support.
  155. Such a plain text version SHOULD NOT be included in a stanza using this extension (e.g. as a 'fallback'), as receiving entities are
  156. expected to display the &lt;body&gt; of a message as well as any forwarded stanza therein.
  157. </p>
  158. </section1>
  159. <section1 topic='IANA Considerations' anchor='iana'>
  160. <p>This document requires no interaction with &IANA;.</p>
  161. </section1>
  162. <section1 topic='XMPP Registrar Considerations' anchor='registrar'>
  163. <section2 topic='Protocol Namespaces' anchor='registrar-ns'>
  164. <p>The &REGISTRAR; includes 'urn:xmpp:forward:0' in its registry of protocol namespaces (see &NAMESPACES;).</p>
  165. </section2>
  166. <section2 topic='Protocol Versioning' anchor='registrar-versioning'>
  167. &NSVER;
  168. </section2>
  169. </section1>
  170. <section1 topic='Security Considerations' anchor='security'>
  171. <p>Forwarding stanzas can reveal information about the original sender, including possible presence leaks as well as the stanza payloads themselves. Any extensions using this format must therefore consider the implications of this.</p>
  172. <p>Forwarding can either be used as-is, or in the context of another specification, with different security considerations as described below.</p>
  173. <section2 topic='As-is' anchor='as-is-sc'>
  174. <p>Receipt of a forwarded stanza from a third-party does not guarantee that the original stanza was actually received, or that the content has not been modified, by the forwarder. Integrity of the original stanza can only be determined through cryptographic signatures for example, which are beyond the scope of this specification.</p>
  175. <p>Considering the above an end-user client should take special care in its rendering of forwarded stanzas, such as forwarded messages, to ensure that the user cannot mistake it for a message received directly from the original sender.</p>
  176. <p>An entity SHOULD NOT trust that forwards are genuine when receiving them unprovoked (i.e. outside the scope of another specification).</p>
  177. <p>Forwarded stanzas MUST NOT be processed as if they were non-forwarded stanzas. Furthermore a client SHOULD ignore non-&lt;message&gt;
  178. stanzas that are not embedded within another extension.</p>
  179. </section2>
  180. <section2 topic='Extensions' anchor='extensions-sc'>
  181. <p>While security considerations are ultimately dependent upon the specifications using the format defined herein, forwarding introduces scope for stanza forgery such that authors of derivative specifications will need to address security considerations themselves. These need to cover which entities a client should accept forwards from, and which entities those are permitted to forward stanzas for. For example, a specification may choose to only trust forwards if they are received from the user's client, another client on the bare JID, or the user's server.</p>
  182. </section2>
  183. </section1>
  184. <section1 topic='XML Schema' anchor='schema'>
  185. <code><![CDATA[
  186. <?xml version='1.0' encoding='UTF-8'?>
  187. <xs:schema
  188. xmlns:xs='http://www.w3.org/2001/XMLSchema'
  189. targetNamespace='urn:xmpp:forward:0'
  190. xmlns='urn:xmpp:forward:0'
  191. elementFormDefault='qualified'>
  192. <xs:annotation>
  193. <xs:documentation>
  194. The protocol documented by this schema is defined in
  195. XEP-0297: http://www.xmpp.org/extensions/xep-0297.html
  196. </xs:documentation>
  197. </xs:annotation>
  198. <xs:import namespace='jabber:client'
  199. schemaLocation='http://xmpp.org/schemas/jabber-client.xsd'/>
  200. <xs:import namespace='jabber:server'
  201. schemaLocation='http://xmpp.org/schemas/jabber-server.xsd'/>
  202. <xs:import namespace='urn:xmpp:delay'
  203. schemaLocation='http://xmpp.org/schemas/delay.xsd'/>
  204. <xs:element name='forwarded'>
  205. <xs:complexType>
  206. <xs:sequence xmlns:delay='urn:xmpp:delay'
  207. xmlns:client='jabber:client'
  208. xmlns:server='jabber:server'>
  209. <xs:element ref='delay:delay' minOccurs='0' maxOccurs='1' />
  210. <xs:choice minOccurs='0' maxOccurs='1'>
  211. <xs:choice>
  212. <xs:element ref='client:message'/>
  213. <xs:element ref='client:presence'/>
  214. <xs:element ref='client:iq'/>
  215. </xs:choice>
  216. <xs:choice>
  217. <xs:element ref='server:message'/>
  218. <xs:element ref='server:presence'/>
  219. <xs:element ref='server:iq'/>
  220. </xs:choice>
  221. </xs:choice>
  222. </xs:sequence>
  223. </xs:complexType>
  224. </xs:element>
  225. </xs:schema>
  226. ]]></code>
  227. </section1>
  228. <section1 topic='Acknowledgements' anchor='ack'>
  229. <p>Thanks to Kim Alvefur, Jefry Lagrange, Matt Miller, Peter Saint-Andre, Kurt Zeilenga, and Florian Zeitz for their feedback.</p>
  230. </section1>
  231. </xep>