| Abstract: | This specification provides canonical documentation of the 'jabber:iq:private' namespace currently in common usage. |
| Authors: | Peter Saint-Andre, Russell Davis |
| Copyright: | © 1999 - 2013 XMPP Standards Foundation. SEE LEGAL NOTICES. |
| Status: | Active |
| Type: | Historical |
| Version: | 1.2 |
| Last Updated: | 2004-03-01 |
NOTICE: This Historical specification provides canonical documentation of a protocol that is in use within the Jabber/XMPP community. This document is not a standards-track specification within the XMPP Standards Foundation's standards process; however, it might be converted to standards-track in the future or might be obsoleted by a more modern protocol.
1. Introduction
2. jabber:iq:private Namespace
2.1. Description
2.2. Methods
2.3. Elements
3. Error Conditions
4. Security Considerations
5. IANA Considerations
6. XMPP Registrar Considerations
7. XML Schema
Appendices
A: Document Information
B: Author Information
C: Legal Notices
D: Relation to XMPP
E: Discussion Venue
F: Requirements Conformance
G: Notes
H: Revision History
The 'jabber:iq:private' namespace has previously been documented in the Jabber Programmers Guide, but not in a canonical form such as the Internet-Drafts or a XEP. This specification documents the existing usage of jabber:iq:private.
A Jabber client can store any arbitrary XML on the server side by sending an <iq/> stanza of type "set" to the server with a <query/> child scoped by the 'jabber:iq:private' namespace. The <query/> element MAY contain any arbitrary XML fragment as long as the root element of that fragment is scoped by its own namespace. The data can then be retrieved by sending an <iq/> stanza of type "get" with a <query/> child scoped by the 'jabber:iq:private' namespace, which in turn contains a child element scoped by the namespace used for storage of that fragment. Using this method, Jabber entities can store private data on the server and retrieve it whenever necessary. The data stored might be anything, as long as it is valid XML. One typical usage for this namespace is the server-side storage of client-specific preferences; another is Bookmark Storage [1].
Table 1: Description of Acceptable Methods
| get | Sent with a blank query to retrieve the private data from the server. |
| set | Sent with the private XML data contained inside of a query. |
| result | Returns the private data from the server. |
| error | There was an error processing the request. The exact error can be found in the child error element. |
The root element of this namespace is query. At least one child element with a proper namespace MUST be included; otherwise the server MUST respond with a "Not Acceptable" error (see Error Condition Mappings [2] for information about error conditions). A client MUST NOT query for more than one namespace in a single IQ get request. However, an IQ set or result MAY contain multiple elements qualified by the same namespace.
Example 1. Client Stores Private Data
CLIENT:
<iq type="set" id="1001">
<query xmlns="jabber:iq:private">
<exodus xmlns="exodus:prefs">
<defaultnick>Hamlet</defaultnick>
</exodus>
</query>
</iq>
SERVER:
<iq type="result"
from="hamlet@shakespeare.lit/denmark"
to="hamlet@shakespeare.lit/denmark"
id="1001"/>
Example 2. Client Retrieves Private Data
CLIENT:
<iq type="get" id="1002">
<query xmlns="jabber:iq:private">
<exodus xmlns="exodus:prefs"/>
</query>
</iq>
SERVER:
<iq type="result"
from="hamlet@shakespeare.lit/denmark"
to="hamlet@shakespeare.lit/denmark"
id="1002">
<query xmlns="jabber:iq:private">
<exodus xmlns="exodus:prefs">
<defaultnick>Hamlet</defaultnick>
</exodus>
</query>
</iq>
If a user attempts to get or set jabber:iq:private data that belongs to another user, the server MUST return a "Forbidden" or "Service Unavailable" error to the sender (the latter condition is in common use by existing implementations, although the former is preferable).
Example 3. User Attempts to Get or Set Data for Another User
CLIENT:
<iq type="set" to="hamlet@shakespeare.lit" id="1003">
<query xmlns="jabber:iq:private">
<exodus xmlns="exodus:prefs">
<defaultnick>Macbeth</defaultnick>
</exodus>
</query>
</iq>
SERVER:
<iq type="error"
from="hamlet@shakespeare.lit"
to="macbeth@shakespeare.lit"
id="1003">
<query xmlns="jabber:iq:private">
<exodus xmlns="exodus:prefs">
<defaultnick>Macbeth</defaultnick>
</exodus>
</query>
<error code="403" type="cancel">
<forbidden
xmlns='urn:ietf:params:xml:ns:xmpp-stanzas'/>
</error>
</iq>
If a user attempts to perform an IQ get without providing a child element, the server SHOULD return a "Bad Format" error (however, some existing implementations return a "Not Acceptable" error in such circumstances):
Example 4. User Attempts to Get Data Without Specifying Child Element/Namespace
CLIENT:
<iq type="set" id="1004">
<query xmlns="jabber:iq:private"/>
</iq>
SERVER:
<iq type="error" id="1004">
<query xmlns="jabber:iq:private"/>
<error code="406" type="modify">
<bad-format
xmlns='urn:ietf:params:xml:ns:xmpp-stanzas'/>
</error>
</iq>
Certain namespaces are reserved in Jabber (namespaces beginning with 'jabber:' or 'http://jabber.org/', as well as 'vcard-temp'). If a user attempts to get or set jabber:iq:private data in a reserved namespace, historically some server implementations have chosen to return an error (commonly "Not Acceptable") to the sender. Such behavior is OPTIONAL, but may be encountered by clients when interacting with some existing server implementations.
Example 5. User Attempts to Get or Set Data in a Reserved Namespace
CLIENT:
<iq type="set" id="1005">
<query xmlns="jabber:iq:private">
<vCard xmlns="vcard-temp">
<FN>Hamlet</FN>
</vCard>
</query>
</iq>
SERVER (optional error):
<iq type="error" id="1005">
<query xmlns="jabber:iq:private">
<vCard xmlns="vcard-temp">
<FN>Hamlet</FN>
</vCard>
</query>
<error code="406" type="modify">
<not-acceptable
xmlns='urn:ietf:params:xml:ns:xmpp-stanzas'/>
</error>
</iq>
Table 2: Error Conditions used by jabber:iq:private
| Condition | Description |
|---|---|
| Bad Format | The IQ get does not contain a child element. |
| Forbidden | The IQ get or set is sent to a JID other than that of the sender. |
| Not Acceptable | The IQ get or set is qualified by a reserved namespace. |
A server MUST NOT allow any entity other than an authorized resource of the user to create, update, or delete private XML stored on behalf of that user.
This document requires no interaction with the Internet Assigned Numbers Authority (IANA) [3].
No action on the part of the XMPP Registrar [4] is necessary as a result of this document, since 'jabber:iq:private' is already a registered namespace.
<?xml version='1.0' encoding='UTF-8'?>
<xs:schema
xmlns:xs='http://www.w3.org/2001/XMLSchema'
targetNamespace='jabber:iq:private'
xmlns='jabber:iq:private'
elementFormDefault='qualified'>
<xs:annotation>
<xs:documentation>
The protocol documented by this schema is defined in
XEP-0049: http://www.xmpp.org/extensions/xep-0049.html
</xs:documentation>
</xs:annotation>
<xs:element name='query'>
<xs:complexType>
<xs:sequence minOccurs='0'>
<xs:any namespace='##other'/>
</xs:sequence>
</xs:complexType>
</xs:element>
</xs:schema>
Series: XEP
Number: 0049
Publisher: XMPP Standards Foundation
Status:
Active
Type:
Historical
Version: 1.2
Last Updated: 2004-03-01
Approving Body: XMPP Council
Dependencies: XMPP Core
Supersedes: None
Superseded By: None
Short Name: iq-private
Schema: <http://www.xmpp.org/schemas/iq-private.xsd>
Source Control:
HTML
This document in other formats:
XML
PDF
Email:
stpeter@jabber.org
JabberID:
stpeter@jabber.org
URI:
https://stpeter.im/
Email:
ukscone@burninghorse.com
JabberID:
ukscone@burninghorse.com
The Extensible Messaging and Presence Protocol (XMPP) is defined in the XMPP Core (RFC 6120) and XMPP IM (RFC 6121) specifications contributed by the XMPP Standards 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 primary venue for discussion of XMPP Extension Protocols is the <standards@xmpp.org> discussion list.
Discussion on other xmpp.org discussion lists might also be appropriate; see <http://xmpp.org/about/discuss.shtml> for a complete list.
Errata can be sent to <editor@xmpp.org>.
The following requirements 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".
1. XEP-0048: Bookmark Storage <http://xmpp.org/extensions/xep-0048.html>.
2. XEP-0086: Error Condition Mappings <http://xmpp.org/extensions/xep-0086.html>.
3. 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/>.
4. 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 XMPP Standards Foundation. For further information, see <http://xmpp.org/registrar/>.
Note: Older versions of this specification might be available at http://xmpp.org/extensions/attic/
END