2013-05-08 18:24:20 -04:00
|
|
|
|
<?xml version='1.0' encoding='UTF-8'?>
|
|
|
|
|
<!DOCTYPE xep SYSTEM 'xep.dtd' [
|
|
|
|
|
<!ENTITY % ents SYSTEM 'xep.ent'>
|
|
|
|
|
%ents;
|
|
|
|
|
]>
|
|
|
|
|
<?xml-stylesheet type='text/xsl' href='xep.xsl'?>
|
|
|
|
|
<xep>
|
|
|
|
|
<header>
|
2019-11-29 08:09:57 -05:00
|
|
|
|
<title>JID Preparation and Validation Service</title>
|
2019-09-12 03:59:34 -04:00
|
|
|
|
<abstract>This specification defines a way for an XMPP entity to request another entity to prepare and validate a given JID.</abstract>
|
2013-05-08 18:24:20 -04:00
|
|
|
|
&LEGALNOTICE;
|
2013-05-28 16:27:59 -04:00
|
|
|
|
<number>0328</number>
|
2019-09-12 03:59:34 -04:00
|
|
|
|
<status>Experimental</status>
|
2013-05-08 18:24:20 -04:00
|
|
|
|
<type>Standards Track</type>
|
|
|
|
|
<sig>Standards</sig>
|
|
|
|
|
<dependencies>
|
|
|
|
|
<spec>XMPP Core</spec>
|
|
|
|
|
<spec>XMPP IM</spec>
|
|
|
|
|
<spec>XEP-0030</spec>
|
|
|
|
|
</dependencies>
|
2013-05-28 16:27:59 -04:00
|
|
|
|
<supersedes/>
|
2013-05-08 18:24:20 -04:00
|
|
|
|
<supersededby/>
|
2019-09-12 03:59:34 -04:00
|
|
|
|
<shortname>jid-prep</shortname>
|
2013-05-08 18:24:20 -04:00
|
|
|
|
<author>
|
|
|
|
|
<firstname>Lance</firstname>
|
|
|
|
|
<surname>Stout</surname>
|
|
|
|
|
<email>lance@lance.im</email>
|
|
|
|
|
<jid>lance@lance.im</jid>
|
|
|
|
|
</author>
|
2019-09-12 03:59:34 -04:00
|
|
|
|
&flow;
|
|
|
|
|
<revision>
|
|
|
|
|
<version>0.2</version>
|
|
|
|
|
<date>2019-09-09</date>
|
|
|
|
|
<initials>fs</initials>
|
|
|
|
|
<remark>
|
|
|
|
|
<ul>
|
|
|
|
|
<li>Do not return error IQ result if the string to validate is
|
|
|
|
|
not a valid JID. It is indistinguishable if the error is
|
|
|
|
|
caused by the string to check, or if some other involved JID,
|
|
|
|
|
like the one in the 'to' attribute, is malformed.</li>
|
|
|
|
|
<li>Return the normalized JID in its parts, to make it clear
|
|
|
|
|
which parts constitute the JID</li>
|
|
|
|
|
<li>Do not use text as child of an IQ child element. Using
|
|
|
|
|
text makes it impossible to inject further child elements as
|
|
|
|
|
XMPP disallows mixed content.</li>
|
|
|
|
|
<li>Add support for base64 encoding.</li>
|
|
|
|
|
<li>Always announce the jidprep identity.</li>
|
|
|
|
|
</ul>
|
|
|
|
|
</remark>
|
|
|
|
|
</revision>
|
2013-05-28 16:27:59 -04:00
|
|
|
|
<revision>
|
|
|
|
|
<version>0.1</version>
|
|
|
|
|
<date>2013-05-28</date>
|
|
|
|
|
<initials>psa</initials>
|
|
|
|
|
<remark><p>Initial published version approved by the XMPP Council.</p></remark>
|
|
|
|
|
</revision>
|
2013-05-22 14:36:47 -04:00
|
|
|
|
<revision>
|
|
|
|
|
<version>0.0.2</version>
|
|
|
|
|
<date>2013-05-21</date>
|
|
|
|
|
<initials>lance</initials>
|
|
|
|
|
<remark><p>Incorporated feedback.</p></remark>
|
|
|
|
|
</revision>
|
2013-05-08 18:24:20 -04:00
|
|
|
|
<revision>
|
|
|
|
|
<version>0.0.1</version>
|
|
|
|
|
<date>2013-05-08</date>
|
|
|
|
|
<initials>lance</initials>
|
|
|
|
|
<remark><p>Initial version.</p></remark>
|
|
|
|
|
</revision>
|
|
|
|
|
</header>
|
2019-09-12 03:59:34 -04:00
|
|
|
|
|
2013-05-08 18:24:20 -04:00
|
|
|
|
<section1 topic='Introduction' anchor='intro'>
|
2019-09-12 03:59:34 -04:00
|
|
|
|
|
|
|
|
|
<p>To accurately compare and match JIDs, a normalization step is
|
|
|
|
|
required by &rfc7622;. This normalization is split into two steps
|
|
|
|
|
called 'Preparation' and 'Enforcement' by &rfc8264; and maybe
|
|
|
|
|
resource-intensive. The protocol defined herein, called "JID Prep"
|
|
|
|
|
can be used to ask XMPP entities to perform such a
|
|
|
|
|
normalization. Amongst other use-cases, this protocol can be used
|
|
|
|
|
for testing purposes, where a test suite checks the conformance of
|
|
|
|
|
an normalization implementation of, e.g., an XMPP server
|
|
|
|
|
implementation.</p>
|
|
|
|
|
|
|
|
|
|
<p>Furthermore, in some environments, especially ones like IoT where
|
|
|
|
|
devices with constraint resources are used, a client may not have
|
|
|
|
|
access to the various Unicode and internationalization libraries
|
|
|
|
|
necessary to properly normalize a JID. For those situations, this
|
|
|
|
|
protocol can be used by a client to ask a server to normalize a JID
|
|
|
|
|
on its behalf.</p>
|
|
|
|
|
|
2013-05-08 18:24:20 -04:00
|
|
|
|
</section1>
|
2019-09-12 03:59:34 -04:00
|
|
|
|
|
2013-05-08 18:24:20 -04:00
|
|
|
|
<section1 topic='Discovering support' anchor='disco'>
|
2019-09-12 03:59:34 -04:00
|
|
|
|
|
|
|
|
|
<p>If a server supports JID Prep queries, it MUST specify the
|
|
|
|
|
'urn:xmpp:jidprep:1' feature in its service discovery information
|
|
|
|
|
features as specified in &xep0030;.</p>
|
|
|
|
|
|
2013-05-08 18:24:20 -04:00
|
|
|
|
<example caption='Server advertises support for JID prep queries'><![CDATA[
|
2013-05-22 14:36:47 -04:00
|
|
|
|
<iq type="result"
|
|
|
|
|
to="juliet@capulet.lit/balcony"
|
|
|
|
|
from="capulet.lit"
|
|
|
|
|
id="info1">
|
|
|
|
|
<query xmlns="http://jabber.org/protocol/disco#info">
|
|
|
|
|
<identity category="component" type="jidprep" />
|
|
|
|
|
...
|
2019-09-12 03:59:34 -04:00
|
|
|
|
<feature var="urn:xmpp:jidprep:1" />
|
2013-05-08 18:24:20 -04:00
|
|
|
|
</query>
|
|
|
|
|
</iq>]]></example>
|
2019-09-12 03:59:34 -04:00
|
|
|
|
|
2013-05-08 18:24:20 -04:00
|
|
|
|
</section1>
|
2019-09-12 03:59:34 -04:00
|
|
|
|
|
2013-05-08 18:24:20 -04:00
|
|
|
|
<section1 topic='Use Cases' anchor='usecases'>
|
2019-09-12 03:59:34 -04:00
|
|
|
|
|
|
|
|
|
<p>To request preparation and enforcement, and thus normalization
|
|
|
|
|
and validation, of a string to a JID, the client sends a JID Prep
|
|
|
|
|
request to the service. This request is an &IQ; of type 'get',
|
|
|
|
|
containing a <jid-validate-request/> element qualified by the
|
|
|
|
|
'urn:xmpp:jidprep:1' namespace. This element contains a
|
|
|
|
|
<maybe-jid/> child element whose textual content is the string
|
|
|
|
|
to normalize to and validate as JID.</p>
|
|
|
|
|
|
|
|
|
|
<example caption='JID prep request (valid JID)'><![CDATA[
|
|
|
|
|
<iq type='get'
|
|
|
|
|
from='user@example.org/resource'
|
|
|
|
|
to='example.org'
|
|
|
|
|
id='request1'>
|
|
|
|
|
<jid-validate-request xmlns='urn:xmpp:jidprep:1'>
|
|
|
|
|
<maybe-jid>Σ@example.com/resource</maybe-jid>
|
|
|
|
|
</jid-validate-request>
|
|
|
|
|
</iq>]]></example>
|
|
|
|
|
|
|
|
|
|
<p>If the given string can be enforced to a valid JID, then a
|
|
|
|
|
<jid-validate-result/> with a <valid-jid/> child
|
|
|
|
|
element is returned. This child element contains the normalized
|
|
|
|
|
JID parts. The valid-jid element MUST contain <domainpart/>
|
|
|
|
|
and may contain <localpart/> and/or <resourcepart/>
|
|
|
|
|
elements. If the JID does not contain a local- or resourcepart,
|
|
|
|
|
then the corresponding element is omitted. Those elements contain the
|
|
|
|
|
normalized, i.e., PRECIS enforced, strings of the own JID
|
|
|
|
|
parts.</p>
|
|
|
|
|
|
|
|
|
|
<example caption='Valid JID result'><![CDATA[
|
|
|
|
|
<iq type='result'
|
|
|
|
|
from='example.org'
|
|
|
|
|
to='user@example.org/resource'
|
|
|
|
|
id='request1'>
|
|
|
|
|
<jid-validate-result xmlns='urn:xmpp:jidprep:1'>
|
|
|
|
|
<valid-jid>
|
|
|
|
|
<localpart>σ</localpart>
|
|
|
|
|
<domainpart>example.com</domainpart>
|
|
|
|
|
<resourcepart>resource</resourcepart>
|
|
|
|
|
<valid-jid>
|
|
|
|
|
</jid-validate-result>
|
|
|
|
|
</iq>]]></example>
|
|
|
|
|
|
|
|
|
|
<p>If the service is given an invalid JID, a
|
|
|
|
|
<jid-validate-result/> IQ result response with an
|
|
|
|
|
<invalid-jid/> elmeent is returned.</p>
|
|
|
|
|
|
|
|
|
|
<example caption='JID Prep request (invalid JID)'><![CDATA[
|
|
|
|
|
<iq type='get'
|
|
|
|
|
from='user@example.org/resource'
|
|
|
|
|
to='example.org'
|
|
|
|
|
id='request2'>
|
|
|
|
|
<jid-validate-request xmlns='urn:xmpp:jidprep:1'>
|
|
|
|
|
<maybe-jid>henryⅣ@example.com</maybe-jid>
|
|
|
|
|
</jid-validate-request>
|
|
|
|
|
</iq>]]></example>
|
|
|
|
|
|
|
|
|
|
<example caption='Invalid JID result'><![CDATA[
|
|
|
|
|
<iq type='result'
|
|
|
|
|
from='example.org'
|
|
|
|
|
to='user@example.org/resource'
|
|
|
|
|
id='request2'>
|
|
|
|
|
<jid-validate-result xmlns='urn:xmpp:jidprep:1'>
|
|
|
|
|
<invalid-jid>
|
|
|
|
|
<reason>Invalid codepoint 'Ⅳ' in localpart.</reason>
|
|
|
|
|
</invalid-jid>
|
|
|
|
|
</jid-validate-result>
|
|
|
|
|
</iq>]]></example>
|
|
|
|
|
|
|
|
|
|
</section1>
|
|
|
|
|
|
|
|
|
|
<section1 topic='Optional Base64 Encoding' anchor='base64'>
|
|
|
|
|
|
|
|
|
|
<p>To be able to feed arbitrary strings into the validator, not
|
|
|
|
|
being limited by XML 1.0, the protocol supports an optional Base64
|
|
|
|
|
encoding of the string to validate. The requestor first encodes the
|
|
|
|
|
string to UTF-8, then encodes the UTF-8 byte-sequence using Base64
|
|
|
|
|
(&rfc4648; <link
|
|
|
|
|
url='https://tools.ietf.org/html/rfc4648#section-4'>§ 4</link>) and
|
|
|
|
|
places the result into an <base64-maybe-jid/> element. This
|
|
|
|
|
element is a put under the <jid-validate-base64-request/> IQ
|
|
|
|
|
child element qualified by the 'urn:xmpp:jidprep:1' namespace.</p>
|
|
|
|
|
|
|
|
|
|
<p>The IQ respones of the service are identical to the ones of the
|
|
|
|
|
non-Base64 case.</p>
|
|
|
|
|
|
|
|
|
|
<p>If supported, service announces 'urn:xmpp:jidprep:base64:1'
|
|
|
|
|
feature.</p>
|
|
|
|
|
|
|
|
|
|
<example caption='JID Prep request using Base64'><![CDATA[
|
|
|
|
|
<iq type='get'
|
|
|
|
|
from='user@example.org/resource'
|
|
|
|
|
to='example.org'
|
|
|
|
|
id='request1'>
|
|
|
|
|
<jid-validate-base64-request xmlns='urn:xmpp:jidprep:1'>
|
|
|
|
|
<base64-maybe-jid>zqNAZXhhbXBsZS5jb20vcmVzb3VyY2U=</base64-maybe-jid>
|
|
|
|
|
</jid-validate-base64-request>
|
|
|
|
|
</iq>]]></example>
|
|
|
|
|
|
2013-05-08 18:24:20 -04:00
|
|
|
|
</section1>
|
2019-09-12 03:59:34 -04:00
|
|
|
|
|
2013-05-08 18:24:20 -04:00
|
|
|
|
<section1 topic="Implementation Notes" anchor='impl'>
|
2019-09-12 03:59:34 -04:00
|
|
|
|
|
|
|
|
|
<p>If a client has the ability to perform the normalization process
|
|
|
|
|
itself, it SHOULD NOT make use of the protocol defined herein.</p>
|
|
|
|
|
|
|
|
|
|
<p>Upon a successful response, it is RECOMMENDED that the client
|
|
|
|
|
caches the result, mapping the original JID to the normalized
|
|
|
|
|
version.</p>
|
|
|
|
|
|
2013-05-08 18:24:20 -04:00
|
|
|
|
</section1>
|
2019-09-12 03:59:34 -04:00
|
|
|
|
|
2013-05-08 18:24:20 -04:00
|
|
|
|
<section1 topic='Security Considerations' anchor='security'>
|
2019-09-12 03:59:34 -04:00
|
|
|
|
|
|
|
|
|
<p>As the process for normalizing and validating 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 restrict access to the
|
|
|
|
|
service torequests from users that are local to the server or
|
|
|
|
|
otherwhise trusted.</p>
|
|
|
|
|
|
2013-05-08 18:24:20 -04:00
|
|
|
|
</section1>
|
2019-09-12 03:59:34 -04:00
|
|
|
|
|
2013-05-08 18:24:20 -04:00
|
|
|
|
<section1 topic='IANA Considerations' anchor='iana'>
|
|
|
|
|
<p>This document requires no interaction with &IANA;.</p>
|
|
|
|
|
</section1>
|
2019-09-12 03:59:34 -04:00
|
|
|
|
|
2013-05-08 18:24:20 -04:00
|
|
|
|
<section1 topic='XMPP Registrar Considerations' anchor='registrar'>
|
2019-09-12 03:59:34 -04:00
|
|
|
|
|
2013-05-08 18:24:20 -04:00
|
|
|
|
<section2 topic='Protocol Namespaces' anchor='ns'>
|
2019-09-12 03:59:34 -04:00
|
|
|
|
|
|
|
|
|
<p>The ®ISTRAR; includes 'urn:xmpp:jidprep:1' in its registry of protocol namespaces (see &NAMESPACES;).</p>
|
|
|
|
|
|
2013-05-08 18:24:20 -04:00
|
|
|
|
<ul>
|
2019-09-12 03:59:34 -04:00
|
|
|
|
<li>urn:xmpp:jidprep:1</li>
|
2013-05-08 18:24:20 -04:00
|
|
|
|
</ul>
|
2019-09-12 03:59:34 -04:00
|
|
|
|
|
2013-05-08 18:24:20 -04:00
|
|
|
|
</section2>
|
2019-09-12 03:59:34 -04:00
|
|
|
|
|
2013-05-08 18:24:20 -04:00
|
|
|
|
<section2 topic='Protocol Versioning' anchor='registrar-versioning'>
|
|
|
|
|
&NSVER;
|
|
|
|
|
</section2>
|
2019-09-12 03:59:34 -04:00
|
|
|
|
|
2013-05-08 18:24:20 -04:00
|
|
|
|
</section1>
|
2019-09-12 03:59:34 -04:00
|
|
|
|
|
2013-05-08 18:24:20 -04:00
|
|
|
|
<section1 topic='XML Schema' anchor='schema'>
|
|
|
|
|
|
2019-09-12 03:59:34 -04:00
|
|
|
|
<p>TODO: Add once the XEP leaves the experimental state.</p>
|
|
|
|
|
|
2013-05-08 18:24:20 -04:00
|
|
|
|
</section1>
|
2019-09-12 03:59:34 -04:00
|
|
|
|
|
2013-05-08 18:24:20 -04:00
|
|
|
|
</xep>
|