# HG changeset patch
# User Goffi XMPP components are used for long through &xep0114;, but are quite limited: they have a restricted access to other entities data, similar to what a client can do. This is sufficient for components like gateways, but very limiting for more complex components like a PubSub service. The goal of this XEP is to allow a component to have a "privileged" status, and access an entity data with the same privileges than the entity itself, that means send and receive IQ stanzas on its behalf. Privileged component have numerous advantages, including: XMPP components are used for long through &xep0114;, but are quite limited: they have a restricted access to other entities data, similar to what a client can do. This is sufficient for components like gateways, but very limiting for more complex components like a PubSub service. The goal of this XEP is to allow a component or any entity to have a "privileged" status, and access an other entity data with the same privileges than the entity itself, that means send and receive IQ stanzas on its behalf. Privileged entity have numerous advantages, including: A privileged component can be used in two modes: A privileged entity can be used in two modes: In admin mode, the component SHOULD be able to emit IQ stanzas in the same way as any entity, including managing roster or accessing persistent storage In client mode, a component MUST have an explicit autorization for any IQ namespace he wants to use. Client MUST be able to check and revoke granted permssions. In admin mode, the privileged entity MAY be able to emit IQ stanzas in the same way as any entity, including managing roster or accessing persistent storage. In client mode, a privileged entity MUST have an explicit autorization for any IQ namespace he wants to use. Client SHOULD be able to check and revoke granted permissions, and if it's not possible, permissions MUST be revoked after a disconnection. Once the component is authentified and stream is started as explained in &xep0114;, the component can request its privileged status. It do it by sending an IQ stanza with 'urn:xmpp:tmp:privilege:0' namespace Once the privileged entity is authentified and stream is started, the entity can request its privileged status. It do it by sending an IQ stanza with 'urn:xmpp:privilege:0' namespace Namespace permissions are asked with a <perm/> element, which MUST contain a 'namespace' attribute set to the requested namespace and a 'type' attribute which can be: If the server accept the privileged status (e.g.: admin status specified in configuration), it MUST return empty IQ result stanza: If the server accept the privileged status (e.g.: admin status specified in configuration), it MUST return an IQ result stanza, with allowed permissions in <perm/> elements: Note: the granted permissions MAY be different from the requested ones, according to server's configuration. If the server reject the privileged status, it MUST return a &forbidden; error: Sending an IQ stanzas is done by remplacing the &IQ; with a <privilege/> element of namespace 'urn:xmpp:tmp:privilege:0', and including it in a global IQ stanza. The <privilege/> element is then similar to the IQ stanza the client would have sent. In the following example, the PubSub service want to know juliet's roster because she own a node with roster access model: Sending an IQ stanzas is done by sending the stanza the way it would be done by the managed entity, except that its jid is in the 'to' attribute. In the following example, the PubSub service want to know juliet's roster because she own a node with access model based on publiser's roster: The server then answer normaly, as it would have done with the client entity:
+
+
-
-
-
+
+
In the following example, the sync.capulet.net privileged component want to access client's bookmarks to synchronize them with an online service. It can request the bookmarks in the following way:
-In the following example, the sync.capulet.net privileged entity want to access managed entity's bookmarks to synchronize them with an online service. It can request the bookmarks in the following way:
+and server answer:
In client mode, the component is not certified by the server administrator, so the permissions MUST be explicitly allowed by the client. This is initiated by the component (it can be after an interaction with a client, like a subscription). It's done in a the same way as for admin mode with the following exceptions:
+In client mode, the privileged entity is not certified by the server administrator, so the permissions MUST be explicitly allowed by the managed entity. This is initiated by the privileged entity (it can be after an interaction with a managed entity, like a subscription). It's done in the same way as for admin mode with the following exceptions:
Namespace permission are asked with a <perm/> element, which MUST contain a 'xmlns' attribute and a 'type' attribute which can be:
-If a component want a read/write access to a client's roster (juliet) and a read only access to her pubsub, it can ask the permission like this: +
If an entity want a read/write access to a client's roster (juliet) and a read only access to her pubsub, it can ask the permission like this:
-