1
0
mirror of https://github.com/moparisthebest/xeps synced 2024-11-22 01:02:17 -05:00

0.5 published

git-svn-id: file:///home/ksmith/gitmigration/svn/xmpp/trunk@3940 4b5297f7-1745-476d-ba37-a9c6900126ab
This commit is contained in:
Peter Saint-Andre 2010-02-18 04:51:00 +00:00
parent 6b0f1a82eb
commit 789f15ebe7

View File

@ -22,12 +22,13 @@
<shortname>extdisco</shortname> <shortname>extdisco</shortname>
&stpeter; &stpeter;
&seanegan; &seanegan;
<author> &mlundblad;
<firstname>Marcus</firstname> <revision>
<surname>Lundblad</surname> <version>0.5</version>
<email>ml@update.uu.se</email> <date>2010-02-17</date>
<jid>mlundblad@jabber.org</jid> <initials>psa</initials>
</author> <remark><p>Added ability to request credentials from a particular service; incremented the protocol version number to reflect the new feature.</p></remark>
</revision>
<revision> <revision>
<version>0.4</version> <version>0.4</version>
<date>2009-02-17</date> <date>2009-02-17</date>
@ -85,7 +86,7 @@
</header> </header>
<section1 topic='Introduction' anchor='intro'> <section1 topic='Introduction' anchor='intro'>
<p>An XMPP client or other entity may need to discover services external to the XMPP network in order to complete certain XMPP-related use cases. One example is the discovery of STUN servers (see &rfc5389;) and STUN relays (see &turn;) for the sake of negotiating media exchanges via &xep0176;. <note>The protocol specified herein is functionally equivalent to the protocol currently used in the Google Talk service for discovery of STUN servers, as documented at &lt;<link url='http://code.google.com/apis/talk/jep_extensions/jingleinfo.html'>http://code.google.com/apis/talk/jep_extensions/jingleinfo.html</link>&gt;, but has been broadened in scope to address additional use cases if desired.</note> An XMPP entity can already discover such external services in several ways, including:</p> <p>An XMPP client or other entity might need to discover services external to the XMPP network in order to complete certain XMPP-related use cases. One example is the discovery of STUN servers (see &rfc5389;) and TURN relays (see &turn;) for the sake of negotiating media exchanges via &xep0176;. <note>The protocol specified herein is functionally equivalent to the protocol currently used in the Google Talk service for discovery of STUN servers, as documented at &lt;<link url='http://code.google.com/apis/talk/jep_extensions/jingleinfo.html'>http://code.google.com/apis/talk/jep_extensions/jingleinfo.html</link>&gt;, but has been broadened in scope to address additional use cases if desired.</note> An XMPP entity can already discover such external services in several ways, including:</p>
<ol> <ol>
<li>The service is specified in the application's default settings.</li> <li>The service is specified in the application's default settings.</li>
<li>The service is manually added into the application's configuration by a human user.</li> <li>The service is manually added into the application's configuration by a human user.</li>
@ -100,11 +101,11 @@
</ul> </ul>
</li> </li>
</ol> </ol>
<p>Unfortunately, some of the foregoing methods are subject to human error and others are either not widely available or cannot be deployed in wide range of scenarios (e.g., when the administrators of an XMPP service do not have access to DNS SRV records). Therefore, this document defines a way for an XMPP server or discovery service to provide information about external services, which may include extended information such as temporary credentials for authentication at such services. This method should be used only as a fallback when the relevant service discovery technologies (DNS SRV, DDDS, SLP, S-NAPTR, U-NAPTR, etc.) are not available to the XMPP entities involved (typically a client and server). This method does not use &xep0030; since that technology is designed for discovery of XMPP entities, not entities outside an XMPP network.</p> <p>Unfortunately, some of the foregoing methods are subject to human error and others are either not widely available or cannot be deployed in wide range of scenarios (e.g., when the administrators of an XMPP service do not have access to DNS SRV records). Therefore, this document defines a way for an XMPP server or discovery service to provide information about external services, which might include extended information such as temporary credentials for authentication at such services. This method SHOULD be used only as a fallback when the relevant service discovery technologies (DNS SRV, DDDS, SLP, S-NAPTR, U-NAPTR, etc.) are not available to the XMPP entities involved (typically a client and server). This method does not use &xep0030; since that technology is designed for discovery of XMPP entities, not entities outside an XMPP network.</p>
</section1> </section1>
<section1 topic='Protocol' anchor='protocol'> <section1 topic='Protocol' anchor='protocol'>
<p>In order to learn about external services known to an XMPP server or discovery service, a requesting entity (typically a client) sends an IQ-get containing an empty &lt;services/&gt; element qualified by the 'urn:xmpp:extdisco:0' namespace &NSNOTE;, typically to its own server but perhaps alternatively to a dedicated discovery service.</p> <p>In order to learn about external services known to an XMPP server or discovery service, a requesting entity (typically a client) sends an IQ-get containing an empty &lt;services/&gt; element qualified by the 'urn:xmpp:extdisco:1' namespace &NSNOTE;, typically to its own server but perhaps alternatively to a dedicated discovery service.</p>
<p>The responding entity (XMPP server or discovery service) SHOULD return the list of external services it is aware of, but MAY instead return an appropriate error, such as &unavailable; if the responding entity does not support this protocol or &forbidden; if the requesting entity does not have permission to receive the list of external services. Each service is encapsulated via a &lt;service/&gt; element.</p> <p>The responding entity (XMPP server or discovery service) SHOULD return the list of external services it is aware of, but MAY instead return an appropriate error, such as &unavailable; if the responding entity does not support this protocol or &forbidden; if the requesting entity does not have permission to receive the list of external services. Each service is encapsulated via a &lt;service/&gt; element.</p>
<p>Note: The processes by which a responding entity discovers external services for "proxying" to XMPP entities are out of scope for this specification.</p> <p>Note: The processes by which a responding entity discovers external services for "proxying" to XMPP entities are out of scope for this specification.</p>
<p>The &lt;service/&gt; element MAY be empty or MAY include extended information about the service as described in the <link url='#extended'>Extended Information</link> section of this document.</p> <p>The &lt;service/&gt; element MAY be empty or MAY include extended information about the service as described in the <link url='#extended'>Extended Information</link> section of this document.</p>
@ -151,26 +152,26 @@
<td>OPTIONAL</td> <td>OPTIONAL</td>
</tr> </tr>
</table> </table>
<p>* Note: The processes by which an external service might generate or an XMPP server might negotiate the username and password are outside the scope of this specification. One possible approach is for the XMPP server to generate a short-term authentication credential based on a private key shared with the external service.</p> <p>* Note: The processes by which an external service might generate (or an XMPP server might negotiate) the username and password are outside the scope of this specification. One possible approach is for the XMPP server to generate a short-term authentication credential based on a private key shared with the external service.</p>
</section1> </section1>
<section1 topic='Use Cases' anchor='usecases'> <section1 topic='Use Cases' anchor='usecases'>
<section2 topic='Requesting All Services' anchor='all'> <section2 topic='Requesting All Services' anchor='all'>
<p>A requesting entity requests all services by sending a &lt;services/&gt; element to its server or a discovery service.</p> <p>A requesting entity requests all services by sending a &lt;services/&gt; element to its server or a discovery service.</p>
<example caption='Entity Requests All External Services'><![CDATA[ <example caption='Entity Requests All External Services'><![CDATA[
<iq type='get' <iq from='bard@shakespeare.lit/globe'
from='bard@shakespeare.lit/globe' id='ul2bc7y6'
to='shakespeare.lit' to='shakespeare.lit'
id='all1'> type='get'>
<services xmlns='urn:xmpp:extdisco:0'/> <services xmlns='urn:xmpp:extdisco:1'/>
</iq> </iq>
]]></example> ]]></example>
<example caption='XMPP Server Returns List'><![CDATA[ <example caption='XMPP Server Returns List'><![CDATA[
<iq type='result' <iq from='shakespeare.lit'
from='shakespeare.lit' id='ul2bc7y6'
to='bard@shakespeare.lit/globe' to='bard@shakespeare.lit/globe'
id='all1'> type='result'>
<services xmlns='urn:xmpp:extdisco:0'> <services xmlns='urn:xmpp:extdisco:1'>
<service host='stun.shakespeare.lit' <service host='stun.shakespeare.lit'
port='9998' port='9998'
transport='udp' transport='udp'
@ -203,21 +204,21 @@
]]></example> ]]></example>
</section2> </section2>
<section2 topic='Requesting Selected Services' anchor='select'> <section2 topic='Requesting Selected Services' anchor='select'>
<p>A requesting entity requests selected services by sending a &lt;services/&gt; element including a 'type' attribute specifying the service type of interest.</p> <p>A requesting entity requests services of a particular type by sending a &lt;services/&gt; element including a 'type' attribute specifying the service type of interest.</p>
<example caption='Entity Requests Selected Services'><![CDATA[ <example caption='Entity Requests Selected Services'><![CDATA[
<iq type='get' <iq from='bard@shakespeare.lit/globe'
from='bard@shakespeare.lit/globe' id='yv2c19f7'
to='shakespeare.lit' to='shakespeare.lit'
id='selected1'> type='get'>
<services xmlns='urn:xmpp:extdisco:0' type='turn'/> <services xmlns='urn:xmpp:extdisco:1' type='turn'/>
</iq> </iq>
]]></example> ]]></example>
<example caption='XMPP Server Returns List'><![CDATA[ <example caption='XMPP Server Returns List'><![CDATA[
<iq type='result' <iq from='shakespeare.lit'
from='shakespeare.lit' id='yv2c19f7'
to='bard@shakespeare.lit/globe' to='bard@shakespeare.lit/globe'
id='selected1'> type='result'>
<services xmlns='urn:xmpp:extdisco:0' <services xmlns='urn:xmpp:extdisco:1'
type='turn'> type='turn'>
<service host='turn.shakespeare.lit' <service host='turn.shakespeare.lit'
password='jj929jkj5sadjfj93v3n' password='jj929jkj5sadjfj93v3n'
@ -234,13 +235,13 @@
</services> </services>
</iq> </iq>
]]></example> ]]></example>
<p>If a requesting entity requests selected services, the responding service MAY as needed send an updated list of the relevant services by "pushing" the list to a requesting entity that has previously requested the list. However, it MUST NOT push updates to the requesting entity unless it has presence information about the requesting entity (e.g., because the requesting entity is connected to the XMPP server or because the requesting entity has shared presence with a remote discovery service).</p> <p>If a requesting entity requests services of a particular type, the responding service MAY as needed send an updated list of the relevant services by "pushing" the list to a requesting entity that has previously requested the list. However, it MUST NOT push updates to the requesting entity unless it has presence information about the requesting entity (e.g., because the requesting entity is connected to the XMPP server or because the requesting entity has shared presence with a remote discovery service). A push is an IQ set to the requesting entity containing a &lt;service/&gt; payload with updated data about services matching the requested type (e.g., new services or updated credentials)</p>
<example caption='Services Push'><![CDATA[ <example caption='Services Push'><![CDATA[
<iq type='set' <iq from='shakespeare.lit'
from='shakespeare.lit' id='lh3f1vc7'
to='bard@shakespeare.lit/globe' to='bard@shakespeare.lit/globe'
id='push1'> type='set'>
<services xmlns='urn:xmpp:extdisco:0' <services xmlns='urn:xmpp:extdisco:1'
type='turn'> type='turn'>
<service host='stun.shakespeare.lit' <service host='stun.shakespeare.lit'
port='9999' port='9999'
@ -257,14 +258,42 @@
</services> </services>
</iq> </iq>
]]></example> ]]></example>
<p>Upon receiving a push, the requesting entity would then send an IQ-result to the responding service in accordance with &xmppcore;.</p>
</section2>
<section2 topic='Requesting Credentials' anchor='credentials'>
<p>An entity might know about an external service via DNS or some other means, but still might need short-term credentials to use the service. The entity can request credentials by sending a special request to the server.</p>
<example caption='Entity Requests Credentials at a Service'><![CDATA[
<iq from='bard@shakespeare.lit/globe'
id='xi2cax48'
to='shakespeare.lit'
type='get'>
<credentials xmlns='urn:xmpp:extdisco:1'>
<service host='turn.shakespeare.lit'/>
</credentials>
</iq>
]]></example>
<p>The server then returns credentials if possible.</p>
<example caption='Server Returns Credentials'><![CDATA[
<iq from='shakespeare.lit'
id='xi2cax48'
to='bard@shakespeare.lit/globe'
type='get'>
<credentials xmlns='urn:xmpp:extdisco:1'>
<service host='turn.shakespeare.lit'
password='jj929jkj5sadjfj93v3n'
username='nb78932lkjlskjfdb7g8'/>
</credentials>
</iq>
]]></example>
<p>If the server cannot obtain credentials at the service, it returns an appropriate stanza error, such as &notfound;, &remoteserver;, &timeout;, or &notauthorized;.</p>
</section2> </section2>
</section1> </section1>
<section1 topic='Extended Information' anchor='extended'> <section1 topic='Extended Information' anchor='extended'>
<p>If a server or service needs to include extended information, it SHOULD do so by including each bit of information as the XML character data of the &lt;value/&gt; child of a distinct &lt;field/&gt; element, with the entire set of fields contained within an &lt;x/&gt; element of type "result" qualified by the 'jabber:x:data' namespace (see &xep0004;); this &lt;x/&gt; element SHOULD be a child of the &lt;service/&gt; element qualified by the 'urn:xmpp:extdisco:0' namespace &NSNOTE;. Thus the IQ result SHOULD be of the following form:</p> <p>If a server or service needs to include extended information, it SHOULD do so by including each bit of information as the XML character data of the &lt;value/&gt; child of a distinct &lt;field/&gt; element, with the entire set of fields contained within an &lt;x/&gt; element of type "result" qualified by the 'jabber:x:data' namespace (see &xep0004;); this &lt;x/&gt; element SHOULD be a child of the &lt;service/&gt; element qualified by the 'urn:xmpp:extdisco:1' namespace &NSNOTE;. Thus the IQ result SHOULD be of the following form:</p>
<code><![CDATA[ <code><![CDATA[
<iq type='result'> <iq type='result'>
<services xmlns='urn:xmpp:extdisco:0'> <services xmlns='urn:xmpp:extdisco:1'>
<service> <service>
<x type='result' xmlns='jabber:x:data'> <x type='result' xmlns='jabber:x:data'>
<field var='[var-name]' label='[optional]'> <field var='[var-name]' label='[optional]'>
@ -276,27 +305,27 @@
</services> </services>
</iq>]]></code> </iq>]]></code>
<p>Note: A &lt;field/&gt; element MAY contain more than one &lt;value/&gt; child if appropriate.</p> <p>Note: A &lt;field/&gt; element MAY contain more than one &lt;value/&gt; child if appropriate.</p>
<p>If the data fields are to be used in the context of a protocol approved by the XMPP Standards Foundation, they SHOULD be registered in accordance with the rules defined in XEP-0068, resulting in the inclusion of a &lt;field/&gt; element whose 'var' attribute has a value of "FORM_TYPE" and whose 'type' attribute has a value of "hidden".</p> <p>If the data fields are to be used in the context of a protocol approved by the XMPP Standards Foundation, they SHOULD be registered in accordance with the rules defined in &xep0068;, resulting in the inclusion of a &lt;field/&gt; element whose 'var' attribute has a value of "FORM_TYPE" and whose 'type' attribute has a value of "hidden".</p>
<p>Note: Although &xep0128; specifies that an XMPP entity MUST NOT supply extended information about associated children communicated via the 'urn:xmpp:extdisco:0' namespace, that rule does not apply to External Service Discovery since services external to the XMPP network cannot communicate via XMPP.</p> <p>Note: Although &xep0128; specifies that an XMPP entity MUST NOT supply extended information about associated children communicated via the 'http://jabber.org/protocol/disco#info' namespace, that rule does not apply to External Service Discovery since services external to the XMPP network cannot communicate via XMPP.</p>
</section1> </section1>
<section1 topic='Determining Support' anchor='disco'> <section1 topic='Determining Support' anchor='disco'>
<p>If an entity supports the STUN Server Discovery protocol, it MUST report that fact by including a service discovery feature of "urn:xmpp:extdisco:0" &NSNOTE; in response to a &xep0030; information request:</p> <p>If an XMPP entity supports this protocol, it MUST report that fact by including a service discovery feature of "urn:xmpp:extdisco:1" &NSNOTE; in response to a &xep0030; information request:</p>
<example caption="Service Discovery Information Request"><![CDATA[ <example caption="Service Discovery Information Request"><![CDATA[
<iq type='get' <iq from='romeo@montague.lit/orchard'
from='romeo@montague.lit/orchard' id='ix61z3m9'
to='montague.lit' to='montague.lit'
id='disco1'> type='get'>
<query xmlns='http://jabber.org/protocol/disco#info'/> <query xmlns='http://jabber.org/protocol/disco#info'/>
</iq> </iq>
]]></example> ]]></example>
<example caption="Service Discovery Information Response"><![CDATA[ <example caption="Service Discovery Information Response"><![CDATA[
<iq type='result' <iq from='montague.lit'
from='montague.lit' id='ix61z3m9'
to='romeo@montague.lit/orchard' to='romeo@montague.lit/orchard'
id='disco1'> type='result'>
<query xmlns='http://jabber.org/protocol/disco#info'> <query xmlns='http://jabber.org/protocol/disco#info'>
<feature var='urn:xmpp:extdisco:0'/> <feature var='urn:xmpp:extdisco:1'/>
</query> </query>
</iq> </iq>
]]></example> ]]></example>
@ -314,7 +343,7 @@
<section2 topic='Protocol Namespaces' anchor='registrar-ns'> <section2 topic='Protocol Namespaces' anchor='registrar-ns'>
<p>This specification defines the following XML namespace:</p> <p>This specification defines the following XML namespace:</p>
<ul> <ul>
<li>urn:xmpp:extdisco:0</li> <li>urn:xmpp:extdisco:1</li>
</ul> </ul>
<p>Upon advancement of this specification from a status of Experimental to a status of Draft, the &REGISTRAR; shall add the foregoing namespace to the registry located at &NAMESPACES;, as described in Section 4 of &xep0053;.</p> <p>Upon advancement of this specification from a status of Experimental to a status of Draft, the &REGISTRAR; shall add the foregoing namespace to the registry located at &NAMESPACES;, as described in Section 4 of &xep0053;.</p>
</section2> </section2>
@ -332,7 +361,7 @@
<doc>the document that best defines the service type</doc> <doc>the document that best defines the service type</doc>
</service> </service>
]]></code> ]]></code>
<p>The registrant may register more than one service type at a time, each contained in a separate &lt;service/&gt; element.</p> <p>The registrant can register more than one service type at a time, each contained in a separate &lt;service/&gt; element.</p>
</section3> </section3>
<section3 topic='Registration' anchor='registrar-methods-init'> <section3 topic='Registration' anchor='registrar-methods-init'>
<code><![CDATA[ <code><![CDATA[
@ -358,8 +387,8 @@
<xs:schema <xs:schema
xmlns:xs='http://www.w3.org/2001/XMLSchema' xmlns:xs='http://www.w3.org/2001/XMLSchema'
targetNamespace='urn:xmpp:extdisco:0' targetNamespace='urn:xmpp:extdisco:1'
xmlns='urn:xmpp:extdisco:0' xmlns='urn:xmpp:extdisco:1'
elementFormDefault='qualified'> elementFormDefault='qualified'>
<xs:import <xs:import
@ -375,34 +404,35 @@
</xs:complexType> </xs:complexType>
</xs:element> </xs:element>
<xs:element name='service'> <xs:element name='credentials'>
<xs:complexType> <xs:complexType>
<xs:simpleContent> <xs:sequence>
<xs:extension base='empty'> <xs:element ref='service' minOccurs='0' maxOccurs='1'/>
<xs:attribute name='host' type='xs:string' use='required'/> </xs:sequence>
<xs:attribute name='name' type='xs:string' use='optional'/>
<xs:attribute name='password' type='xs:string' use='optional'/>
<xs:attribute name='port' type='xs:string' use='required'/>
<xs:attribute name='transport' type='xs:NCName' use='optional'/>
<xs:attribute name='type' type='xs:NCName' use='required'/>
<xs:attribute name='username' type='xs:string' use='optional'/>
</xs:extension>
</xs:simpleContent>
</xs:complexType> </xs:complexType>
</xs:element> </xs:element>
<xs:simpleType name='empty'> <xs:element name='service'>
<xs:restriction base='xs:string'> <xs:complexType>
<xs:enumeration value=''/> <xs:sequence xmlns:xdata='jabber:x:data'>
</xs:restriction> <xs:element ref='xdata:x' minOccurs='0'/>
</xs:simpleType> </xs:sequence>
<xs:attribute name='host' type='xs:string' use='required'/>
<xs:attribute name='name' type='xs:string' use='optional'/>
<xs:attribute name='password' type='xs:string' use='optional'/>
<xs:attribute name='port' type='xs:string' use='required'/>
<xs:attribute name='transport' type='xs:NCName' use='optional'/>
<xs:attribute name='type' type='xs:NCName' use='required'/>
<xs:attribute name='username' type='xs:string' use='optional'/>
</xs:complexType>
</xs:element>
</xs:schema> </xs:schema>
]]></code> ]]></code>
</section1> </section1>
<section1 topic='Acknowledgements' anchor='ack'> <section1 topic='Acknowledgements' anchor='ack'>
<p>Thanks to Justin Karneges and Unnikrishnan Vikrama Panicker for their feedback.</p> <p>Thanks to Justin Karneges, Evgeniy Khramtsov, and Unnikrishnan Vikrama Panicker for their feedback.</p>
</section1> </section1>
</xep> </xep>