1
0
mirror of https://github.com/moparisthebest/xeps synced 2024-11-02 00:15:06 -04:00

Merge branch 'master' of athena.jabber.org:xmpp

This commit is contained in:
Kurt Zeilenga 2010-10-11 23:13:06 -07:00
commit afce71aca9
8 changed files with 615 additions and 7 deletions

60
gen.py
View File

@ -65,9 +65,12 @@ def executeCommand( cmd ):
error, desc = commands.getstatusoutput( cmd )
return error, desc + "\n" + "executed cmd: " + cmd
## creates a HTML table (for the human reader) and XML table (for bots)
class XEPTable:
def __init__(self, filename):
def __init__(self, filename, shortXMLfilename):
self.filename = filename
self.shortXMLfilename = shortXMLfilename
try:
self.tableFile = parse(filename)
except:
@ -88,14 +91,26 @@ class XEPTable:
<th align='left'>Date</th>
</tr>''')
self.tableFile.getElementsByTagName("table")[0].appendChild(header.getElementsByTagName("tr")[0])
try:
self.botsFile = parse(shortXMLfilename)
except:
impl = getDOMImplementation()
self.botsFile = impl.createDocument(None, "xeps", None)
def save(self):
f = open(self.filename, "wb")
self.tableFile.getElementsByTagName("table")[0].normalize()
f.write(self.tableFile.toxml())
f.close()
f = open(self.shortXMLfilename, "wb")
self.botsFile.getElementsByTagName("xeps")[0].normalize()
f.write(self.botsFile.toxml())
f.close()
def setXEP(self, info):
## set for HTML table
rows = self.tableFile.getElementsByTagName("tr")
xeprow = 0
for row in rows:
@ -115,7 +130,7 @@ class XEPTable:
while(xeprow.hasChildNodes()):
xeprow.removeChild(xeprow.firstChild)
col = parseString('''<td valign='top'><a href='xep-''' + info.getNr() + ".html'>XEP-" + info.getNr() + '''</a> <a href='xep-''' + info.getNr() + '''.pdf'>(PDF)</a></td>''')
col = parseString('''<td valign='top'><a href='/extensions/xep-''' + info.getNr() + ".html'>XEP-" + info.getNr() + '''</a> <a href='/extensions/xep-''' + info.getNr() + '''.pdf'>(PDF)</a></td>''')
xeprow.appendChild(col.getElementsByTagName("td")[0])
col = parseString("<td valign='top'>" + info.getTitle() + "</td>")
@ -130,6 +145,43 @@ class XEPTable:
col = parseString("<td valign='top'>" + info.getDate() + "</td>")
xeprow.appendChild(col.getElementsByTagName("td")[0])
## set for bots file
xeps = self.botsFile.getElementsByTagName("xep")
xep = 0
for xeps_xep in xeps:
if xeps_xep.getElementsByTagName("number")[0].firstChild.data == info.getNr():
xep = xeps_xep
break
if xep == 0:
xep = self.botsFile.createElement("xep")
self.botsFile.getElementsByTagName("xeps")[0].appendChild(xep)
self.botsFile.getElementsByTagName("xeps")[0].appendChild(self.botsFile.createTextNode('''
'''))
else:
while(xep.hasChildNodes()):
xep.removeChild(xep.firstChild)
child = parseString("<number>" + info.getNr() + "</number>")
xep.appendChild(child.getElementsByTagName("number")[0])
child = parseString("<name>" + info.getTitle() + "</name>")
xep.appendChild(child.getElementsByTagName("name")[0])
child = parseString("<type>" + info.getType() + "</type>")
xep.appendChild(child.getElementsByTagName("type")[0])
child = parseString("<status>" + info.getStatus() + "</status>")
xep.appendChild(child.getElementsByTagName("status")[0])
child = parseString("<updated>" + info.getDate() + "</updated>")
xep.appendChild(child.getElementsByTagName("updated")[0])
child = parseString("<shortname>" + info.getShortname() + "</shortname>")
xep.appendChild(child.getElementsByTagName("shortname")[0])
child = parseString("<abstract>" + info.getAbstract() + "</abstract>")
xep.appendChild(child.getElementsByTagName("abstract")[0])
def filebase( filename ):
return os.path.splitext(os.path.basename(filename))[0]
@ -255,7 +307,7 @@ def buildXEP( filename ):
else:
print "Building " + filename + " (FAST MODE)"
x = XEPTable(CONFIGPATH + "/extensions.xml")
x = XEPTable(CONFIGPATH + "/extensions.xml", XEPPATH + "/xeps.xml")
xinfo = XEPInfo(xepfilepath, False)
x.setXEP( xinfo )
x.save()

View File

@ -146,7 +146,7 @@
</section2>
</section1>
<section1 topic='Handling' anchor='handling'>
<p>In general, the XMPP &lt;thread/&gt; element is handled in a manner similar to the "References:" header field from email (see &rfc5322;) and netnews (see &rfc5536;). Detailed guidelines for particular XMPP message types are provided in the following sections.</p>
<p>In general, the XMPP &lt;thread/&gt; element is handled in a manner similar to the "References:" header field from email (see &rfc5322;) and netnews (see &rfc5536;), as well as the THREAD extension to IMAP (see &rfc5256;). Detailed guidelines for particular XMPP message types are provided in the following sections.</p>
<section2 topic='Chat Messages' anchor='chat'>
<p>For &lt;message/&gt; stanzas of type "chat" exchanged between two entities, the value of the &lt;thread/&gt; element shall be considered equivalent to a unique identifier for the chat session or conversation thread. If an entity receives such a message with a new or unknown ThreadID, it SHOULD treat the message as part of a new chat session. A client MAY destroy the thread when it goes offline, but SHOULD NOT destroy the thread if a human user merely disengages from the chat session (e.g., by closing a window in a client interface).</p>
<p>If an entity receives an XMPP presence stanza of type "unavailable" from the other entity during a chat session, it SHOULD NOT destroy the thread; instead, it SHOULD assume that the other entity will still be able to continue the session (perhaps the other entity was temporarily disconnected by a network error or is persisting the state of the session until it reconnects and receives "offline" messages).</p>

View File

@ -113,27 +113,45 @@
<section1 topic='Conclusions'>
<p>As with anything, there are no hard and fast rules. If there were, they might look like these. First, for devices:</p>
<dl>
<di>
<dt>Transmit no data.</dt>
<dd>Transmitting costs significant power, and moreover raises the radio state. Not transmitting will allow it to maximize the time spent in the low-cost Idle state.</dd>
</di>
<di>
<dt>If you must transmit, then transmit only a small volume.</dt>
<dd>If there is only a small amount of data transmitted - less than 128 octets typically - the radio will only raise to FACH, which is significantly cheaper than DCH.</dd>
</di>
<di>
<dt>If you must transmit, then compress as hard as possible.</dt>
<dd>Since individual octets have an associate power - and often financial - cost, it's worth maximizing the compression algorithm, even if the volume of traffic will raise to DCH.</dd>
</di>
<di>
<dt>If you have transmit a lot, then do a lot</dt>
<dd>If the radio is raised to DCH anyway, then you may as well go fetch that avatar you were missing, since you're chewing through power anyway.</dd>
</di>
<di>
<dt>If you receive, then transmit</dt>
<dd>If your peer raises the radio state, you may as well use it.</dd>
</di>
</dl>
<p>And for servers, similar rules apply:</p>
<dl>
<di>
<dt>Send no data.</dt>
<dd>Sending data will cause the handset to be raised out of Idle. This immediately costs massively higher power.</dd>
</di>
<di>
<dt>If you must send, send tiny bits.</dt>
<dd>Sending small enough data maximizes the likelyhood that the devices radio will only be raised to FACH levels.</dd>
</di>
<di>
<dt>If you receive, then send anything you have.</dt>
<dd>Receiving data indicates that the radio is active - it'll stay active for some time, so sending data doesn't incur the overhead of raising the radio state, and won't increase power drain on the handset.</dd>
</di>
<di>
<dt>If you must send when not receiving, send plenty.</dt>
<dd>Sending data will raise the radio's state - unless you can tell this will only raise it to FACH, it's worth sending as much as possible.</dd>
</di>
</dl>
<p>Finally, protocol designers should aim to minimize any responses required from the handset, and ensure keepalive traffic, if any, fits inside FACH wherever possible.</p>
</section1>

316
xep-0287.xml Normal file
View File

@ -0,0 +1,316 @@
<?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>
<title>Spim Markers and Reports</title>
<abstract>This document defines an XMPP protocol extension that enables XMPP entities to interact with spim filters by marking unsolicited or suspicious XMPP stanzas.</abstract>
&LEGALNOTICE;
<number>0287</number>
<status>Experimental</status>
<type>Standards Track</type>
<sig>Standards</sig>
<approver>Council</approver>
<dependencies>
<spec>XMPP Core</spec>
<spec>XEP-0001</spec>
<spec>XEP-0030</spec>
</dependencies>
<supersedes/>
<supersededby/>
<shortname>NOT_YET_ASSIGNED</shortname>
<author>
<firstname>Evgeniy</firstname>
<surname>Khramtsov</surname>
<email>ekhramtsov@process-one.net</email>
<jid>xram@jabber.ru</jid>
</author>
<revision>
<version>0.1</version>
<date>2010-10-04</date>
<initials>psa</initials>
<remark><p>Initial published version.</p></remark>
</revision>
<revision>
<version>0.1</version>
<date>2010-09-13</date>
<initials>evk</initials>
<remark><p>Initial version.</p></remark>
</revision>
</header>
<section1 topic='Introduction' anchor='intro'>
<p>There are various spim protection methods exist in XMPP: &xep0016;, &xep0158;, &xep0191;, &xep0268; and &xep0275;. But they may not be sufficient enough:
<ul>
<li>&xep0016; and &xep0191; define blocking mechanism only which is not always appropriate.</li>
<li>&xep0158; interacts badly with automated software such as gateways.</li>
<li>&xep0268; implies trusted network of servers.</li>
<li>&xep0275; concentrates on ranking only.</li>
</ul>
Service administrators might want to deploy server-based spim recognition software to fill in the gaps. However, every automated spim recognition suffers from <em>false positives</em> - situations where a stanza incorrectly qualified as spim. To avoid them, a spim filter doesn't block suspicious stanza, but marks it and sends to a client in a regular manner. A client software doesn't need to interrupt a user when processing such marked stanzas: for example, it may put them silently in "SPAM" folder, so a user can look through them at any time later. Furthermore, a spim filter may take user's experience into account. When a user receives an unsolicited stanza, he or she can mark it as spim. In this case a client software sends an automatic complaint to a server-based spim filter. This specification deals with both cases. Thus, in contrast to &xep0159;, it doesn't introduce any spim blocking techniques. Also, the various spim recognition procedures that may be employed by the server are beyond the scope of this document.
</p>
</section1>
<section1 topic='Requirements' anchor='reqs'>
<p>An implementation compliant with this document MUST support spim markers as described in <link url='#spim-marker'>Spim Marker</link> use case. Support for spim reports, as described in <link url='#spim-report'>Spim Report</link> use case, is RECOMMENDED.</p>
</section1>
<section1 topic='Glossary' anchor='glossary'>
<p>The following terms are used throughout this document:</p>
<dl>
<di><dt>Filtering Entity</dt><dd>An XMPP entity which performs spim recognitions, blocks or marks suspicious stanzas and accepts spim reports. Example: a server or an external component with built-in spim recognition module.</dd></di>
<di><dt>Receiving Entity</dt><dd>An XMPP entity which directly receives marked stanzas and sends spim reports. Example: a client or a conference (&xep0045;).</dd></di>
</dl>
</section1>
<section1 topic='Use Cases' anchor='usecases'>
<section2 topic='Spim Marker' anchor='spim-marker'>
<p>The filtering entity marks abusive stanza by adding &lt;mark/&gt; child element qualified by the 'urn:xmpp:spim-marker:0' namespace. The element MUST possess the 'filter' attribute whose value MUST be a full jid of the filtering entity. The &lt;mark/&gt; element MAY contain character data which SHOULD be a human-readable description of the reason to mark. The filtering entity MUST NOT add more than one &lt;mark/&gt; element and MUST delete all other &lt;mark/&gt; elements matching itself before adding a new one. The filtering entity MAY remove any &lt;mark/&gt; elements matching itself even if it doesn't add a new one.</p>
<example caption="User's Server Marked Abusive Message"><![CDATA[
<message from='robot@abuser.com/zombie'
to='innocent@victim.com/laptop'
id='spam1'>
<body>Love pills - 75% OFF</body>
<mark xmlns='urn:xmpp:spim-marker:0'
filter='victim.com'/>
Unsolicited advertising
</mark>
</message>
]]></example>
<example caption="Several Services Marked Abusive Message"><![CDATA[
<message from='robot@abuser.com/zombie'
to='innocent@victim.com/laptop'
id='spam1'>
<subject>You won $1,000,000!</subject>
<body>Visit http://www.abuser.com/</body>
<mark xmlns='urn:xmpp:spim-marker:0'
filter='dnsbl-filter.victim.com'>
Blocked by too many DNSBLs
</mark>
<mark xmlns='urn:xmpp:spim-marker:0'
filter='bayes-filter.victim.com'/>
</message>
]]></example>
<p>Processing rules of marked stanzas taken by the receiving entity are beyond the scope of this document. One possible solution is to put such stanzas silently in so-called "SPAM" folder.</p>
</section2>
<section2 topic='Spim Report' anchor='spim-report'>
<p>If the filtering entity wishes to receive abuse report for the stanza, it MUST add &lt;report/&gt; child element qualified by the 'urn:xmpp:spim-report:0' namespace and MUST possess the 'key' and the 'filter' attributes. A value of the 'key' attribute is arbitrary, but SHOULD have at least 128 bits of randomness. The 'key' attribute is needed to match the corresponding complaint (if any) with the sender. The value of the 'filter' attribute MUST be a full jid of the filtering entity. The filtering entity MUST NOT add more than one &lt;report/&gt; element and MUST delete all other &lt;report/&gt; elements matching itself before adding a new one. The filtering entity MAY remove any &lt;report/&gt; elements matching itself even if it doesn't add a new one.</p>
<example caption="Multiple Filters Wishes to Receive Abuse Report"><![CDATA[
<presence type='subscribe'
from='robot@abuser.com'
to='innocent@victim.com'
id='spam2'>
<report xmlns='urn:xmpp:spim-report:0'
key='571c9641d8442920'
filter='filter.victim.com'/>
<report xmlns='urn:xmpp:spim-report:0'
key='b258acbcb4bb8e66ac'
filter='victim.com'/>
</presence>
]]></example>
<p>The receiving entity MAY complain by sending an IQ-set containing the &lt;query/&gt; child element qualified by the 'urn:xmpp:spim-report:0' namespace. A value of the 'filter' attribute MUST be copied in the 'to' attribute of the IQ-set stanza. The element MUST possess 'key' attribute copied from the original stanza.</p>
<p>The receiving entity MUST ignore any &lt;report/&gt; elements generated by untrusted filtering entities. If there are more than one &lt;report/&gt; element matching the same filtering entity, all of them MUST be ignored.</p>
<example caption="Receiver Sends Complaint"><![CDATA[
<iq type='set'
from='innocent@victim.com/laptop'
to='filter.victim.com'
id='complaint1'>
<query xmlns='urn:xmpp:spim-report:0'
key='571c9641d8442920'/>
</iq>
<iq type='set'
from='innocent@victim.com/laptop'
to='victim.com'
id='complaint2'>
<query xmlns='urn:xmpp:spim-report:0'
key='b258acbcb4bb8e66ac'/>
</iq>
]]></example>
<p>The filtering entity MUST respond with an empty IQ-result stanza upon successful completion of the request:</p>
<example caption="Complaint Was Accepted"><![CDATA[
<iq type='result'
from='filter.victim.com'
to='innocent@victim.com/laptop'
id='complaint1'/>
<iq type='result'
from='victim.com'
to='innocent@victim.com/laptop'
id='complaint2'/>
]]></example>
</section2>
</section1>
<section1 topic='Business Rules' anchor='rules'>
<p>A filtering entity SHOULD only add &lt;mark/&gt; or &lt;report/&gt; elements and a receiving entity SHOULD only process those elements if the corresponding stanza envolves an interaction with a human user: subscription requests, messages, conference invites, voice calls, etc. For example, it doesn't make a lot of sense to mark &xep0232; stanzas.</p>
<p>To avoid obvious false positives and user confusions, a filtering entity SHOULD NOT add &lt;mark/&gt; or &lt;report/&gt; elements to a stanza and a receiving entity SHOULD ignore &lt;mark/&gt; and &lt;report/&gt; elements of a stanza if:
<ul>
<li>The receiving entity has the sender's subscription information of the type "both", "from" or "to".</li>
<li>The receiving entity has pending subscription to the sender, i.e. subscription of type "none" and ask='subscribe'.</li>
<li>The receiving entity has sent direct presence to the sender.</li>
</ul>
</p>
</section1>
<section1 topic='Determining Support' anchor='support'>
<p>If an entity supports the spim markers, it MUST report that by including a service discovery feature of "urn:xmpp:spim-marker:0" in response to a &xep0030; information request. If an entity supports the spim reports, it MUST report that by including a service discovery feature of "urn:xmpp:spim-report:0" in response to a &xep0030; information request:</p>
<example caption="Service Discovery Information Request"><![CDATA[
<iq type='get'
from='juliet@capulet.lit/balcony'
to='capulet.lit'
id='disco1'>
<query xmlns='http://jabber.org/protocol/disco#info'/>
</iq>
]]></example>
<example caption="Service Discovery Information Response"><![CDATA[
<iq type='result'
from='capulet.lit'
to='juliet@capulet.lit/balcony'
id='disco1'>
<query xmlns='http://jabber.org/protocol/disco#info'>
...
<feature var='urn:xmpp:spim-marker:0'/>
<feature var='urn:xmpp:spim-report:0'/>
...
</query>
</iq>
]]></example>
</section1>
<!--
<section1 topic='Implementation Notes' anchor='impl'>
<p>OPTIONAL.</p>
</section1>
<section1 topic='Accessibility Considerations' anchor='access'>
<p>OPTIONAL.</p>
</section1>
<section1 topic='Internationalization Considerations' anchor='i18n'>
<p>OPTIONAL.</p>
</section1>
-->
<section1 topic='Security Considerations' anchor='security'>
<section2 topic='CAPTCHA challenges' anchor='captcha-challenges'>
<p>Care should be taken if a receiving entity chooses to generate a CAPTCHA challenge (&xep0158;) in response to a marked stanza. A spim recognition system rarely has more than 5-10% of false positives. Thus, producing CAPTCHA images or audio/video samples is likely a waste of system resources and also may overload the receiving entity at high rate of spim stanzas.</p>
</section2>
<section2 topic='Fake &lt;mark/&gt; element' anchor='fake-mark-element'>
<p>A rogue server may add fake &lt;mark/&gt; elements to compromise filtering entities: a user may decide to remove such entities from the trusted list because, for example, he or she thinks they produce too many false positives. To avoid such situation, a filtering entity MUST remove any &lt;mark/&gt; elements matching itself before adding new &lt;mark/&gt; element as described in <link url='#spim-marker'>Spim Marker</link> use case. Also, a filtering entity MAY remove any &lt;mark/&gt; elements matching itself even if it doesn't add a new one.</p>
</section2>
<section2 topic='Fake &lt;report/&gt; element' anchor='fake-report-element'>
<p>An attacker may add fake &lt;report/&gt; element. For example, it may do that for checking an activity of the user. To avoid such situation, a receiving entity MUST send spim reports to the trusted filtering entities only as desribed in <link url='#spim-report'>Spim Report</link> use case.</p>
</section2>
<section2 topic='Multiple fake &lt;report/&gt; elements' anchor='multiple-fake-reports'>
<section3 topic='Single filtering entity' anchor='multiple-reports-single'>
<p>An attacker may add thousands of fake &lt;report/&gt; elements matching the single trusted filtering entity in one stanza. A poorly written receiving entity may generate a complaint for all of them. As an effect, a distributed DoS attack on the filtering entity is performed if there are multiple receiving entities envolved. To avoid such situation, a receiving entity MUST ignore multiple &lt;report/&gt; elements matching the same filtering entity as desribed in <link url='#spim-report'>Spim Report</link> use case.</p>
<p>In its turn, a filtering entity MUST remove any &lt;report/&gt; elements matching itself before adding new &lt;report/&gt; element as described in <link url='#spim-report'>Spim Report</link> use case. Thus, it is guaranteed that the element will not be ignored by the receiving entity.</p>
</section3>
<section3 topic='Several filtering entities' anchor='multiple-reports-several'>
<p>An attacker may gain an information about user's trusted filtering entities. In this case he or she may add the &lt;report/&gt; element per every such entity in one stanza. If there are too many filtering entities in the list, a user may generate enormous traffic when generating spim reports. Although this attack is not very effective, a client software MUST not generate spim reports without user's acknowledgement.</p>
</section3>
</section2>
<section2 topic='Fake IQ-set report' anchor='fake-iq-set-report'>
<p>An attacker may try to mark an innocent user as a spimmer by producing several IQ-set stanzas qualified by "urn:xmpp:spim-report:0" containing different value of the 'key' attribute each (so-called "dictionary attack"). As a protection, sanity checks MUST be performed when processing such reports. For example, if a filtering entity doesn't store any information about a receiving entity, the value of the 'key' attribute SHOULD have at least 128 bits of randomness.</p>
</section2>
</section1>
<section1 topic='IANA Considerations' anchor='iana'>
<p>This document requires no interaction with &IANA;.</p>
</section1>
<section1 topic='XMPP Registrar Considerations' anchor='registrar'>
<section2 topic='Protocol Namespaces' anchor='registrar-ns'>
<p>This specification defines the following XML namespaces:</p>
<ul>
<li>urn:xmpp:spim-marker:0</li>
<li>urn:xmpp:spim-report:0</li>
</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>
</section2>
</section1>
<section1 topic='XML Schema' anchor='schema'>
<section2 topic='urn:xmpp:spim-marker:0' anchor='schema-marker'>
<code><![CDATA[
<?xml version='1.0' encoding='UTF-8'?>
<xs:schema
xmlns:xs='http://www.w3.org/2001/XMLSchema'
targetNamespace='urn:xmpp:spim-marker:0'
xmlns='urn:xmpp:spim-marker:0'
elementFormDefault='qualified'>
<xs:annotation>
<xs:documentation>
The protocol documented by this schema is defined in
XEP-xxxx: http://www.xmpp.org/extensions/xep-xxxx.html
</xs:documentation>
</xs:annotation>
<xs:element name='mark'>
<xs:complexType>
<xs:simpleContent>
<xs:extension base='xs:string'>
<xs:attribute
name='filter'
type='xs:string'
use='required'/>
<xs:attribute
name='reason'
type='xs:string'
use='optional'/>
</xs:extension>
</xs:simpleContent>
</xs:complexType>
</xs:element>
</xs:schema>
]]></code>
</section2>
<section2 topic='urn:xmpp:spim-report:0' anchor='schema-report'>
<code><![CDATA[
<?xml version='1.0' encoding='UTF-8'?>
<xs:schema
xmlns:xs='http://www.w3.org/2001/XMLSchema'
targetNamespace='urn:xmpp:spim-report:0'
xmlns='urn:xmpp:spim-report:0'
elementFormDefault='qualified'>
<xs:annotation>
<xs:documentation>
The protocol documented by this schema is defined in
XEP-xxxx: http://www.xmpp.org/extensions/xep-xxxx.html
</xs:documentation>
</xs:annotation>
<xs:element name='query'>
<xs:complexType>
<xs:simpleContent>
<xs:extension base='xs:string'>
<xs:attribute
name='key'
type='xs:string'
use='required'/>
</xs:extension>
</xs:simpleContent>
</xs:complexType>
</xs:element>
<xs:element name='report'>
<xs:complexType>
<xs:simpleContent>
<xs:extension base='xs:string'>
<xs:attribute
name='filter'
type='xs:string'
use='required'/>
<xs:attribute
name='key'
type='xs:string'
use='required'/>
</xs:extension>
</xs:simpleContent>
</xs:complexType>
</xs:element>
</xs:schema>
]]></code>
</section2>
</section1>
<section1 topic='Acknowledgements' anchor='ack'>
<p>Thanks to Sergei Golovan for the feedback.</p>
</section1>
</xep>

206
xep-0288.xml Normal file
View File

@ -0,0 +1,206 @@
<?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>
<title>Bidirectional Server-to-Server Connections</title>
<abstract>This specification defines a protocol for using server-to-server connections in a bidirectional way such that stanzas are sent and received on the same TCP connection.</abstract>
&LEGALNOTICE;
<number>0288</number>
<status>Experimental</status>
<type>Standards Track</type>
<sig>Standards</sig>
<approver>Council</approver>
<dependencies>
<spec>XMPP Core</spec>
<spec>XEP-0178</spec>
<spec>XEP-0220</spec>
</dependencies>
<supersedes/>
<supersededby/>
<shortname>NOT_YET_ASSIGNED</shortname>
<author>
<firstname>Philipp</firstname>
<surname>Hancke</surname>
<jid>fippo@ve.symlynx.com</jid>
</author>
<author>
<firstname>Dave</firstname>
<surname>Cridland</surname>
<email>dave.cridland@isode.com</email>
<jid>dave.cridland@isode.com</jid>
</author>
<revision>
<version>0.1</version>
<date>2010-10-04</date>
<initials>psa</initials>
<remark><p>Initial published version.</p></remark>
</revision>
<revision>
<version>0.0.2</version>
<date>2010-09-13</date>
<initials>dwd</initials>
<remark>
<p>belated run-over pre-publication</p>
<p>Added notes on authentication</p>
</remark>
</revision>
<revision>
<version>0.0.1</version>
<date>2010-04-12</date>
<initials>ph</initials>
<remark><p>initial version</p></remark>
</revision>
</header>
<section1 topic='Introduction'>
<p>&rfc3920; restricts server-to-server communication in such a way that a server has to use on TCP connection for XML stanzas sent from the server to the peer and another TCP connection (initiated by the peer) for stanzas from the peer to the server, for a total of two TCP connections. &rfc3920bis; allows two servers to send stanzas in a bidirectional way, but does not define methods for explicitly signalling the usage thereof. This is accomplished in this specification.</p>
</section1>
<!--
http://www.ietf.org/mail-archive/web/xmpp/current/msg00658.html
http://www.ietf.org/mail-archive/web/xmpp/current/msg00664.html
-->
<section1 topic='Protocol' anchor='protocol'>
<section2 topic='Stream Feature' anchor='feature'>
<p>If a server supports bidirectional server-to-server streams, it should inform the connecting entity when returning stream features during the stream negotiation process (both before and after TLS negotiation). This is done by including a &lt;bidi/&gt; element qualified by the 'urn:xmpp:features:bidi' namespace.</p>
<example caption="Stream features"><![CDATA[
<stream:features>
<starttls xmlns='urn:ietf:params:xml:ns:xmpp-tls'/>
<bidi xmlns='urn:xmpp:features:bidi'/>
</stream:features>
]]></example>
<p>If the initiating entity chooses to use TLS, STARTTLS negotiation MUST be completed before enabling bidirectionality.</p>
</section2>
<section2 topic='Negotiation' anchor='nego'>
<p>To enable bidirectional communication, the connecting server sends a &lt;bidi/&gt; element qualified by the 'urn:xmpp:bidi' namespace. This SHOULD be done before either SASL negotiation or &xep0220;.</p>
<example caption="Connecting Server Requests Bidirectionality"><![CDATA[
C: <bidi xmlns='urn:xmpp:bidi'/>
]]></example>
<p>Note: Since there is no reply to the request, it is possible to pipeline it.</p>
<p>After enabling bidirectionality, the connecting server continues to authenticate via SASL or requests to send stanzas for a domain pair with Server Dialback. The receiving server MUST NOT send stanzas to the peer before it has authenticated via SASL, or the peer's identity has been verified via Server Dialback. Note that the receiving server MUST NOT attempt to verify a dialback key on the same connection where the corresponding request was issued.</p>
<p>Also note that the receiving server MUST only send stanzas for which it has been authenticated - in the case of TLS/SASL based authentication, this is the value of the stream's 'to' attribute, whereas in the case of &xep0220; this is the value of the 'to' attribute on any &lt;db:result> element.</p>
<p>Finally, once bidirectionality is enabled, the receiving server MAY initiate &xep0220; authentications for other domains it hosts to any domain authenticated to be hosted by the connecting server.</p>
</section2>
</section1>
<section1 topic='Examples' anchor='examples'>
<p>This section shows two complete examples of bidirectional streams, the first example uses SASL EXTERNAL, the second uses Server Dialback. </p>
<example caption='Bidirectional Streams with SASL Authentication'><![CDATA[
C: <stream:stream xmlns:stream='http://etherx.jabber.org/streams'
xmlns='jabber:server' xmlns:db='jabber:server:dialback'
to='montague.lit' from='capulet.lit'
xml:lang='en' version='1.0'>
S: <stream:stream xmlns='jabber:server' xmlns:db='jabber:server:dialback'
xmlns:stream='http://etherx.jabber.org/streams' xml:lang='en'
id='65b30434afd7646699d077f7affcb2c120c48e18'
from='montague.lit' to='capulet.lit' version='1.0'>
S: <stream:features>
<starttls xmlns='urn:ietf:params:xml:ns:xmpp-tls'/>
<bidi xmlns='urn:xmpp:bidi'/>
</stream:features>
C: <starttls xmlns='urn:ietf:params:xml:ns:xmpp-tls'/>
S: <proceed xmlns='urn:ietf:params:xml:ns:xmpp-tls'/>
C: <stream:stream xmlns:stream='http://etherx.jabber.org/streams'
xmlns='jabber:server' xmlns:db='jabber:server:dialback'
to='montague.lit' from='capulet.lit'
xml:lang='en' version='1.0'>
S: <stream:stream xmlns='jabber:server' xmlns:db='jabber:server:dialback'
xmlns:stream='http://etherx.jabber.org/streams' xml:lang='en'
id='b5cd769b1dc292c6f6557fe76cabc4d112333f9a'
from='montague.lit' to='capulet.lit' version='1.0'>
S: <stream:features>
<mechanisms xmlns='urn:ietf:params:xml:ns:xmpp-sasl'>
<mechanism>EXTERNAL<mechanism>
</mechanisms>
<bidi xmlns='urn:xmpp:bidi'/>
</stream:features>
C: <bidi xmlns='urn:xmpp:bidi'/>
<auth xmlns='urn:ietf:params:xml:ns:xmpp-sasl' mechanism='EXTERNAL'>
Y2FwdWxldC5saXQ=</auth>
S: <success xmlns='urn:ietf:params:xml:ns:xmpp-sasl'/>
C: <stream:stream xmlns:stream='http://etherx.jabber.org/streams'
xmlns='jabber:server' xmlns:db='jabber:server:dialback'
to='montague.lit' from='capulet.lit'
xml:lang='en' version='1.0'>
S: <stream:stream xmlns='jabber:server' xmlns:db='jabber:server:dialback'
xmlns:stream='http://etherx.jabber.org/streams' xml:lang='en'
id='b5cd769b1dc292c6f6557fe76cabc4d112333f9a'
from='montague.lit' to='capulet.lit' version='1.0'>
S: <stream:features/>
<!-- At this point, S is allowed to send C stanzas from capulet.lit
since that is the value of 'to' in the stream open sent by C above.
-->
C: <iq from='juliet@capulet.lit/balcony' to='montague.lit' type='get'
id='8dfc70af'><query xmlns='urn:xmpp:ping'/></iq>
S: <iq from='montague.lit' to='juliet@capulet.lit/balcony' type='result'
id='8dfc70af'><query xmlns='urn:xmpp:ping'/></iq>
]]></example>
<example caption='Bidirectional Streams with Server Dialback'><![CDATA[
C: <stream:stream xmlns:stream='http://etherx.jabber.org/streams'
xmlns='jabber:server' xmlns:db='jabber:server:dialback'
to='montague.lit' from='capulet.lit'
xml:lang='en' version='1.0'>
S: <stream:stream xmlns='jabber:server' xmlns:db='jabber:server:dialback'
xmlns:stream='http://etherx.jabber.org/streams' xml:lang='en'
id='65b30434afd7646699d077f7affcb2c120c48e18'
from='montague.lit' to='capulet.lit' version='1.0'>
S: <stream:features>
<starttls xmlns='urn:ietf:params:xml:ns:xmpp-tls'/>
<bidi xmlns='urn:xmpp:bidi'/>
</stream:features>
C: <starttls xmlns='urn:ietf:params:xml:ns:xmpp-tls'/>
S: <proceed xmlns='urn:ietf:params:xml:ns:xmpp-tls'/>
C: <stream:stream xmlns:stream='http://etherx.jabber.org/streams'
xmlns='jabber:server' xmlns:db='jabber:server:dialback'
to='montague.lit' from='capulet.lit'
xml:lang='en' version='1.0'>
S: <stream:stream xmlns='jabber:server' xmlns:db='jabber:server:dialback'
xmlns:stream='http://etherx.jabber.org/streams' xml:lang='en'
id='b5cd769b1dc292c6f6557fe76cabc4d112333f9a'
from='montague.lit' to='capulet.lit' version='1.0'>
S: <stream:features>
<mechanisms xmlns='urn:ietf:params:xml:ns:xmpp-sasl'/>
<bidi xmlns='urn:xmpp:bidi'/>
</stream:features>
<example caption="Stream Setup before TLS"><![CDATA[
C: <bidi xmlns='urn:xmpp:bidi'/>
<db:result from='capulet.lit' to='montague.lit'>
e3f5cf21f12749ef2cf59269bc0118f35bc46b26</db:result>
<!-- At this point S may send from capulet.lit.
-->
S: <db:result from='montague.lit' to='capulet.lit' type='valid'/>
C: <iq from='juliet@capulet.lit/balcony' to='montague.lit' type='get'
id='8dfc70af'><query xmlns='urn:xmpp:ping'/></iq>
S: <iq from='montague.lit' to='juliet@capulet.lit/balcony' type='result'
id='8dfc70af'><query xmlns='urn:xmpp:ping'/></iq>
S: <db:result from='conference.montague.lit' to='capulet.lit'>
1bac3ef56fed987cfe098c9785c654a5476ed765</db:result>
<!-- The above is also legal - S attempts to authenticate as
a different domain as well, presumably a MUC domain
-->
C: <db:result from='capulet.lit' to='conference.montague.lit' type='valid'/>
<!-- Now S can send as conference.m.l as well as C sending to that domain.
-->
]]></example>
</section1>
<section1 topic='Security Considerations' anchor='security'>
<p>This specification introduces no security considerations above and beyond those discussed in <cite>RFC 3920</cite>.</p>
<!-- one might explain why not... http://mail.jabber.org/pipermail/xmppwg/2004-February/002026.html -->
</section1>
<section1 topic='XMPP Registrar Considerations' anchor='registrar'>
<section2 topic='Protocol Namespaces' anchor='registrar-ns'>
<ul>
<li>'urn:xmpp:bidi'</li>
</ul>
</section2>
<section2 topic='Stream Features' anchor='registrar-stream'>
<ul>
<li>'urn:xmpp:features:bidi'</li>
</ul>
</section2>
</section1>
<section1 topic='IANA Considerations' anchor='iana'>
<p>This document requires no interaction with &IANA;.</p>
</section1>
</xep>

View File

@ -579,6 +579,7 @@ THE SOFTWARE.
<!ENTITY rfc5178 "<span class='ref'><link url='http://tools.ietf.org/html/rfc5178'>RFC 5178</link></span> <note>RFC 5178: Generic Security Service Application Program Interface (GSS-API) Internationalization and Domain-Based Service Names and Name Type &lt;<link url='http://tools.ietf.org/html/rfc5178'>http://tools.ietf.org/html/rfc5178</link>&gt;.</note>" >
<!ENTITY rfc5179 "<span class='ref'><link url='http://tools.ietf.org/html/rfc5179'>RFC 5179</link></span> <note>RFC 5179: Generic Security Service Application Program Interface (GSS-API) Domain-Based Service Names Mapping for the Kerberos V GSS Mechanism &lt;<link url='http://tools.ietf.org/html/rfc5179'>http://tools.ietf.org/html/rfc5179</link>&gt;.</note>" >
<!ENTITY rfc5246 "<span class='ref'><link url='http://tools.ietf.org/html/rfc5246'>RFC 5246</link></span> <note>RFC 5246: The Transport Layer Security (TLS) Protocol Version 1.2 &lt;<link url='http://tools.ietf.org/html/rfc5246'>http://tools.ietf.org/html/rfc5246</link>&gt;.</note>" >
<!ENTITY rfc5256 "<span class='ref'><link url='http://tools.ietf.org/html/rfc5256'>RFC 5256</link></span> <note>RFC 5256: Internet Message Access Protocol - SORT and THREAD Extensions &lt;<link url='http://tools.ietf.org/html/rfc5256'>http://tools.ietf.org/html/rfc5256</link>&gt;.</note>" >
<!ENTITY rfc5280 "<span class='ref'><link url='http://tools.ietf.org/html/rfc5280'>RFC 5280</link></span> <note>RFC 5280: Internet X.509 Public Key Infrastructure Certificate and Certificate Revocation List (CRL) Profile &lt;<link url='http://tools.ietf.org/html/rfc5280'>http://tools.ietf.org/html/rfc5280</link>&gt;.</note>" >
<!ENTITY rfc5322 "<span class='ref'><link url='http://tools.ietf.org/html/rfc5322'>RFC 5322</link></span> <note>RFC 5322: Internet Message Format &lt;<link url='http://tools.ietf.org/html/rfc5322'>http://tools.ietf.org/html/rfc5322</link>&gt;.</note>" >
<!ENTITY rfc5359 "<span class='ref'><link url='http://tools.ietf.org/html/rfc5359'>RFC 5359</link></span> <note>RFC 5359: Session Initiation Protocol Service Examples &lt;<link url='http://tools.ietf.org/html/rfc5359'>http://tools.ietf.org/html/rfc5359</link>&gt;.</note>" >
@ -1159,3 +1160,5 @@ IANA Service Location Protocol, Version 2 (SLPv2) Templates</link></span> <note>
<!ENTITY xep0284 "<span class='ref'><link url='http://xmpp.org/extensions/xep-0284.html'>Shared XML Editing</link></span> <note>XEP-0284: Shared XML Editing &lt;<link url='http://xmpp.org/extensions/xep-0284.html'>http://xmpp.org/extensions/xep-0284.html</link>&gt;.</note>" >
<!ENTITY xep0285 "<span class='ref'><link url='http://xmpp.org/extensions/xep-0285.html'>Digital Signatures in XMPP</link></span> <note>XEP-0285: Digital Signatures in XMPP &lt;<link url='http://xmpp.org/extensions/xep-0285.html'>http://xmpp.org/extensions/xep-0285.html</link>&gt;.</note>" >
<!ENTITY xep0286 "<span class='ref'><link url='http://xmpp.org/extensions/xep-0286.html'>XMPP on Mobile Devices</link></span> <note>XEP-0286: XMPP on Mobile Devices &lt;<link url='http://xmpp.org/extensions/xep-0286.html'>http://xmpp.org/extensions/xep-0286.html</link>&gt;.</note>" >
<!ENTITY xep0287 "<span class='ref'><link url='http://xmpp.org/extensions/xep-0287.html'>Spim Markers and Reports</link></span> <note>XEP-0287: Spim Markers and Reports &lt;<link url='http://xmpp.org/extensions/xep-0287.html'>http://xmpp.org/extensions/xep-0287.html</link>&gt;.</note>" >
<!ENTITY xep0288 "<span class='ref'><link url='http://xmpp.org/extensions/xep-0288.html'>Bidirectional Server-to-Server Connections</link></span> <note>XEP-0288: Bidirectional Server-to-Server Connections &lt;<link url='http://xmpp.org/extensions/xep-0288.html'>http://xmpp.org/extensions/xep-0288.html</link>&gt;.</note>" >

View File

@ -99,6 +99,8 @@
\newcommand{\XEPNumber}[0]{<xsl:value-of select="/xep/header/number"/>}
\newcommand{\XEPVersion}[0]{<xsl:value-of select="$maxXEPVersion"/>}
\newcolumntype{L}{>{\raggedright\arraybackslash}X}
\fancyhead[L,L]{\includegraphics[totalheight=10pt]{xmpp.pdf} \slshape \leftmark}
\fancyfoot[C,C]{\thepage}
@ -225,7 +227,7 @@
<xsl:template match='table'>
<TeXML escape="0">
<env name="center">
<env name='tabularx'><parm><cmd name="linewidth" /></parm>
<env name='tabularx'><parm><TeXML escape="0">\linewidth</TeXML></parm>
<parm><xsl:for-each select='tr[1]/th | tr[1]/td'><xsl:if test="position() = 1">l</xsl:if><xsl:if test='position() != last() and position() > 1'>X</xsl:if><xsl:if test='position() = last()'>X</xsl:if></xsl:for-each></parm>
<xsl:for-each select='tr'>
<xsl:for-each select='td | th'><xsl:if test='position() > 1'> &amp; </xsl:if><TeXML escape="1"><xsl:value-of select='.'/></TeXML><xsl:if test='position() = last()'> \\</xsl:if></xsl:for-each>

View File

@ -49,8 +49,13 @@ class XEPInfo:
titleNode = (headerNode.getElementsByTagName("title")[0])
self.title = getText(titleNode.childNodes)
self.nr = getText((headerNode.getElementsByTagName("number")[0]).childNodes)
shortnameNode = headerNode.getElementsByTagName("shortname")
if shortnameNode:
self.shortname = getText((shortnameNode[0]).childNodes)
else:
self.shortname = "NOT YET ASSIGNED"
abstractNode = (headerNode.getElementsByTagName("abstract")[0])
abstract = getText(abstractNode.childNodes)
self.abstract = getText(abstractNode.childNodes)
statusNode = (headerNode.getElementsByTagName("status")[0])
self.status = getText(statusNode.childNodes)
self.type = getText((headerNode.getElementsByTagName("type")[0]).childNodes)
@ -80,6 +85,12 @@ class XEPInfo:
def getTitle(self):
return self.title
def getShortname(self):
return self.shortname
def getAbstract(self):
return self.abstract
def getStatus(self):
return self.status