mirror of
https://github.com/moparisthebest/xeps
synced 2024-11-22 01:02:17 -05:00
297 lines
14 KiB
XML
297 lines
14 KiB
XML
|
<?xml version="1.0" encoding="UTF-8"?>
|
||
|
<!DOCTYPE jep SYSTEM '../jep.dtd' [
|
||
|
<!ENTITY % ents SYSTEM '../jep.ent'>
|
||
|
%ents;
|
||
|
]>
|
||
|
<?xml-stylesheet type='text/xsl' href='../jep.xsl'?>
|
||
|
<jep>
|
||
|
<header>
|
||
|
<title>Feature Negotiation</title>
|
||
|
<abstract>This JEP defines a A protocol that enables two Jabber entities to mutually negotiate feature options.</abstract>
|
||
|
&LEGALNOTICE;
|
||
|
<number>0020</number>
|
||
|
<status>Draft</status>
|
||
|
<type>Standards Track</type>
|
||
|
<jig>Standards JIG</jig>
|
||
|
<dependencies>
|
||
|
<spec>XMPP Core</spec>
|
||
|
<spec>JEP-0004</spec>
|
||
|
</dependencies>
|
||
|
<supersedes/>
|
||
|
<supersededby/>
|
||
|
<shortname>feature-neg</shortname>
|
||
|
<schemaloc>
|
||
|
<url>http://jabber.org/protocol/feature-neg/feature-neg.xsd</url>
|
||
|
</schemaloc>
|
||
|
&pgmillard;
|
||
|
&stpeter;
|
||
|
<revision>
|
||
|
<version>1.4</version>
|
||
|
<date>2004-05-21</date>
|
||
|
<initials>psa</initials>
|
||
|
<remark>Moved remaining feature negotiation text from JEP-0030 to this document.</remark>
|
||
|
</revision>
|
||
|
<revision>
|
||
|
<version>1.3</version>
|
||
|
<date>2004-04-23</date>
|
||
|
<initials>psa</initials>
|
||
|
<remark>Per Council discussion, changed root element from <query/> to <feature/> for the sake of consistency with using protocols; moved some text from JEP-0030 to this document.</remark>
|
||
|
</revision>
|
||
|
<revision>
|
||
|
<version>1.2</version>
|
||
|
<date>2004-03-08</date>
|
||
|
<initials>psa</initials>
|
||
|
<remark>Added XMPP error handling; clarified the text; corrected the examples; fixed an error in the schema; added numerous references.</remark>
|
||
|
</revision>
|
||
|
<revision>
|
||
|
<version>1.1</version>
|
||
|
<date>2003-02-16</date>
|
||
|
<initials>psa</initials>
|
||
|
<remark>Made corrections to the text; added security and IANA considerations; added schema.</remark>
|
||
|
</revision>
|
||
|
<revision>
|
||
|
<version>1.0</version>
|
||
|
<date>2002-12-06</date>
|
||
|
<initials>psa</initials>
|
||
|
<remark>Per a vote of the Jabber Council, revision 0.4 was advanced to Draft on 2002-12-06.</remark>
|
||
|
</revision>
|
||
|
<revision>
|
||
|
<version>0.4</version>
|
||
|
<date>2002-11-17</date>
|
||
|
<initials>pgm</initials>
|
||
|
<remark>Changed protocol to use jabber:x:data.</remark>
|
||
|
</revision>
|
||
|
<revision>
|
||
|
<version>0.3</version>
|
||
|
<date>2002-10-01</date>
|
||
|
<initials>pgm</initials>
|
||
|
<remark>Added some extra text to help clarify protocol & purpose.</remark>
|
||
|
</revision>
|
||
|
<revision>
|
||
|
<version>0.2</version>
|
||
|
<date>2002-05-22</date>
|
||
|
<initials>pgm</initials>
|
||
|
<remark>Changed examples.</remark>
|
||
|
</revision>
|
||
|
<revision>
|
||
|
<version>0.1</version>
|
||
|
<date>2002-02-26</date>
|
||
|
<initials>pgm</initials>
|
||
|
<remark>Initial version.</remark>
|
||
|
</revision>
|
||
|
</header>
|
||
|
<section1 topic="Introduction" anchor='intro'>
|
||
|
<p>A discovery protocol such as &jep0030; enables Jabber entities to query other entities regarding the features they support, but does not provide a means for the two entities to negotiate specific options related to the advertised features (e.g., specific methods of file transfer such as &jep0047; or &jep0065;).</p>
|
||
|
<p>The protocol defined herein enables Jabber entities to negotiate options for specific features. These features could be negotiated between any two endpoints on the Jabber network, such as two clients, a client and a component, two components, a client and a server, or two servers. The protocol is generic enough that it can be used whenever options need to be negotiated between two Jabber entities.</p>
|
||
|
</section1>
|
||
|
<section1 topic="Protocol Details" anchor='protocol'>
|
||
|
<p>Features are negotiated though the exchange of &IQ; stanzas containing &QUERY; child elements qualified by the 'http://jabber.org/protocol/feature-neg' namespace. However, this &QUERY; element is simply a wrapper for structured data encapsulated in the &jep0004; protocol. <note>Earlier versions of this JEP defined an structured data format to handle the feature negotiation workflow; versions later than 0.4 use <strong>Data Forms</strong>, i.e., the 'jabber:x:data' namespace.</note></p>
|
||
|
<p>In order to begin a negotation, the initiator sends an &IQ; stanza of type "get" to the recipient with a single <feature/> element containing a data form of type "form" which defines the available options for one or more features. Each feature is represented as an x-data "field", which MUST be of type "list-single" as specified in JEP-0004.</p>
|
||
|
<p>The recipient SHOULD examine each feature and the options provided. In order to indicate preferred options, the recipient then SHOULD specify one option for each feature and return a data form of type "submit" to the initiator in an &IQ; stanza of type "result".</p>
|
||
|
<p>The following examples show some likely scenarios for feature negotiation between entities. Further examples can be found in using protocols, such as &jep0096;.</p>
|
||
|
<section2 topic="Basic Flow" anchor='protocol-basic'>
|
||
|
<p>A typical negotiation flow is shown in the following example of two entities negotiating the time and place for a meeting.</p>
|
||
|
<example caption="Initiating entity sends offer"><![CDATA[
|
||
|
<iq type='get'
|
||
|
from='romeo@montague.net/orchard'
|
||
|
to='juliet@capulet.com/balcony'
|
||
|
id='neg1'>
|
||
|
<feature xmlns='http://jabber.org/protocol/feature-neg'>
|
||
|
<x xmlns='jabber:x:data' type='form'>
|
||
|
<field type='list-single' var='places-to-meet'>
|
||
|
<option><value>Lover's Lane</value></option>
|
||
|
<option><value>Secret Grotto</value></option>
|
||
|
<option><value>Verona Park</value></option>
|
||
|
</field>
|
||
|
<field type='list-single' var='times-to-meet'>
|
||
|
<option><value>22:00</value></option>
|
||
|
<option><value>22:30</value></option>
|
||
|
<option><value>23:00</value></option>
|
||
|
<option><value>23:30</value></option>
|
||
|
</field>
|
||
|
</x>
|
||
|
</feature>
|
||
|
</iq>
|
||
|
]]></example>
|
||
|
<example caption="Responding entity sends preferred option values"><![CDATA[
|
||
|
<iq type='result'
|
||
|
id='neg1'
|
||
|
from='juliet@jabber.org/balcony'
|
||
|
to='romeo@montague.net/orchard'>
|
||
|
<feature xmlns='http://jabber.org/protocol/feature-neg'>
|
||
|
<x xmlns='jabber:x:data' type='submit'>
|
||
|
<field var='places-to-meet'>
|
||
|
<value>Secret Grotto</value>
|
||
|
</field>
|
||
|
<field var='times-to-meet'>
|
||
|
<value>22:30</value>
|
||
|
</field>
|
||
|
</x>
|
||
|
</feature>
|
||
|
</iq>
|
||
|
]]></example>
|
||
|
<p>If the responding entity does not support one or more of the features, it MUST return a &feature; error, and SHOULD specify the feature(s) not implemented in the XMPP <text/> element.</p>
|
||
|
<example caption="Responding entity does not support a feature"><![CDATA[
|
||
|
<iq type='error'
|
||
|
id='neg1'
|
||
|
from='juliet@jabber.org/balcony'
|
||
|
to='romeo@montague.net/orchard'>
|
||
|
<error code='501' type='cancel'>
|
||
|
<feature-not-implemented xmlns='urn:ietf:params:xml:ns:xmpp-stanzas'/>
|
||
|
<text xmlns='urn:ietf:params:xml:ns:xmpp-stanzas'>times-to-meet</text>
|
||
|
</error>
|
||
|
</iq>
|
||
|
]]></example>
|
||
|
<p>If the responding entity supports none of the options offered for a certain feature, it MUST return a ¬acceptable; error, and SHOULD specify the relevant feature in the XMPP <text/> element.</p>
|
||
|
<example caption="Responding entity supports no options"><![CDATA[
|
||
|
<iq type='error'
|
||
|
from='juliet@jabber.org/balcony'
|
||
|
to='romeo@montague.net/orchard'
|
||
|
id='neg1'>
|
||
|
<error code='406' type='modify'>
|
||
|
<not-acceptable xmlns='urn:ietf:params:xml:ns:xmpp-stanzas'/>
|
||
|
<text xmlns='urn:ietf:params:xml:ns:xmpp-stanzas'>places-to-meet</text>
|
||
|
</error>
|
||
|
</iq>
|
||
|
]]></example>
|
||
|
</section2>
|
||
|
<section2 topic="Querying for Negotiable Features" anchor='protocol-query'>
|
||
|
<p>If at least one feature offered by an entity is subject to &jep0020;, the entity's response to a service discovery information request MUST include <feature var='http://jabber.org/protocol/feature-neg'/> as one of the features.</p>
|
||
|
<example caption='Client queries a chatroom for supported features'><![CDATA[
|
||
|
<iq type='get'
|
||
|
from='juliet@capulet.com/balcony'
|
||
|
to='balconyscene@plays.shakespeare.lit'
|
||
|
id='neg1'>
|
||
|
<query xmlns='http://jabber.org/protocol/disco#info'/>
|
||
|
</iq>]]></example>
|
||
|
<example caption='Chatroom returns supported features'><![CDATA[
|
||
|
<iq type='result'
|
||
|
from='balconyscene@plays.shakespeare.lit'
|
||
|
to='juliet@capulet.com/balcony'
|
||
|
id='neg1'>
|
||
|
<query xmlns='http://jabber.org/protocol/disco#info'>
|
||
|
...
|
||
|
<feature var='http://jabber.org/protocol/feature-neg'/>
|
||
|
<feature var='muc-password'/>
|
||
|
...
|
||
|
</query>
|
||
|
</iq>]]></example>
|
||
|
<p>The using protocol (in these examples, &jep0045;) SHOULD specify which features might be negotiable, either in the relevant documentation or in the entry for that feature in the service discovery features registry maintained by the Jabber Registrar. However, the requesting entity MAY also query the responding entity in order to determine which features are negotiable, as shown below.</p>
|
||
|
<example caption='Client queries a chatroom for supported features'><![CDATA[
|
||
|
<iq type='get'
|
||
|
from='juliet@capulet.com/balcony'
|
||
|
to='balconyscene@plays.shakespeare.lit'
|
||
|
id='neg1'>
|
||
|
<query xmlns='http://jabber.org/protocol/disco#info'/>
|
||
|
</iq>]]></example>
|
||
|
<example caption='Chatroom returns supported features'><![CDATA[
|
||
|
<iq type='result'
|
||
|
from='balconyscene@plays.shakespeare.lit'
|
||
|
to='juliet@capulet.com/balcony'
|
||
|
id='neg1'>
|
||
|
<query xmlns='http://jabber.org/protocol/disco#info'>
|
||
|
...
|
||
|
<feature var='http://jabber.org/protocol/feature-neg'/>
|
||
|
<feature var='muc-password'/>
|
||
|
...
|
||
|
</query>
|
||
|
</iq>]]></example>
|
||
|
<p>The using protocol (in these examples, <cite>JEP-0045</cite>) SHOULD specify which features might be negotiable, either in the relevant documentation or in the entry for that feature in the service discovery features registry maintained by the Jabber Registrar (see <<link url='http://www.jabber.org/registrar/disco-vars.html'>http://www.jabber.org/registrar/disco-vars.html</link>>). However, the requesting entity MAY also query the responding entity in order to determine which features are negotiable, as shown below.</p>
|
||
|
<example caption='Client queries chatroom regarding options for a negotiable feature'><![CDATA[
|
||
|
<iq type='get'
|
||
|
from='juliet@capulet.com/balcony'
|
||
|
to='balconyscene@plays.shakespeare.lit'
|
||
|
id='neg2'>
|
||
|
<feature xmlns='http://jabber.org/protocol/feature-neg'>
|
||
|
<x xmlns='jabber:x:data' type='submit'>
|
||
|
<field var='muc-password'/>
|
||
|
</x>
|
||
|
</feature>
|
||
|
</iq>]]></example>
|
||
|
<p>If that feature is not negotiable, the responding entity MUST return a "Feature Not Implemented" error:</p>
|
||
|
<example caption='Chatroom returns error'><![CDATA[
|
||
|
<iq type='result'
|
||
|
from='balconyscene@plays.shakespeare.lit'
|
||
|
to='juliet@capulet.com/balcony'
|
||
|
id='neg2'>
|
||
|
<feature xmlns='http://jabber.org/protocol/feature-neg'>
|
||
|
<x xmlns='jabber:x:data' type='result'>
|
||
|
<field var='muc-password' type='list-single'>
|
||
|
<option><value>cleartext</value></option>
|
||
|
<option><value>SHA1</value></option>
|
||
|
<option><value>SASL</value></option>
|
||
|
</field>
|
||
|
</x>
|
||
|
</feature>
|
||
|
<error code='501' type='cancel'>
|
||
|
<feature-not-implemented xmlns='urn:ietf:params:xml:ns:xmpp-stanzas'/>
|
||
|
</error>
|
||
|
</iq>]]></example>
|
||
|
<p>If that feature is negotiable, the responding entity MUST return an appropriate negotiation form:</p>
|
||
|
<example caption='Chatroom returns negotiation form'><![CDATA[
|
||
|
<iq type='result'
|
||
|
from='balconyscene@plays.shakespeare.lit'
|
||
|
to='juliet@capulet.com/balcony'
|
||
|
id='neg2'>
|
||
|
<feature xmlns='http://jabber.org/protocol/feature-neg'>
|
||
|
<x xmlns='jabber:x:data' type='result'>
|
||
|
<field var='muc-password' type='list-single'>
|
||
|
<option><value>cleartext</value></option>
|
||
|
<option><value>SHA1</value></option>
|
||
|
<option><value>SASL</value></option>
|
||
|
</field>
|
||
|
</x>
|
||
|
</feature>
|
||
|
</iq>]]></example>
|
||
|
<p>The requesting entity MAY then submit a data form containing the required information.</p>
|
||
|
</section2>
|
||
|
</section1>
|
||
|
|
||
|
<section1 topic='Security Considerations' anchor='security'>
|
||
|
<p>Security considerations are the responsibility of the using protocol.</p>
|
||
|
</section1>
|
||
|
|
||
|
<section1 topic='IANA Considerations' anchor='iana'>
|
||
|
<p>This JEP requires no interaction with &IANA;.</p>
|
||
|
</section1>
|
||
|
|
||
|
<section1 topic="Jabber Registrar Considerations" anchor='registrar'>
|
||
|
<p>In order for Jabber entities to adequately leverage <strong>Data Forms</strong> (e.g., by using machine-readable fields), it is RECOMMENDED to register standard x-data fields with the ®ISTRAR; via the mechanisms defined in &jep0068;. Whether to do so for any given features and options shall be determined by the using protocol.</p>
|
||
|
</section1>
|
||
|
|
||
|
<section1 topic='XML Schema' anchor='schema'>
|
||
|
<code><![CDATA[
|
||
|
<?xml version='1.0' encoding='UTF-8'?>
|
||
|
|
||
|
<xs:schema
|
||
|
xmlns:xs='http://www.w3.org/2001/XMLSchema'
|
||
|
targetNamespace='http://jabber.org/protocol/feature-neg'
|
||
|
xmlns='http://jabber.org/protocol/feature-neg'
|
||
|
elementFormDefault='qualified'>
|
||
|
|
||
|
<xs:import
|
||
|
namespace='jabber:x:data'
|
||
|
schemaLocation='http://jabber.org/protocol/x-data/x-data.xsd'/>
|
||
|
|
||
|
<xs:annotation>
|
||
|
<xs:documentation>
|
||
|
The protocol documented by this schema is defined in
|
||
|
JEP-0020: http://www.jabber.org/jeps/jep-0020.html
|
||
|
</xs:documentation>
|
||
|
</xs:annotation>
|
||
|
|
||
|
<xs:element name='feature'>
|
||
|
<xs:complexType>
|
||
|
<xs:sequence xmlns:data='jabber:x:data'>
|
||
|
<xs:element ref='data:x'/>
|
||
|
</xs:sequence>
|
||
|
</xs:complexType>
|
||
|
|
||
|
</xs:schema>
|
||
|
]]></code>
|
||
|
</section1>
|
||
|
<section1 topic='Author Note' anchor='authornote'>
|
||
|
<p>Peter Millard, the primary author of this specification from version 0.1 through version 1.4, died on April 26, 2006. The remaining author is thankful for Peter's work on this specification.</p>
|
||
|
</section1>
|
||
|
</jep>
|