# HG changeset patch # User Goffi # Date 1415884339 -3600 # Node ID 91d56a6e4b0df5aaa9995a1f81b315a55c279431 # Parent b04be960ebdf6a819db6afbea3bac362d2c0cffa xep: privileged entity update: - giving permission to manage this XEP namespace is forbidden - Added configuration section; with well-defined command node - better specification of persistent permissions - fixed erroneous example (server returns bookmarks) - added special permissions - better specification of element diff -r b04be960ebdf -r 91d56a6e4b0d xmpp/xep-proto-privileged-component.xml --- a/xmpp/xep-proto-privileged-component.xml Thu Nov 13 14:10:15 2014 +0100 +++ b/xmpp/xep-proto-privileged-component.xml Thu Nov 13 14:12:19 2014 +0100 @@ -35,6 +35,20 @@ goffi@jabber.fr + 0.0.3 + 2014-11-13 + jp +
    +
  • giving permission to manage this XEP namespace is forbidden
  • +
  • Added configuration section; with well-defined command node
  • +
  • better specification of persistent permissions
  • +
  • fixed erroneous example (server returns bookmarks)
  • +
  • added special permissions
  • +
  • better specification of &QUERY; element
  • +
+
+
+ 0.0.2 2014-09-17 jp @@ -52,8 +66,9 @@

First draft.

+ -

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.

+

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 (and in some cases, send &MESSAGE; or receive &PRESENCE; stanzas).

Privileged entity have numerous advantages, including:

  • a step forward in decentralization: it is possible for an entity to do tasks which were before reserved to server itself. For example, a privileged pubsub component can offer access model based on publisher's roster
  • @@ -63,27 +78,31 @@
  • server agnostic
+

A privileged entity can be used in two modes:

    -
  • admin mode, where it is installed by the server administrator
  • +
  • admin mode, where it is installed by the server administrator.
  • client mode, where it can be installed by any user
-

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.

+

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. The privilege mechanism MUST be totally transparent for the managed entities.

+

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.

+

In addition, some special permissions can permit to send &MESSAGE; stanzas on behalf of the server or access &PRESENCE; informations

+
  • Privileged entity — the entity which has or wants a privileged status.
  • Managed entity — the entity that the privileged entity wants to manage.
+ -

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:

+

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

+

The &QUERY; element MUST have a "request" type and MAY have a 'privilege' attribute with the value "admin". 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:

  • get — the entity wants to send &IQ; stanza of type 'get'
  • set — the entity wants to send &IQ; stanza of type 'set'
  • @@ -99,7 +118,7 @@ ]]> -

    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:

    +

    If the server accept the privileged status (e.g.: admin status specified in configuration), it MUST return an &IQ; result stanza with a "allowed" &QUERY; type, and allowed permissions in <perm/> elements:

    - -

    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:

    + +

    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 managed entity:

    @@ -159,15 +179,15 @@ ]]>

    and server answer:

    - - JC @@ -181,7 +201,6 @@
    -

    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:

    @@ -240,7 +259,7 @@ ]]>
    -

    The server SHOULD include a warning message, SHOULD translate the namespace to human friendly names (and MAY keep the original namespace in addition) and MUST set the default value to 'none' (permission refused). The server SHOULD use namespace as field var, so a client can use it to have a customized display.

    +

    The server SHOULD include a warning message, SHOULD translate the namespace to human friendly names (and MAY keep the original namespace in addition) and MUST set the default value to "none" (permission refused). The server SHOULD use namespace as field var, so a client can use it to have a customized display.

    The client can then answer to the form:

    @@ -268,8 +287,8 @@ ]]>

    The privileged entity can now act according to permission granted to him.

    - -

    sending IQ stanza is done in the exact same way as for admin mode. If an entity want to sent a non authorized IQ, it get a &forbidden; error:

    + +

    sending &IQ; stanza is done in the exact same way as for admin mode. If an entity want to sent a non authorized &IQ;, it get a &forbidden; error:

    @@ -286,8 +305,172 @@ ]]>
    + + +

    In some case, an entity may need extra permission beyond what &IQ; stanzas can do. An entity may want to send &MESSAGE; stanzas on behalf of the server, or get &PRESENCE; informations. The special permissions manage these cases with some restrictions.

    + + +

    With some namespaces it can be desirable to send notifications (e.g. PEP service), so the privileged entity must be able to send &MESSAGE; stanzas. To do this, it MUST request it by using a <perm/> element with the special "message" namespace attribute and a 'type' attribute with the value "outgoing" (any other type MUST be rejected with a &forbidden; error).

    +

    A privileged entity can then send message on the behalf either of the server or of a bare jid of the server, using &xep0297;, with the following restrictions:

    +
      +
    1. forwarded &MESSAGE; 'type' attribute has the value of "headline"
    2. +
    3. forwarded &MESSAGE; 'from' attribute MUST be a bare jid from the server, no resource is allowed
    4. +
    5. in client mode, the forwarded &MESSAGE; 'from' attribute can only be one of a managed entity which has explicitly accepted the delegation
    6. +
    +

    If any of this rules is violated, the server MUST return a <not-authorized/> stream error and close the connection, as explained in &rfc6120; section 4.9.3.12.

    +

    In the following example, pubsub.capulet.lit ask for pubsub and outgoing messages permission

    + + + + + + + ]]> + + + + + + + + ]]> +

    Now that pubsub.capulet.lit is allowed, it can send messages using <forwarded/> elements.

    + + + + + + + + Gerald Finzi + 255 + Music for "Love's Labors Lost" (Suite for small orchestra) + Introduction (Allegro vigoroso) + 1 + + + + + + + + + ]]> +

    The server see that forwarded message type is 'headline', that juliet@capulet.lit is a bare jid of the server, and that outgoing message permission was granted in admin mode (so all bare jids from server are allowed); it can now send the notification:

    + + + + + + Gerald Finzi + 255 + Music for "Love's Labors Lost" (Suite for small orchestra) + Introduction (Allegro vigoroso) + 1 + + + + + + + ]]> +
    + + +

    It can be often desirable for a privileged entity to have presence information of the managed entities (e.g. to know when to send it notificiations). As privileges must be transparent for the managed entity (in admin mode), this presence has to be sent by the server without modifying managed entity roster.

    +

    To do this, the privileged entity MUST ask for presence information when requesting privileges, using a special "presence" namespace attribute and a 'type' attribute with the value "managed_entity".

    If the delegation is granted, the server MUST use a directed presence, as specified in &rfc6121; section 4.6 on the behalf of managed entity each time its presence information change.

    This privilege MUST NOT be requested in client mode, and the server MUST reject the permission by setting the allowed type to "none". If an entity need presence information in client mode, it SHOULD request it using the normal &PRESENCE; subscription mechanism.

    + + + + + + +]]> + + + + + + + +]]> + + + chat + Staying on the balcony + +]]> + + chat + Staying on the balcony + +]]> +
    + + +

    In addition to "managed entity presence", a privileged entity may need to know when a contact in managed entity roster is online (for example, it's necessary for a PEP service because of the presence default access model).

    +

    In this case, privileged entity MUST ask for presence information when requesting privileges, using a special "presence" namespace attribute (as in previous section) and a 'type' attribute with the value "roster". Furthermore, the privileged entity MUST have read permission on roster namespace (i.e. 'type' attribute in allowed <perm> of namespace jabber:iq:roster MUST have a value of either get or both).

    +

    If the delegation is granted, the server MUST send to the privileged entity every presence information that the managing entity is receiving.

    The server MUST reject the permission if the privileged entity doesn't have read permission on roster namespace.

    +

    Note: this permission should be given carefully, as it give access to presence of potentially a lot of entities to the privileged entity (see security considerations). If allowed in client mode, server SHOULD display an extra warning when requesting permissions to the managed entity.

    + + + + + + + +]]> +

    Note the presence of jabber:iq:roster permission request.

    + + + + + + + + +]]> + + +]]> + + +]]> +
    + + +

    Server SHOULD provide a way to clients to check already granted permission, and revoke them by using &xep0050; on the well-defined command node of 'urn:xmpp:privilege:0#configure'.

    +

    If present, the configurations commands MUST allow at least to check permissions granted to a privileged entity, and to revoke them. A server MAY offer an option to keep permission from one session to an other (see business rules).

    +
    +

    If a server or an entity supports the entity privilege protocol, it MUST report that fact by including a service discovery feature of "urn:xmpp:privilege:0" in response to a &xep0030; information request:

    ]]>
    +
      -
    1. Server MAY keep permission granted to an entity by a client from one session to an other, but if it do so, it MUST provide a way to client to check already granted permission, and revoke them (possibly using &xep0050;).
    2. -
    3. If a client can't check or revoke permission (e.g. it doesn't support &xep0050;), the server MUST NOT keep granted permission from one session to an other, and permission will be asked on each new session.
    4. -
    5. If permissions are changed during a session, server MUST notify privileged entity of the new permissions, like in permission request use case
    6. +
    7. In client mode, server MAY keep permission granted to an entity by a client from one session to an other, but if it do so, it MUST provide configuration like explained in the suitable section. If server offer this feature, it SHOULD add a field directly in configuration commands.
    8. +
    9. If a client can't check or revoke permission (i.e. it doesn't support &xep0050;) when granting permissions, the server MUST NOT keep granted permissions from one session to an other, and permissions will be asked on each new session.
    10. +
    11. If permissions are changed during a session, server MUST notify privileged entity of the new permissions, like in permission request use case
    12. +
    13. A server MUST NOT grant permission for this XEP namespace ('urn:xmpp:privilege:0')
    +

    As admin mode is far more easy to implement than client mode, a server MAY choose to only implement the former

    +
    1. Privileged entity nearly have the same possibility as the server itself, admin permission should be granted carefuly, only if you absolutely trust the entity.
    2. -
    3. A server MAY choose to filter allowed namespaces, to avoid giving dangerous permissions. In this case, it MUST always set the allowed type of filtered namespaces to none
    4. +
    5. A server MAY choose to filter allowed namespaces, to avoid giving dangerous permissions. In this case, it MUST always set the allowed type of filtered namespaces to "none"
    6. +
    7. Roster presence is particulary sensitive, because if an entity accept this permission, it give presence information from its whole roster. For this reason, a server MAY choose to forbid its use in client mode (by always setting the allowed type to "none"). A server SHOULD at least disallow it in default configuration.
    8. In case of filtering, a whitelist system is more secure and SHOULD be prefered to a blacklist (idealy, configuration would allow no filtering, whitelist filtering and blacklist filtering)
    +

    This document requires no interaction with &IANA;.

    +

    The ®ISTRAR; includes 'urn:xmpp:privilege:0' in its registry of protocol namespaces (see &NAMESPACES;).

    @@ -343,6 +533,7 @@ &NSVER;
    + @@ -389,7 +580,10 @@ ]]> + -

    Thanks to Sergey Dobrov, Dave Cridland and Steven Lloyd Watkin for their feedbacks.

    +

    Thanks to Sergey Dobrov, Dave Cridland, Steven Lloyd Watkin, Lance Stout and Johannes Hund for their feedbacks.

    +

    The client mode permission mechanism is inspired from &xep0321; permission request.

    +