1
0
mirror of https://github.com/moparisthebest/xeps synced 2024-12-21 23:28:51 -05:00

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

View File

@ -29,7 +29,7 @@
<version>1.5</version> <version>1.5</version>
<date>2006-10-20</date> <date>2006-10-20</date>
<initials>ip</initials> <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>
<revision> <revision>
<version>1.4</version> <version>1.4</version>
@ -92,7 +92,7 @@
</section1> </section1>
<section1 topic="Protocol Details" anchor='protocol'> <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>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 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> <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'> <section2 topic="Basic Flow" anchor='protocol-basic'>
@ -104,8 +104,10 @@
id='neg1'> id='neg1'>
<feature xmlns='http://jabber.org/protocol/feature-neg'> <feature xmlns='http://jabber.org/protocol/feature-neg'>
<x xmlns='jabber:x:data' type='form'> <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'> <field type='list-single' var='places-to-meet'>
<option><value>Lover's Lane</value></option>
<option><value>Secret Grotto</value></option> <option><value>Secret Grotto</value></option>
<option><value>Verona Park</value></option> <option><value>Verona Park</value></option>
</field> </field>
@ -113,7 +115,6 @@
<option><value>22:00</value></option> <option><value>22:00</value></option>
<option><value>22:30</value></option> <option><value>22:30</value></option>
<option><value>23:00</value></option> <option><value>23:00</value></option>
<option><value>23:30</value></option>
</field> </field>
</x> </x>
</feature> </feature>
@ -126,6 +127,9 @@
to='romeo@montague.net/orchard'> to='romeo@montague.net/orchard'>
<feature xmlns='http://jabber.org/protocol/feature-neg'> <feature xmlns='http://jabber.org/protocol/feature-neg'>
<x xmlns='jabber:x:data' type='submit'> <x xmlns='jabber:x:data' type='submit'>
<field var='FORM_TYPE'>
<value>romantic_meetings</value>
</field>
<field var='places-to-meet'> <field var='places-to-meet'>
<value>Secret Grotto</value> <value>Secret Grotto</value>
</field> </field>
@ -136,24 +140,60 @@
</feature> </feature>
</iq> </iq>
]]></example> ]]></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[ <example caption="Responding entity does not support a feature"><![CDATA[
<iq type='error' <iq type='error'
id='neg1' id='neg1'
from='juliet@jabber.org/balcony' from='juliet@jabber.org/balcony'
to='romeo@montague.net/orchard'> 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'> <error code='501' type='cancel'>
<feature-not-implemented xmlns='urn:ietf:params:xml:ns:xmpp-stanzas'/> <feature-not-implemented xmlns='urn:ietf:params:xml:ns:xmpp-stanzas'/>
<text xmlns='urn:ietf:params:xml:ns:xmpp-stanzas'>times-to-meet</text> <text xmlns='urn:ietf:params:xml:ns:xmpp-stanzas'>times-to-meet</text>
</error> </error>
</iq> </iq>
]]></example> ]]></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[ <example caption="Responding entity supports no options"><![CDATA[
<iq type='error' <iq type='error'
from='juliet@jabber.org/balcony' from='juliet@jabber.org/balcony'
to='romeo@montague.net/orchard' to='romeo@montague.net/orchard'
id='neg1'> 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'> <error code='406' type='modify'>
<not-acceptable xmlns='urn:ietf:params:xml:ns:xmpp-stanzas'/> <not-acceptable xmlns='urn:ietf:params:xml:ns:xmpp-stanzas'/>
<text xmlns='urn:ietf:params:xml:ns:xmpp-stanzas'>places-to-meet</text> <text xmlns='urn:ietf:params:xml:ns:xmpp-stanzas'>places-to-meet</text>
@ -182,7 +222,7 @@
... ...
</query> </query>
</iq>]]></example> </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[ <example caption='Client queries chatroom regarding options for a negotiable feature'><![CDATA[
<iq type='get' <iq type='get'
from='juliet@capulet.com/balcony' from='juliet@capulet.com/balcony'
@ -194,26 +234,22 @@
</x> </x>
</feature> </feature>
</iq>]]></example> </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[ <example caption='Chatroom returns error'><![CDATA[
<iq type='result' <iq type='result'
from='balconyscene@plays.shakespeare.lit' from='balconyscene@plays.shakespeare.lit'
to='juliet@capulet.com/balcony' to='juliet@capulet.com/balcony'
id='neg2'> id='neg2'>
<feature xmlns='http://jabber.org/protocol/feature-neg'> <feature xmlns='http://jabber.org/protocol/feature-neg'>
<x xmlns='jabber:x:data' type='result'> <x xmlns='jabber:x:data' type='submit'>
<field var='muc-password' type='list-single'> <field var='muc-password'/>
<option><value>cleartext</value></option>
<option><value>SHA1</value></option>
<option><value>SASL</value></option>
</field>
</x> </x>
</feature> </feature>
<error code='501' type='cancel'> <error code='501' type='cancel'>
<feature-not-implemented xmlns='urn:ietf:params:xml:ns:xmpp-stanzas'/> <feature-not-implemented xmlns='urn:ietf:params:xml:ns:xmpp-stanzas'/>
</error> </error>
</iq>]]></example> </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[ <example caption='Chatroom returns negotiation form'><![CDATA[
<iq type='result' <iq type='result'
from='balconyscene@plays.shakespeare.lit' from='balconyscene@plays.shakespeare.lit'
@ -221,6 +257,9 @@
id='neg2'> id='neg2'>
<feature xmlns='http://jabber.org/protocol/feature-neg'> <feature xmlns='http://jabber.org/protocol/feature-neg'>
<x xmlns='jabber:x:data' type='result'> <x xmlns='jabber:x:data' type='result'>
<field var='FORM_TYPE'>
<value>MUC</value>
</field>
<field var='muc-password' type='list-single'> <field var='muc-password' type='list-single'>
<option><value>cleartext</value></option> <option><value>cleartext</value></option>
<option><value>SHA1</value></option> <option><value>SHA1</value></option>
@ -229,12 +268,12 @@
</x> </x>
</feature> </feature>
</iq>]]></example> </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> </section2>
</section1> </section1>
<section1 topic='Security Considerations' anchor='security'> <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>
<section1 topic='IANA Considerations' anchor='iana'> <section1 topic='IANA Considerations' anchor='iana'>