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-0328.xml 7.9KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182
  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>JID Prep</title>
  10. <abstract>This specification defines a way for an XMPP client to request an XMPP server to prep and normalize a given JID.</abstract>
  11. &LEGALNOTICE;
  12. <number>0328</number>
  13. <status>Deferred</status>
  14. <type>Standards Track</type>
  15. <sig>Standards</sig>
  16. <dependencies>
  17. <spec>XMPP Core</spec>
  18. <spec>XMPP IM</spec>
  19. <spec>XEP-0030</spec>
  20. </dependencies>
  21. <supersedes/>
  22. <supersededby/>
  23. <shortname>NOT_YET_ASSIGNED</shortname>
  24. <author>
  25. <firstname>Lance</firstname>
  26. <surname>Stout</surname>
  27. <email>lance@lance.im</email>
  28. <jid>lance@lance.im</jid>
  29. </author>
  30. <revision>
  31. <version>0.1</version>
  32. <date>2013-05-28</date>
  33. <initials>psa</initials>
  34. <remark><p>Initial published version approved by the XMPP Council.</p></remark>
  35. </revision>
  36. <revision>
  37. <version>0.0.2</version>
  38. <date>2013-05-21</date>
  39. <initials>lance</initials>
  40. <remark><p>Incorporated feedback.</p></remark>
  41. </revision>
  42. <revision>
  43. <version>0.0.1</version>
  44. <date>2013-05-08</date>
  45. <initials>lance</initials>
  46. <remark><p>Initial version.</p></remark>
  47. </revision>
  48. </header>
  49. <section1 topic='Introduction' anchor='intro'>
  50. <p>In order to properly compare and match JIDs, a normalization and prepping step is required by &rfc6122;. The responsibility for such normalization is split between the server and client, where the server is expected to prep any JID slots that it recognizes, particulary those related to stanza routing and roster items. However, the server can not prep JID slots that it does not understand, and so those are left for the client to process.</p>
  51. <p>In some environments (in particular, browser based environments), a client does not have access to the various Unicode and internationalization libraries necessary to properly prep and normalize a JID. For those situations, this protocol defines a way for a client to ask a server to normalize a JID on its behalf.</p>
  52. </section1>
  53. <section1 topic='Discovering support' anchor='disco'>
  54. <p>If a server supports JID prep queries, it MUST specify the 'urn:xmpp:jidprep:0' feature in its service discovery information features as specified in &xep0030; and the Entity Capabilities profile specified in &xep0115;.</p>
  55. <example caption='Client checks for support by the server'><![CDATA[
  56. <iq type="get"
  57. to="capulet.lit"
  58. from="juliet@capulet.lit/balcony"
  59. id="info1">
  60. <query xmlns="http://jabber.org/protocol/disco#info"/>
  61. </iq>]]></example>
  62. <example caption='Server advertises support for JID prep queries'><![CDATA[
  63. <iq type="result"
  64. to="juliet@capulet.lit/balcony"
  65. from="capulet.lit"
  66. id="info1">
  67. <query xmlns="http://jabber.org/protocol/disco#info">
  68. ...
  69. <feature var="urn:xmpp:jidprep:0"/>
  70. ...
  71. </query>
  72. </iq>]]></example>
  73. <p>The JID prep service MAY be supported through the use of an external component (&xep0114;); in which case, the component MUST return an identity of "component/jidprep" in addition to the "urn:xmpp:jidprep:0" feature.</p>
  74. <example caption='Server component advertises support for JID prep queries'><![CDATA[
  75. <iq type="result"
  76. to="juliet@capulet.lit/balcony"
  77. from="jidprep.capulet.lit"
  78. id="info2">
  79. <query xmlns="http://jabber.org/protocol/disco#info">
  80. <identity category="component" type="jidprep" />
  81. ...
  82. <feature var="urn:xmpp:jidprep:0" />
  83. </query>
  84. </iq>]]></example>
  85. </section1>
  86. <section1 topic='Use Cases' anchor='usecases'>
  87. <p>In order to request prepping for a JID, the client sends an &IQ; stanza of type "get" to the server, containing a &lt;jid/&gt; element qualified by the 'urn:xmpp:jidprep:0' namespace and whose XML character data is the JID in question:</p>
  88. <example caption='Client requests the server to prep and normalize a JID'><![CDATA[
  89. <iq type="get"
  90. to="capulet.lit"
  91. id="prep1">
  92. <jid xmlns="urn:xmpp:jidprep:0">ROMeo@montague.lit/orchard</jid>
  93. </iq>
  94. ]]></example>
  95. <p>The server MUST return either an IQ-result or an IQ-error. When returning an IQ-result, the server sends an &IQ; staza of type='result' containing a &lt;jid/&gt; element qualifed by the 'urn:xmpp:jidprep:0' namespace and whose XML character data MUST be the prepped and normalized version of the requested JID:</p>
  96. <example caption='Server responds with the prepped JID'><![CDATA[
  97. <iq type="result"
  98. to="juliet@capulet.lit/balcony"
  99. from="capulet.lit"
  100. id="prep1">
  101. <jid xmlns="urn:xmpp:jidprep:0">romeo@montague.lit/orchard</jid>
  102. </iq>
  103. ]]></example>
  104. <p>If an IQ-error is returned, then it SHOULD specify an error condition of &lt;jid-malformed/&gt; if the given JID could not be processed to a normalized form:</p>
  105. <example caption='Server responds with an error for an invalid JID'><![CDATA[
  106. <iq type="error"
  107. to="juliet@capulet.lit/balcony"
  108. from="capulet.lit"
  109. id="prep1">
  110. <jid xmlns="urn:xmpp:jidprep:0">romeo@@montague.lit/orchard</jid>
  111. <error type="modify">
  112. <jid-malformed xmlns="urn:ietf:params:xml:ns:xmpp-stanzas" />
  113. </error>
  114. </iq>
  115. ]]></example>
  116. </section1>
  117. <section1 topic="Implementation Notes" anchor='impl'>
  118. <p>If a client has the ability to perform the prepping and normalization process itself, it SHOULD NOT make a JID prep request to the server.</p>
  119. <p>Upon a successful response, the client SHOULD cache the result, mapping the original JID to the normalized version.</p>
  120. <p>In order to reduce the number of queries made by clients, the server MUST enforce normalization rules for any JID slots understood by the server (e.g. the to and from attributes, roster item JIDs, etc).<note>This requirement is intended to be subsumed by the requirements introduced in &rfc6122bis;</note></p>
  121. </section1>
  122. <section1 topic='Security Considerations' anchor='security'>
  123. <p>As the process for normalizing a JID can be resource intensive, there is a possibility for denial of service attacks. A server MAY rate limit the number of requests to prevent such attacks. Likewise, the server MAY only respond to requests from users that are local to the server.</p>
  124. </section1>
  125. <section1 topic='IANA Considerations' anchor='iana'>
  126. <p>This document requires no interaction with &IANA;.</p>
  127. </section1>
  128. <section1 topic='XMPP Registrar Considerations' anchor='registrar'>
  129. <section2 topic='Protocol Namespaces' anchor='ns'>
  130. <p>The &REGISTRAR; includes 'urn:xmpp:jidprep:0' in its registry of protocol namespaces (see &NAMESPACES;).</p>
  131. <ul>
  132. <li>urn:xmpp:jidprep:0</li>
  133. </ul>
  134. </section2>
  135. <section2 topic='Protocol Versioning' anchor='registrar-versioning'>
  136. &NSVER;
  137. </section2>
  138. <section2 topic='Service Discovery Category/Type' anchor='registrar-disco'>
  139. <p>The &REGISTRAR; includes a category of "component" in its registry of Service Discovery identities (see &DISCOCATEGORIES;); as a result of this document, the Registrar includes a type of "jidprep" to that category.</p>
  140. <p>The registry submission is as follows:</p>
  141. <code><![CDATA[
  142. <category>
  143. <name>component</name>
  144. <type>
  145. <name>jidprep</name>
  146. <desc>
  147. A server component that offers a JID prepping
  148. and normalization service to constrained clients.
  149. </desc>
  150. <doc>XEP-0328</doc>
  151. </type>
  152. </category>
  153. ]]></code>
  154. </section2>
  155. </section1>
  156. <section1 topic='XML Schema' anchor='schema'>
  157. <code><![CDATA[
  158. <?xml version='1.0' encoding='UTF-8'?>
  159. <xs:schema
  160. xmlns:xs='http://www.w3.org/2001/XMLSchema'
  161. targetNamespace='urn:xmpp:jidprep:0'
  162. xmlns='urn:xmpp:jidprep:0'
  163. elementFormDefault='qualified'>
  164. <xs:annotation>
  165. <xs:documentation>
  166. The protocol documented by this schema is defined in
  167. XEP-xxxx: http://www.xmpp.org/extensions/xep-xxxx.html
  168. </xs:documentation>
  169. </xs:annotation>
  170. <xs:element name='jid'>
  171. <xs:complexType>
  172. <xs:simpleContent />
  173. </xs:complexType>
  174. </xs:element>
  175. </xs:schema>
  176. ]]></code>
  177. </section1>
  178. </xep>