This document specifies an XMPP protocol extension for simple communications blocking.
NOTICE: This document is currently within Last Call or under consideration by the XMPP Council for advancement to the next stage in the JSF standards process.
Status:
Proposed
Type:
Standards Track
Number: 0191
Version: 0.4
Last Updated: 2006-11-06
Publishing Organization: Jabber Software Foundation
Approving Body: XMPP Council
Dependencies: XMPP Core, XMPP IM, XEP-0030
Supersedes: None
Superseded By: None
Short Name: blocking
Wiki Page: <http://wiki.jabber.org/index.php/Simple Communications Blocking (XEP-0191)>
Email:
stpeter@jabber.org
JID:
stpeter@jabber.org
This XMPP Extension Protocol is copyright 1999 - 2006 by the Jabber Software Foundation (JSF) and is in full conformance with the JSF's Intellectual Property Rights Policy <http://www.xmpp.org/extensions/ipr-policy.shtml>. This material may be distributed only subject to the terms and conditions set forth in the Creative Commons Attribution License (<http://creativecommons.org/licenses/by/2.5/>).
The preferred venue for discussion of this document is the Standards-JIG discussion list: <http://mail.jabber.org/mailman/listinfo/standards-jig>.
The Extensible Messaging and Presence Protocol (XMPP) is defined in the XMPP Core (RFC 3920) and XMPP IM (RFC 3921) specifications contributed by the Jabber Software Foundation to the Internet Standards Process, which is managed by the Internet Engineering Task Force in accordance with RFC 2026. Any protocol defined in this document has been developed outside the Internet Standards Process and is to be understood as an extension to XMPP rather than as an evolution, development, or modification of XMPP itself.
The following keywords as used in this document are to be interpreted as described in RFC 2119: "MUST", "SHALL", "REQUIRED"; "MUST NOT", "SHALL NOT"; "SHOULD", "RECOMMENDED"; "SHOULD NOT", "NOT RECOMMENDED"; "MAY", "OPTIONAL".
RFC 3921 [1] includes an XMPP protocol extension for communications blocking, which has since been moved to Server-Based Privacy Rules [2]. 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 RFC 2779 [3]). 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 RFC 2779 and can be implemented much more easily in Jabber/XMPP clients and servers.
The requirements for simple communications blocking are straightforward:
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. If a service deploys both privacy lists and simple communications blocking, both protocols MUST use the same back-end data store.
Wherever possible, this document attempts to define a protocol that is fully consistent with XEP-0016. If a particular aspect of functionality (e.g., stanza processing or JID matching rules) is not specified herein, the relevant text in XEP-0016 shall be taken to apply.
Matching of JIDs as specified in the 'jid' attribute of the <item/> element SHOULD proceed in the following order (this is consistent with XEP-0016):
In order for a client to discover whether its server supports the protocol defined herein, it MUST send a Service Discovery [4] information request to the server:
<iq from='juliet@capulet.com/chamber' to='capulet.com' type='get' id='disco1'> <query xmlns='http://jabber.org/protocol/disco#info'/> </iq>
If the server supports the protocol defined herein, it MUST return a feature of "http://jabber.org/protocol/blocking":
<iq from='capulet.com' to='juliet@capulet.com/chamber' type='result' id='disco1'> <query xmlns='http://jabber.org/protocol/disco#info'> ... <feature var='http://jabber.org/protocol/blocking'/> ... </query> </iq>
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 'http://jabber.org/protocol/blocking' namespace:
<iq type='get' id='blocklist1'> <blocklist xmlns='http://jabber.org/protocol/blocking'/> </iq>
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:
<iq type='result' id='blocklist1'> <blocklist xmlns='http://jabber.org/protocol/blocking'> <item jid='romeo@montague.net'/> <item jid='iago@shakespeare.lit'/> </blocklist> </iq>
If the user has no contacts in its blocklist, the server MUST return an IQ-result containing an empty <blocklist/> element:
<iq type='result' id='blocklist1'> <blocklist xmlns='http://jabber.org/protocol/blocking'/> </iq>
A client SHOULD retrieve the block list after authenticating with its server and before completing any blocking or unblocking operations.
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 'http://jabber.org/protocol/blocking' namespace, where the JID to be blocked is encapsulated as the 'jid' attribute of the <item/> child element:
<iq from='juliet@capulet.com/chamber' type='set' id='block1'> <block xmlns='http://jabber.org/protocol/blocking'> <item jid='romeo@montague.net'/> </block> </iq>
If the server can successfully process the block command, it MUST return an IQ-result:
<iq type='result' id='block1'/>
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):
<iq to='juliet@capulet.com/chamber' type='set' id='push1'> <block xmlns='http://jabber.org/protocol/blocking'> <item jid='romeo@montague.net'/> </block> </iq> <iq to='juliet@capulet.com/balcony' type='set' id='push2'> <block xmlns='http://jabber.org/protocol/blocking'> <item jid='romeo@montague.net'/> </block> </iq>
If the <block/> element does not contain at least one <item/> child element, the server MUST return a <bad-request/> error. The <block/> element MAY contain more than one <item/> child. Other standard XMPP stanza errors also apply; see XMPP Core [5] and Error Condition Mappings [6].
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 RFC 3921).
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).
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:
If the foregoing suggestions are followed, the user will appear offline to the contact.
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 <not-acceptable/> error containing an application-specific error condition of <blocked/> qualified by the 'http://jabber.org/protocol/blocking#errors' namespace:
<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='http://jabber.org/protocol/blocking#errors'/> </error> </message>
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 'http://jabber.org/protocol/blocking' namespace, where the JID to be unblocked is encapsulated as the 'jid' attribute of the <item/> child element:
<iq type='set' id='unblock1'> <unblock xmlns='http://jabber.org/protocol/blocking'> <item jid='romeo@montague.net'/> </unblock> </iq>
If the server can successfully process the unblock command, it MUST return an IQ-result:
<iq type='result' id='unblock1'/>
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):
<iq to='juliet@capulet.com/chamber' type='set' id='push3'> <unblock xmlns='http://jabber.org/protocol/blocking'> <item jid='romeo@montague.net'/> </unblock> </iq> <iq to='juliet@capulet.com/balcony' type='set' id='push4'> <unblock xmlns='http://jabber.org/protocol/blocking'> <item jid='romeo@montague.net'/> </unblock> </iq>
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 RFC 3921).
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.
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 'http://jabber.org/protocol/blocking' namespace:
<iq type='set' id='unblock2'> <unblock xmlns='http://jabber.org/protocol/blocking'/> </iq>
If the server can successfully process the unblock command, it MUST return an IQ-result:
<iq type='result' id='unblock2'/>
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:
<iq to='juliet@capulet.com/chamber' type='set' id='push5'> <unblock xmlns='http://jabber.org/protocol/blocking'/> </iq> <iq to='juliet@capulet.com/balcony' type='set' id='push6'> <unblock xmlns='http://jabber.org/protocol/blocking'/> </iq>
Once the user has unblocked communications with all contacts, the user's server MUST deliver any XML stanzas from those contacts to the user.
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.
A service MAY also filter blocking users out of searches performed on user directories (see, for example, Jabber Search [7]); however, that functionality is out of scope for this specification.
If properly implemented, this protocol extension does not introduce any new security concerns above and beyond those defined in RFC 3920 and RFC 3921.
No interaction with the Internet Assigned Numbers Authority (IANA) [8] is required as a result of this specification.
The XMPP Registrar [9] shall include 'http://jabber.org/protocol/blocking' and 'http://jabber.org/protocol/blocking#errors' in its registry of protocol namespaces (see <http://www.xmpp.org/registrar/namespaces.html>).
<?xml version='1.0' encoding='UTF-8'?> <xs:schema xmlns:xs='http://www.w3.org/2001/XMLSchema' targetNamespace='http://jabber.org/protocol/blocking' xmlns='http://jabber.org/protocol/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>
<?xml version='1.0' encoding='UTF-8'?> <xs:schema xmlns:xs='http://www.w3.org/2001/XMLSchema' targetNamespace='http://jabber.org/protocol/blocking#errors' xmlns='http://jabber.org/protocol/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>
Thanks to Valerie Mercier, Maciek Niedzielski, and Remko Tronçon for their feedback.
1. RFC 3921: Extensible Messaging and Presence Protocol (XMPP): Instant Messaging and Presence <http://www.ietf.org/rfc/rfc3921.txt>.
2. XEP-0016: Server-Based Privacy Rules <http://www.xmpp.org/extensions/xep-0016.html>.
3. RFC 2779: A Model for Presence and Instant Messaging <http://www.ietf.org/rfc/rfc2779.txt>.
4. XEP-0030: Service Discovery <http://www.xmpp.org/extensions/xep-0030.html>.
5. RFC 3920: Extensible Messaging and Presence Protocol (XMPP): Core <http://www.ietf.org/rfc/rfc3920.txt>.
6. XEP-0086: Error Condition Mappings <http://www.xmpp.org/extensions/xep-0086.html>.
7. XEP-0055: Jabber Search <http://www.xmpp.org/extensions/xep-0055.html>.
8. The Internet Assigned Numbers Authority (IANA) is the central coordinator for the assignment of unique parameter values for Internet protocols, such as port numbers and URI schemes. For further information, see <http://www.iana.org/>.
9. The XMPP Registrar maintains a list of reserved protocol namespaces as well as registries of parameters used in the context of XMPP extension protocols approved by the Jabber Software Foundation. For further information, see <http://www.xmpp.org/registrar/>.
Added push notifications (a la roster pushes).
(psa)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.
(psa)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.
(psa)Initial version.
(psa)Added block list retrieval use case; modified block and unblock syntax to use item child element.
(psa)First draft.
(psa)END