mirror of
https://github.com/moparisthebest/xeps
synced 2024-11-22 01:02:17 -05:00
2cff9f2b08
git-svn-id: file:///home/ksmith/gitmigration/svn/xmpp/trunk@224 4b5297f7-1745-476d-ba37-a9c6900126ab
340 lines
17 KiB
XML
340 lines
17 KiB
XML
<?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>Simple Communications Blocking</title>
|
|
<abstract>This document specifies an XMPP protocol extension for simple communications blocking.</abstract>
|
|
&LEGALNOTICE;
|
|
<number>0191</number>
|
|
<status>Draft</status>
|
|
<type>Standards Track</type>
|
|
<jig>Standards JIG</jig>
|
|
<dependencies>
|
|
<spec>XMPP Core</spec>
|
|
<spec>XMPP IM</spec>
|
|
<spec>XEP-0030</spec>
|
|
</dependencies>
|
|
<supersedes>None</supersedes>
|
|
<supersededby>None</supersededby>
|
|
<shortname>blocking</shortname>
|
|
&stpeter;
|
|
<revision>
|
|
<version>1.0</version>
|
|
<date>2006-11-21</date>
|
|
<initials>psa</initials>
|
|
<remark><p>Per a vote of the XMPP Council, advanced status to Draft; also modified namespace to use XMPP URN.</p></remark>
|
|
</revision>
|
|
<revision>
|
|
<version>0.5</version>
|
|
<date>2006-11-06</date>
|
|
<initials>psa</initials>
|
|
<remark><p>Modified message handling to recommend returning service-unavailable error.</p></remark>
|
|
</revision>
|
|
<revision>
|
|
<version>0.4</version>
|
|
<date>2006-11-06</date>
|
|
<initials>psa</initials>
|
|
<remark><p>Added push notifications (a la roster pushes).</p></remark>
|
|
</revision>
|
|
<revision>
|
|
<version>0.3</version>
|
|
<date>2006-10-16</date>
|
|
<initials>psa</initials>
|
|
<remark><p>Specified relationship to privacy lists, JID matching rules, server handling of outbound presence on block and unblock, handling of directed presence, syntax of block element.</p></remark>
|
|
</revision>
|
|
<revision>
|
|
<version>0.2</version>
|
|
<date>2006-08-30</date>
|
|
<initials>psa</initials>
|
|
<remark><p>Added implementation notes regarding polite blocking and filtering of search results; recommended retrieval of block list after authentication; defined protocol flow for unblocking all contacts.</p></remark>
|
|
</revision>
|
|
<revision>
|
|
<version>0.1</version>
|
|
<date>2006-08-16</date>
|
|
<initials>psa</initials>
|
|
<remark><p>Initial version.</p></remark>
|
|
</revision>
|
|
<revision>
|
|
<version>0.0.2</version>
|
|
<date>2006-08-10</date>
|
|
<initials>psa</initials>
|
|
<remark><p>Added block list retrieval use case; modified block and unblock syntax to use item child element.</p></remark>
|
|
</revision>
|
|
<revision>
|
|
<version>0.0.1</version>
|
|
<date>2006-08-09</date>
|
|
<initials>psa</initials>
|
|
<remark><p>First draft.</p></remark>
|
|
</revision>
|
|
</header>
|
|
<section1 topic='Introduction' anchor='intro'>
|
|
<p>&rfc3921; includes an XMPP protocol extension for communications blocking, which has since been moved to &xep0016;. Unfortunately, because the privacy lists extension is quite complex, it has not been widely implemented in servers and has been implemented virtually not at all in clients. This is problematic, since the ability to block communications with selected users is an important feature for an instant messaging system (and is required by &rfc2779;). However, the full power of privacy lists is not needed in order to block communications, so this document proposes a much simpler blocking protocol that meets the requirement specified in <cite>RFC 2779</cite> and can be implemented much more easily in Jabber/XMPP clients and servers.</p>
|
|
</section1>
|
|
<section1 topic='Requirements' anchor='reqs'>
|
|
<p>The requirements for simple communications blocking are straightforward:</p>
|
|
<ol start='1'>
|
|
<li>A user must be able to block communications with a specific contact.</li>
|
|
<li>A user should be able to determine which contacts are blocked.</li>
|
|
<li>A user should be able to unblock communications with a specific contact.</li>
|
|
</ol>
|
|
</section1>
|
|
<section1 topic='Relationship to Privacy Lists' anchor='privacy'>
|
|
<p>The simple communications blocking protocol specified herein is intended to be a user-friendly "front end" to a subset of the functionality defined by the privacy lists protocol (<cite>XEP-0016</cite>). If a service deploys both privacy lists and simple communications blocking, both protocols MUST use the same back-end data store.</p>
|
|
<p>Wherever possible, this document attempts to define a protocol that is fully consistent with <cite>XEP-0016</cite>. If a particular aspect of functionality is not specified herein, the relevant text in <cite>XEP-0016</cite> shall be taken to apply.</p>
|
|
</section1>
|
|
<section1 topic='JID Matching' anchor='matching'>
|
|
<p>Matching of JIDs as specified in the 'jid' attribute of the <item/> element SHOULD proceed in the following order (this is consistent with <cite>XEP-0016</cite>):</p>
|
|
<ol>
|
|
<li><user@domain/resource> (only that resource matches)</li>
|
|
<li><user@domain> (any resource matches)</li>
|
|
<li><domain/resource> (only that resource matches)</li>
|
|
<li><domain> (the domain itself matches, as does any user@domain, domain/resource, or address containing a subdomain)</li>
|
|
</ol>
|
|
</section1>
|
|
<section1 topic='Use Cases' anchor='usecases'>
|
|
<section2 topic='User Discovers Support' anchor='disco'>
|
|
<p>In order for a client to discover whether its server supports the protocol defined herein, it MUST send a &xep0030; information request to the server:</p>
|
|
<example caption='Service discovery request'><![CDATA[
|
|
<iq from='juliet@capulet.com/chamber' to='capulet.com' type='get' id='disco1'>
|
|
<query xmlns='http://jabber.org/protocol/disco#info'/>
|
|
</iq>
|
|
]]></example>
|
|
<p>If the server supports the protocol defined herein, it MUST return a feature of "urn:xmpp:blocking":</p>
|
|
<example caption='Service discovery response'><![CDATA[
|
|
<iq from='capulet.com' to='juliet@capulet.com/chamber' type='result' id='disco1'>
|
|
<query xmlns='http://jabber.org/protocol/disco#info'>
|
|
...
|
|
<feature var='urn:xmpp:blocking'/>
|
|
...
|
|
</query>
|
|
</iq>
|
|
]]></example>
|
|
</section2>
|
|
<section2 topic='User Retrieves Block List' anchor='blocklist'>
|
|
<p>In order for a client to request a user's list of blocked contacts (e.g., in order to determine whether to unblock a contact), it shall send an IQ-get with no 'to' address (thus handled by the user's server) containing a <blocklist/> element qualified by the 'urn:xmpp:blocking' namespace:</p>
|
|
<example caption='Client requests blocklist'><![CDATA[
|
|
<iq type='get' id='blocklist1'>
|
|
<blocklist xmlns='urn:xmpp:blocking'/>
|
|
</iq>
|
|
]]></example>
|
|
<p>If the user has any contacts in its blocklist, the server MUST return an IQ-result containing a <blocklist/> element that in turn contains one child <item/> element for each blocked contact:</p>
|
|
<example caption='Server returns blocklist with items'><![CDATA[
|
|
<iq type='result' id='blocklist1'>
|
|
<blocklist xmlns='urn:xmpp:blocking'>
|
|
<item jid='romeo@montague.net'/>
|
|
<item jid='iago@shakespeare.lit'/>
|
|
</blocklist>
|
|
</iq>
|
|
]]></example>
|
|
<p>If the user has no contacts in its blocklist, the server MUST return an IQ-result containing an empty <blocklist/> element:</p>
|
|
<example caption='Server returns empty blocklist'><![CDATA[
|
|
<iq type='result' id='blocklist1'>
|
|
<blocklist xmlns='urn:xmpp:blocking'/>
|
|
</iq>
|
|
]]></example>
|
|
<p>A client SHOULD retrieve the block list after authenticating with its server and before completing any blocking or unblocking operations.</p>
|
|
</section2>
|
|
<section2 topic='User Blocks Contact' anchor='block'>
|
|
<p>In order for a user to block communications with a contact, the user's client shall send an IQ-set with no 'to' address (thus handled by the user's server) containing a <block/> element qualified by the 'urn:xmpp:blocking' namespace, where the JID to be blocked is encapsulated as the 'jid' attribute of the <item/> child element:</p>
|
|
<example caption='Block command'><![CDATA[
|
|
<iq from='juliet@capulet.com/chamber' type='set' id='block1'>
|
|
<block xmlns='urn:xmpp:blocking'>
|
|
<item jid='romeo@montague.net'/>
|
|
</block>
|
|
</iq>
|
|
]]></example>
|
|
<p>If the server can successfully process the block command, it MUST return an IQ-result:</p>
|
|
<example caption='Block command is successful'><![CDATA[
|
|
<iq type='result' id='block1'/>
|
|
]]></example>
|
|
<p>The server MUST also send an IQ-set to all of the user's resources that have requested the blocklist, containing the blocked item(s):</p>
|
|
<example caption='Block "push"'><![CDATA[
|
|
<iq to='juliet@capulet.com/chamber' type='set' id='push1'>
|
|
<block xmlns='urn:xmpp:blocking'>
|
|
<item jid='romeo@montague.net'/>
|
|
</block>
|
|
</iq>
|
|
|
|
<iq to='juliet@capulet.com/balcony' type='set' id='push2'>
|
|
<block xmlns='urn:xmpp:blocking'>
|
|
<item jid='romeo@montague.net'/>
|
|
</block>
|
|
</iq>
|
|
]]></example>
|
|
<p>If the <block/> element does not contain at least one <item/> child element, the server MUST return a &badrequest; error. The <block/> element MAY contain more than one <item/> child. Other standard XMPP stanza errors also apply; see &xmppcore; and &xep0086;.</p>
|
|
<p>When the user blocks communications with the contact, the user's server MUST send unavailable presence information to the contact (but only if the contact is allowed to receive presence notifications from the user in accordance with the rules defined in <cite>RFC 3921</cite>).</p>
|
|
<p>Once the user has blocked communications with the contact, the user's server MUST NOT deliver any XML stanzas from the contact to the user. The block remains in force until the user subsequently unblocks commmunications with the contact (i.e., the duration of the block is potentially unlimited and applies across sessions).</p>
|
|
<p>If the contact attempts to send a stanza to the user (i.e., an inbound stanza from the user's perspective), the user's server shall handle the stanza according to the following rules:</p>
|
|
<ul>
|
|
<li>For presence stanzas (including notifications, subscriptions, and probes), the server MUST NOT respond and MUST NOT return an error.</li>
|
|
<li>For message stanzas, the server SHOULD return an error, which SHOULD be &unavailable;.</li>
|
|
<li>For IQ stanzas of type "get" or "set", the server MUST return an error, which SHOULD be &unavailable;. IQ stanzas of other types MUST be silently dropped by the server.</li>
|
|
</ul>
|
|
<p>If the foregoing suggestions are followed, the user will appear offline to the contact.</p>
|
|
<p>If the user attempts to send an outbound stanza to the contact, the user's server MUST NOT route the stanza to the contact but instead MUST return a ¬acceptable; error containing an application-specific error condition of <blocked/> qualified by the 'urn:xmpp:blocking:errors' namespace:</p>
|
|
<example caption='Error: contact is blocked'><![CDATA[
|
|
<message type='error' from='romeo@montague.net' to='juliet@capulet.com'>
|
|
<body>Can you hear me now?</body>
|
|
<error type='cancel'>
|
|
<not-acceptable xmlns='urn:ietf:params:xml:ns:xmpp-stanzas'/>
|
|
<blocked xmlns='urn:xmpp:blocking:errors'/>
|
|
</error>
|
|
</message>
|
|
]]></example>
|
|
</section2>
|
|
<section2 topic='User Unblocks Contact' anchor='unblock'>
|
|
<p>In order for a user to unblock communications with a contact, the user's client shall send an IQ-set with no 'to' address (thus handled by the user's server) containing an <unblock/> element qualified by the 'urn:xmpp:blocking' namespace, where the JID to be unblocked is encapsulated as the 'jid' attribute of the <item/> child element:</p>
|
|
<example caption='Unblock contact command'><![CDATA[
|
|
<iq type='set' id='unblock1'>
|
|
<unblock xmlns='urn:xmpp:blocking'>
|
|
<item jid='romeo@montague.net'/>
|
|
</unblock>
|
|
</iq>
|
|
]]></example>
|
|
<p>If the server can successfully process the unblock command, it MUST return an IQ-result:</p>
|
|
<example caption='Unblock contact command is successful'><![CDATA[
|
|
<iq type='result' id='unblock1'/>
|
|
]]></example>
|
|
<p>The server MUST also send an IQ-set to all of the user's resources that have requested the blocklist, containing the unblocked item(s):</p>
|
|
<example caption='Unblock "push"'><![CDATA[
|
|
<iq to='juliet@capulet.com/chamber' type='set' id='push3'>
|
|
<unblock xmlns='urn:xmpp:blocking'>
|
|
<item jid='romeo@montague.net'/>
|
|
</unblock>
|
|
</iq>
|
|
|
|
<iq to='juliet@capulet.com/balcony' type='set' id='push4'>
|
|
<unblock xmlns='urn:xmpp:blocking'>
|
|
<item jid='romeo@montague.net'/>
|
|
</unblock>
|
|
</iq>
|
|
]]></example>
|
|
<p>When the user unblocks communications with the contact, the user's server MUST send the user's current presence information to the contact (but only if the contact is allowed to receive presence notifications from the user in accordance with the rules defined in <cite>RFC 3921</cite>).</p>
|
|
<p>After the user has unblocked communications with the contact, the user's server MUST deliver any subsequent XML stanzas from the contact to the user.</p>
|
|
</section2>
|
|
<section2 topic='User Unblocks All Contacts' anchor='unblockall'>
|
|
<p>In order for a user to unblock communications with all contacts, the user's client shall send an IQ-set with no 'to' address (thus handled by the user's server) containing an empty <unblock/> element qualified by the 'urn:xmpp:blocking' namespace:</p>
|
|
<example caption='Unblock all command'><![CDATA[
|
|
<iq type='set' id='unblock2'>
|
|
<unblock xmlns='urn:xmpp:blocking'/>
|
|
</iq>
|
|
]]></example>
|
|
<p>If the server can successfully process the unblock command, it MUST return an IQ-result:</p>
|
|
<example caption='Unblock all command is successful'><![CDATA[
|
|
<iq type='result' id='unblock2'/>
|
|
]]></example>
|
|
<p>The server MUST also send an IQ-set to all of the user's resources that have requested the blocklist, containing notification of global unblocking:</p>
|
|
<example caption='Unblock all "push"'><![CDATA[
|
|
<iq to='juliet@capulet.com/chamber' type='set' id='push5'>
|
|
<unblock xmlns='urn:xmpp:blocking'/>
|
|
</iq>
|
|
|
|
<iq to='juliet@capulet.com/balcony' type='set' id='push6'>
|
|
<unblock xmlns='urn:xmpp:blocking'/>
|
|
</iq>
|
|
]]></example>
|
|
<p>Once the user has unblocked communications with all contacts, the user's server MUST deliver any XML stanzas from those contacts to the user.</p>
|
|
</section2>
|
|
</section1>
|
|
<section1 topic='Implementation Notes' anchor='impl'>
|
|
<p>When a server receives a block command from a user, it MAY cancel any existing presence subscriptions between the user and the blocked user and MAY send a message to the blocked user; however, it is RECOMMENDED to deploy so-called "polite blocking" instead (i.e., to not cancel the presence subscriptions or send a notification). Which approach to follow is a matter of local service policy.</p>
|
|
<p>A service MAY also filter blocking users out of searches performed on user directories (see, for example, &xep0055;); however, that functionality is out of scope for this specification.</p>
|
|
</section1>
|
|
<section1 topic='Security Considerations' anchor='security'>
|
|
<p>If properly implemented, this protocol extension does not introduce any new security concerns above and beyond those defined in <cite>RFC 3920</cite> and <cite>RFC 3921</cite>.</p>
|
|
</section1>
|
|
<section1 topic='IANA Considerations' anchor='iana'>
|
|
<p>No interaction with &IANA; is required as a result of this specification.</p>
|
|
</section1>
|
|
<section1 topic='XMPP Registrar Considerations' anchor='registrar'>
|
|
<section2 topic='Protocol Namespaces' anchor='registrar-ns'>
|
|
<p>The ®ISTRAR; includes 'urn:xmpp:blocking' and 'urn:xmpp:blocking:errors' in its registry of protocol namespaces (see &NAMESPACES;).</p>
|
|
</section2>
|
|
</section1>
|
|
<section1 topic='XML Schema' anchor='schema'>
|
|
<section2 topic='blocking' anchor='schema-blocking'>
|
|
<code><![CDATA[
|
|
<?xml version='1.0' encoding='UTF-8'?>
|
|
|
|
<xs:schema
|
|
xmlns:xs='http://www.w3.org/2001/XMLSchema'
|
|
targetNamespace='urn:xmpp:blocking'
|
|
xmlns='urn:xmpp:blocking'
|
|
elementFormDefault='qualified'>
|
|
|
|
<xs:element name='block'>
|
|
<xs:complexType>
|
|
<xs:sequence>
|
|
<xs:element ref='item' minOccurs='1' maxOccurs='unbounded'/>
|
|
</xs:sequence>
|
|
</xs:complexType>
|
|
</xs:element>
|
|
|
|
|
|
<xs:element name='unblock'>
|
|
<xs:complexType>
|
|
<xs:sequence>
|
|
<xs:element ref='item' minOccurs='0' maxOccurs='unbounded'/>
|
|
</xs:sequence>
|
|
</xs:complexType>
|
|
</xs:element>
|
|
|
|
|
|
<xs:element name='blocklist'>
|
|
<xs:complexType>
|
|
<xs:sequence>
|
|
<xs:element ref='item' minOccurs='0' maxOccurs='unbounded'/>
|
|
</xs:sequence>
|
|
</xs:complexType>
|
|
</xs:element>
|
|
|
|
<xs:element name='item'>
|
|
<xs:complexType>
|
|
<xs:simpleContent>
|
|
<xs:extension base='empty'>
|
|
<xs:attribute name='jid' type='xs:string' use='required'/>
|
|
</xs:extension>
|
|
</xs:simpleContent>
|
|
</xs:complexType>
|
|
</xs:element>
|
|
|
|
<xs:simpleType name='empty'>
|
|
<xs:restriction base='xs:string'>
|
|
<xs:enumeration value=''/>
|
|
</xs:restriction>
|
|
</xs:simpleType>
|
|
|
|
</xs:schema>
|
|
]]></code>
|
|
</section2>
|
|
<section2 topic='blocking:errors' anchor='schema-blocking-errors'>
|
|
<code><![CDATA[
|
|
<?xml version='1.0' encoding='UTF-8'?>
|
|
|
|
<xs:schema
|
|
xmlns:xs='http://www.w3.org/2001/XMLSchema'
|
|
targetNamespace='urn:xmpp:blocking:errors'
|
|
xmlns='urn:xmpp:blocking:errors'
|
|
elementFormDefault='qualified'>
|
|
|
|
<xs:element name='blocked' type='empty'/>
|
|
|
|
<xs:simpleType name='empty'>
|
|
<xs:restriction base='xs:string'>
|
|
<xs:enumeration value=''/>
|
|
</xs:restriction>
|
|
</xs:simpleType>
|
|
|
|
</xs:schema>
|
|
]]></code>
|
|
</section2>
|
|
</section1>
|
|
<section1 topic='Acknowledgements' anchor='ack'>
|
|
<p>Thanks to Valerie Mercier, Maciek Niedzielski, Kevin Smith, and Remko Tronçon for their feedback.</p>
|
|
</section1>
|
|
</xep>
|