1.5 RC2 added FORM_TYPEs, Security Considerations and service-unavailable error

git-svn-id: file:///home/ksmith/gitmigration/svn/xmpp/trunk@121 4b5297f7-1745-476d-ba37-a9c6900126ab
This commit is contained in:
Ian Paterson 2006-10-20 19:28:11 +00:00
parent 022d6234f5
commit 8ceecc55e7
1 changed files with 56 additions and 17 deletions

View File

@ -29,7 +29,7 @@
<version>1.5</version>
<date>2006-10-20</date>
<initials>ip</initials>
<remark>Various updates and corrections avoiding material changes.</remark>
<remark>Added FORM_TYPEs to examples; added service-unavailable error and Security Considerations; various other updates and corrections avoiding material changes.</remark>
</revision>
<revision>
<version>1.4</version>
@ -92,7 +92,7 @@
</section1>
<section1 topic="Protocol Details" anchor='protocol'>
<p>Features are negotiated though the exchange of &IQ; or &MESSAGE; stanzas containing &lt;feature/&gt; child elements qualified by the 'http://jabber.org/protocol/feature-neg' namespace. However, this &lt;feature/&gt; element is simply a wrapper for structured data encapsulated in the &xep0004; protocol. <note>Earlier versions of this document defined a structured data format to handle the feature negotiation workflow; versions later than 0.4 use <cite>Data Forms</cite>, 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" (or a &MESSAGE; stanza type "normal") to the recipient with a single &lt;feature/&gt; 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".</p>
<p>In order to begin a negotation, the initiator sends an &IQ; stanza of type "get" (or a &MESSAGE; stanza type "normal" - see <cite>Chat Session Negotiation</cite> for examples) to the recipient with a single &lt;feature/&gt; 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".</p>
<p>The recipient SHOULD examine each feature and the values of the options provided. In order to indicate preferred values, the recipient then SHOULD specify one value for each feature and return a data form of type "submit" to the initiator in an &IQ; stanza of type "result" (or a &MESSAGE; stanza type "normal").</p>
<p>The following examples show some likely scenarios for feature negotiation between entities. Further examples can be found in using protocols, such as <cite>File Transfer</cite>.</p>
<section2 topic="Basic Flow" anchor='protocol-basic'>
@ -104,8 +104,10 @@
id='neg1'>
<feature xmlns='http://jabber.org/protocol/feature-neg'>
<x xmlns='jabber:x:data' type='form'>
<field var='FORM_TYPE' type='hidden'>
<value>romantic_meetings</value>
</field>
<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>
@ -113,7 +115,6 @@
<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>
@ -126,6 +127,9 @@
to='romeo@montague.net/orchard'>
<feature xmlns='http://jabber.org/protocol/feature-neg'>
<x xmlns='jabber:x:data' type='submit'>
<field var='FORM_TYPE'>
<value>romantic_meetings</value>
</field>
<field var='places-to-meet'>
<value>Secret Grotto</value>
</field>
@ -136,24 +140,60 @@
</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 &lt;text/&gt; element.</p>
<p>Note: If the responding entity does not want to reveal presence to the initiating entity for whatever reason then the responding entity's client SHOULD return a &unavailable; error (or return no response or error whatsoever if the offer was wrapped in a &MESSAGE; stanza) - see <link url='#security'>Security Considerations</link>.</p>
<p>If the responding entity does not support <strong>Feature Negotiation</strong> or does not support the specified FORM_TYPE, it SHOULD also return a &unavailable; error:</p>
<example caption="Responding entity does not support feature negotiation"><![CDATA[
<iq type='error'
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='form'>
<field var='FORM_TYPE' type='hidden'>
<value>romantic_meetings</value>
</field>
...
</x>
</feature>
<error code='503' type='cancel'>
<service-unavailable xmlns='urn:ietf:params:xml:ns:xmpp-stanzas'/>
</error>
</iq>
]]></example>
<p>If the responding entity does not support one or more of the features, it SHOULD return a &feature; error, and SHOULD specify the feature(s) not implemented in the XMPP &lt;text/&gt; 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'>
<feature xmlns='http://jabber.org/protocol/feature-neg'>
<x xmlns='jabber:x:data' type='form'>
<field var='FORM_TYPE' type='hidden'>
<value>romantic_meetings</value>
</field>
...
</x>
</feature>
<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 one or more of the features, it MUST return a &notacceptable; error, and SHOULD specify the relevant feature(s) in the XMPP &lt;text/&gt; element.</p>
<p>If the responding entity supports none of the options offered for one or more of the features, it SHOULD return a &notacceptable; error, and SHOULD specify the relevant feature(s) in the XMPP &lt;text/&gt; 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'>
<feature xmlns='http://jabber.org/protocol/feature-neg'>
<x xmlns='jabber:x:data' type='form'>
<field var='FORM_TYPE' type='hidden'>
<value>romantic_meetings</value>
</field>
...
</x>
</feature>
<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>
@ -182,7 +222,7 @@
...
</query>
</iq>]]></example>
<p>The using protocol (in these examples, &xep0045;) 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 &REGISTRAR;. However, the requesting entity MAY also query the responding entity in order to determine which features are negotiable, as shown below.</p>
<p>The using protocol (in these examples, &xep0045;) 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 &REGISTRAR;. However, the initiating 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'
@ -194,26 +234,22 @@
</x>
</feature>
</iq>]]></example>
<p>If that feature is not negotiable, the responding entity MUST return a "Feature Not Implemented" error:</p>
<p>If that feature is not negotiable, the responding entity SHOULD 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 xmlns='jabber:x:data' type='submit'>
<field var='muc-password'/>
</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>
<p>If that feature is negotiable, the responding entity SHOULD return an appropriate negotiation form:</p>
<example caption='Chatroom returns negotiation form'><![CDATA[
<iq type='result'
from='balconyscene@plays.shakespeare.lit'
@ -221,6 +257,9 @@
id='neg2'>
<feature xmlns='http://jabber.org/protocol/feature-neg'>
<x xmlns='jabber:x:data' type='result'>
<field var='FORM_TYPE'>
<value>MUC</value>
</field>
<field var='muc-password' type='list-single'>
<option><value>cleartext</value></option>
<option><value>SHA1</value></option>
@ -229,12 +268,12 @@
</x>
</feature>
</iq>]]></example>
<p>The requesting entity MAY then submit a data form containing the required information.</p>
<p>The initiating 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>
<p>If the responding entity responds to the initiating entity or returns an error (other than a &unavailable; response to an &IQ; request), the initiating entity will effectively discover the presence of the responding entity's resource. Due care must therefore be exercised in determining how to respond (or whether to respond at all to a &MESSAGE; request). For examples, the responding entity SHOULD NOT <em>automatically</em> (i.e. without first asking its human user) either respond to the initiating entity's request or return a specific error unless the initiating entity is subscribing to the responding entity's presence (and the responding entity's presence is not currently "invisible" to the initiating entity). Note: There should be no need for the responding entity's client to consult its block list, since if the initiating entity is on the list then the responding entity would not receive any requests from the initiating entity anyway.</p>
</section1>
<section1 topic='IANA Considerations' anchor='iana'>