# HG changeset patch # User Goffi # Date 1426864390 -3600 # Node ID 21d0d0ab7aa013b936c6cf67e85790fd1ebf0750 # Parent 1eb3ec190ea156f62ac12e4278e2f3aa148beb6d xeps: renamed published proto-xeps, and updated them according to published version diff -r 1eb3ec190ea1 -r 21d0d0ab7aa0 xmpp/xep-0355.xml --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/xmpp/xep-0355.xml Fri Mar 20 16:13:10 2015 +0100 @@ -0,0 +1,575 @@ + + +%ents; +]> + + +
+ Namespace Delegation + This specification provides a way for XMPP server to delegate treatments for a namespace to an other entity + &LEGALNOTICE; + 0355 + Experimental + Standards Track + Standards + Council + + XMPP Core + XEP-0004 + XEP-0297 + + + + NOT_YET_ASSIGNED + + Jérôme + Poisson + goffi@goffi.org + goffi@jabber.fr + + + 0.1 + 2014-12-18 + XEP Editor (mam) +

Initial published version approved by the XMPP Council.

+
+ + 0.0.1 + 2014-11-13 + jp +

First draft.

+
+
+ +

Some XMPP features must be offered by the server itself, or can't be available, that's the case of &xep0163; which is used in several places (e.g. bookmarks storage). But it can be desirable to use an external entity to manage some of these features, because it implements things that the server don't, or because it uses a special implementation useful in a particular case. Some people may also want to decentralize a feature on an entity under their control. This XEP try to solve these cases.
Additionaly, a method to do generic treatments (independent of server) on stanza is also provided.

+

This XEP is complementary to priviliged entity XEP (and works in a similar way), although they can be used together or separately.

+

Here are some use cases of namespace delegation:

+
    +
  • use an external component for a PEP service because the server doesn't implement it or lacks some features
  • +
  • decentralize a server feature to an entity under client control
  • +
  • make a component which react on new user registration, independent of server implementation
  • +
  • server agnostic roster filtering
  • +
+
+ +

Namespace delegation can be used in two modes:

+
    +
  • admin mode, where delegation is specified by the server administrator.
  • +
  • client mode, where it can be requested by any user.
  • +
+

In admin mode, the managing entity manages stanza of the delegated namespace for all users registered on the server. The namespace delegation MUST be totally transparent for the managed entities.

+

In client mode, a managing entity MUST have an explicit authorization for any 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.

+
+ +
    +
  • Delegated namespace — the namespace being managed by an external entity.
  • +
  • Managing entity — the entity which actualy manages the delegated namespace.
  • +
  • Managed entity — an entity which wants to have a namespace of its server delegated to a managing entity.
  • +
+
+ + + + +

Once the managing entity is authenticated and stream is started, the entity can request to manage a namespace. It does it by sending an &IQ; stanza with 'urn:xmpp:delegation:0' namespace. The &QUERY; element MUST have a type of value "request" and MAY have a 'delegation' attribute with the value "admin".

+

Namespace delegations are asked with a <delegate/> element, which MUST contain a 'namespace' attribute set to the requested namespace.

+

Only <iq/> stanza namespaces can be delegated.

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

If the server accepts the delegation (e.g.: namespace mapping specified in configuration), it MUST return an &IQ; result stanza, with allowed delegations in <delegate> elements:

+ + + + + + +]]> +

Note: the granted delegations MAY be different from the requested ones, according to server's configuration.

+

The server MUST then forward all requests made to itself on this namespace to the managing entity, except the requests made by the managing entity itself (see below).
+ The server MUST NOT forward any request made to an other entity than itself or to a bare JID within its domain.

+
+ +

If the server rejects the delegation, it MUST return a &forbidden; error:

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

When a server receives a stanza for a delegated namespace which is either directed to him (no 'to' attribute, or 'to' attribute with its own JID), or directed to the bare JID of the sender (e.g. if 'from' attribute is "juliet@capulet.lit/balcony" and 'to' attribute is "juliet@capulet.lit"), it MUST forward it to the managing entity by replacing the 'to' attribute with the JID of the managing entity:

+ + + + + + + curse my nurse! + + + + + +]]> +

The server gets this stanza, sees that this namespace is delegated to pubsub.capulet.lit, so it forwards it:

+ + + + + + + + curse my nurse! + + + + + +]]> + +

The managing entity replies normally to the stanza:

+ + + +]]> + +

Then the server MUST change the from field of managing entity to its own JID, and send the answer back to Juliet with the original &IQ; id.

+ + + + +]]> + +

The workflow is fully transparent for Juliet.

+ +

If a stanza is sent by the managing entity on a managed namespace, the server MUST NOT forward it. This way, the managing entity can use privileged entity to do special treatments.

+

In the following examples, juliet@capulet.lit has its "jabber:iq:roster" namespace delegated to filter.capulet.lit. filter.capulet.lit is a server agnostic component which filters allowed entities (which can be added to a roster), and sort them in enforced groups.

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

filter.capulet.lit accepts to add Romeo, but all JIDs with a montaigu.lit must be in a "Rivals" group, so it first returns a success result (Romeo is accepted).

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

At this stade, the entity is accepted, but not added to the roster. filter.capulet.lit is also a privileged entity which can manage "jabber:iq:roster", so it uses this ability to add Romeo in the enforced group:

+ + + + Rivals + + + +]]> +

The namespace is delegated, but as the stanza is from the managing entity, the server manages it normally. The entity is also privileged, so it can change the stanza of Juliet, the server accepts:

+ + +]]> + +

The server will then send the roster pushes (with the enforced group) normally.

+ +
+ +
+ + +
+ + + +

In client mode, the managing entity is not certified by the server administrator, so the delegation MUST be explicitly allowed by the managed entity. This is initiated by the managing 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:

+
    +
  1. the delegation type is client instead of admin
  2. +
  3. the delegation is done per entity, so the managed entity MUST be specified in a 'to' attribute
  4. +
+

If an entity want to manage PEP service for Juliet, it can ask the delegation like this: +

+ + + + + + ]]> +

Once received the delegation request, the server ask to the client if it grant access to the requested namespace using &xep0004;. The server use a challenge which it MUST have generated itself. +

+ + + pubsub.montaigu.lit wants to manage a feature normally managed by the server. + Do you allow it to manage the following features? + + Be careful! According management to an entity is a serious thing, + think twice that you can trust the entity before doing this. + + + Delegation request + pubsub.montaigu.lit wants to manage the following features: + Do you allow it? + 5439123 + + urn:xmpp:delegation:0 + + + 0 + + + + + + ]]> +

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 '0' (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:

+ + + + + + 5439123 + 1 + + + ]]> +

Here Juliet allows pubsub.montaigu.lit to manage the PubSub (and then PEP) service.

+

Finaly, the server notifies the entity of the granted delegation. For this it uses a &QUERY; element with the 'allowed' type, and puts the client JID in a 'from' attribute:

+ + + + + + ]]> +

The managing entity can now manage the namespace the same way as in admin mode.

+
+ +
+ + +

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

+

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

+
+ + + +

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

+ + + + ]]> + + + ... + + ... + + + ]]> +
+ + +

When a server delegates a namespace to a managing entity, the later can have particular features which must be advertised by the former with disco protocol.

+

This is done by using a disco node, which is done the following way: if pubsub.capulet.int manages pubsub namespace, it MUST report that fact in discovery feature, and have a 'urn:xmpp:delegation:0::http://jabber.org/protocol/pubsub' node which reports the managed features.

The node name is obtained by concatenating this XEP namespace (urn:xmpp:delegation:0), a '::' separator, and the delegated namespace (here http://jabber.org/protocol/pubsub).
The server MUST advertise the result in its own discovery answer, and MUST ignore features of its internal component (here internal PubSub service).

+

In the following example, the capulet.int server delegates its internal PEP component to pubsub.capulet.int. capulet.int only supports REQUIRED PubSub features and auto-create, while pubsub.capulet.int supports REQUIRED PubSub features and publish-options, but not auto-create.
juliet@capulet.int asks its server what it is capable of, she is specially interested in PubSub capabilities.

+ + + + ]]> + +

Server delegates its PubSub namespace to pubsub.capulet.lit, so it asks its available features for this namespace like this:

+ + + + ]]> + +

Note that in real situation, server has probably this information already in cache (see Implementation Notes).
+ pubsub.capulet.lit returns its available features:

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

Server include the results in its own discovery info results:

+ + + + ... + + + + + ... + + + ]]> + +

Note that 'http://jabber.org/protocol/pubsub#auto-create' is not available.

+
+ +

As an entity may ask for discovery information on bare JID, which the server would answer, the managing entity must be able to send this kind of information.

+

To do so, the mechanism is the same as for server features, but the separator is ':bare:' instead of '::':

+ + + + + ]]> + +

Server delegate its PubSub namespace to pubsub.capulet.lit, so it ask its available features for this namespace like this:

+ + + + ]]> + +

As for general case, server has probably this information already in cache.
+ pubsub.capulet.lit returns its available features:

+ + + + + + + + + + + + + + + ... + + + ]]> + +

Then the server returns the answer to Juliet, as in general case, with requested bare JID in 'from' field.

+ + + + + + + + + + + + + + + + ... + + + ]]> + + +
+
+
+ + +
    +
  1. In client mode, server MAY keep delegations granted to an entity by a client from one session to an other, but if it does so, it MUST provide configuration like explained in the suitable section. If server offers this feature, it SHOULD add a field directly in configuration commands.
  2. +
  3. If a client can't check or revoke delegations (i.e. it doesn't support &xep0050;) when granting them, the server MUST NOT keep granted delegations from one session to an other, and delegations will be asked on each new session.
  4. +
  5. If delegations are changed during a session, server MUST notify managing entity of the new delegations, like in client delegation request use case.
  6. +
  7. The namespace of this XEP (urn:xmpp:delegation:0) MUST NOT be delegated. If an entity requests it, the server MUST return a &forbidden; error.
  8. +
+
+ +
    +
  1. As admin mode is far more easy to implement than client mode, and client mode may impact performances, a server MAY choose to only implement the former.
  2. +
  3. Because of the performance impact, a server SHOULD ask for disco features to nest to managing entity when delegation is accepted, and keep them in cache.
  4. +
+
+ +
    +
  1. Managing entity can manage sensitive data, admin delegation should be granted carefuly, only if you absolutely trust the entity.
  2. +
  3. A server MAY choose to filter allowed namespaces. In this case, it MUST always set the allowed type of filtered namespaces to 0.
  4. + +
  5. 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).
  6. +
+
+ +

This document requires no interaction with &IANA;.

+
+ + +

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

+
    +
  • urn:xmpp:delegation:0
  • +
+
+ + &NSVER; + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + ]]> + + +

This XEP is linked with &xep0356; and works in a similar way.

+

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

+

Thanks to Adrien Cossa for his typos/style corrections

+
+
diff -r 1eb3ec190ea1 -r 21d0d0ab7aa0 xmpp/xep-0356.xml --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/xmpp/xep-0356.xml Fri Mar 20 16:13:10 2015 +0100 @@ -0,0 +1,386 @@ + + +%ents; +]> + + +
+ Privileged Entity + This specification provides a way for XMPP entities to have a privileged access to some other entities data + &LEGALNOTICE; + 0356 + Experimental + Standards Track + Standards + Council + + XMPP Core + + + + NOT_YET_ASSIGNED + + Jérôme + Poisson + goffi@goffi.org + goffi@jabber.fr + + + 0.1 + 2015-01-27 + XEP Editor (mam) +

Initial published version approved by the XMPP Council.

+
+ + 0.0.4 + 2014-12-18 + jp +
    +
  • Big simplification and restriction following council's veto and standard@ discussions
  • +
  • Configuration is now done only on server own configuration
  • +
  • No more client mode
  • +
  • Permissions are adverised using &MESSAGE;
  • +
  • The only &IQ; privilege still available is jabber:iq:roster
  • +
+
+
+ + 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 +
    +
  • changed for privileged entity
  • +
  • fixes after feedbacks on standard mailing list
  • +
  • completed missing required parts
  • +
+
+
+ + 0.0.1 + 2014-05-09 + jp +

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 some other entity data with the same privileges than the entity itself, that means manage an entity roster on its behalf, send &MESSAGE; or receive &PRESENCE; stanzas in the name of the server.

+

Privileged entities 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
  • +
  • better integration of components: a gateway can add items to an entity roster itself
  • +
  • possibility to overpass a server limitation (typically: incomplete PEP implementation)
  • +
  • quick development cycle: developers can implement the components they need without waiting for a new server release
  • +
  • server agnostic
  • +
+

Privileged entity has been created with the main goal to create an external, server agnostic, PEP service. It is restricted to only a couple of features, see Acknowledgements section for more details

+
+ + +

A privileged entity must be able to do what a PEP service can do and to access roster, so it must be able to (according to configuration):

+
    +
  • get and modify the roster of any entity managed by the server
  • +
  • send a &MESSAGE; stanza on behalf of the server
  • +
  • access &PRESENCE; informations for entities in a managed entity's roster (and for managed entity itself)
  • +
+

The privilege mechanism MUST be totally transparent for the managed entities.

+
+ + +
    +
  • Privileged entity — the entity which has a privileged status.
  • +
  • Managed entity — the entity that is managed by a privileged entity.
  • +
+
+ + + + +

Roster access is granted in the server configuration. Roster access can have 4 types:

+
    +
  • none — the entity is not allowed to access managed entity roster at all. This MUST be the default value.
  • +
  • get — the entity is allowed to send &IQ; stanzas of type 'get' for the namespace 'jabber:iq:roster'.
  • +
  • set — the entity is allowed to send &IQ; stanzas of type 'set' for namespace 'jabber:iq:roster'.
  • +
  • both — the entity is allowed to send &IQ; stanzas of type 'get' and 'set' for namespace 'jabber:iq:roster'.
  • +
+
+ + +

Once an entity is authenticated and stream is started, the server send it a &MESSAGE; stanza with a <privilege> elements which MUST have the namespace 'urn:xmpp:privilege:0'. This element contains <perm> elements which MUST contain a 'namespace' attribute of the value "jabber:iq:roster" and a 'type' attribute which must correspond to the type configured as specified in "Server Allows Roster Access" section

+ + + + + + ]]> +

Here pubsub.capulet.lit is allowed to do get and set operations on all entities managed by capulet.lit

+
+ + +

Doing a get or set operation on the roster of a managed entity is done in the usual way (as described in &rfc6121; section 2), except that the 'to' attribute is set to the attribute of the managed entity. The server MUST check that the privileged entity has right to get or set the roster of managed entity, and MUST return a &forbidden; error if it is not the case:

+ + + + ]]> + +

The server then answers normally, as it would have done to the managed entity:

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

In some cases, it can be desirable to send notifications (e.g. PEP service), so the privileged entity must be able to send &MESSAGE; stanzas. This is allowed in server configuration in the same way as for roster permission. The permission type can have the following values:

+
    +
  • none — the entity is not allowed to send &MESSAGE; stanza in the name of the server. This MUST be the default value.
  • +
  • outgoing — the entity is allowed to send &MESSAGE; stanzas in the name of the server, according to following restrictions.
  • +
+

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. +
+

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.

+
+ + +

Server advertise "message" permission in the same way as for "roster" permission, except that 'namespace' attribute has the value of "message", and the 'type' attribute as a value of 'outgoing':

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

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 sees 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 them notificiations). As privileges must be transparent for the managed entity, this presence has to be sent by the server without modifying managed entity roster.

+

This is allowed in server configuration in the same way as for roster and message permissions. The "presence" type can have the following values:

+
    +
  • none — the entity is not allowed to access &PRESENCE; informations at all. This MUST be the default value.
  • +
  • managed_entity — the entity is allowed to receive managed entity presence (see below).
  • +
  • roster — the entity is allowed to receive presence informations of managed entity contacts, see Roster Presence section.
  • +
+

If the privilege 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.

+
+ + +

Server advertise "presence" permission in the same way as for "roster" or "message" permissions, except that 'namespace' attribute has the value of "presence", and the 'type' attribute has a value of "managed_entity"

+
+ + +

Once the "presence" permission is granted, the server send presence informations:

+ + 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).

+

As for other permissions, the access in granted in server's configuration, but there is a additional restriction: 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 privileged entity is receiving. Having "roster" type for "presence" permission imply that you have also implicitly "managed_entity" type.

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 gives access to presence of potentially a lot of entities to the privileged entity (see security considerations).

+
+ + +

Server advertise roster "presence" permission in the same way as for other permissions, except that the 'namespace' attribute has the value of "presence", and the 'type' attribute has a value of "roster"

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

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

+
+ + + +]]> + + +]]> + +
+ + +
    +
  1. Privileged entitiy has access to sensitive data, and can act as the server itself, permissions should be granted carefuly, only if you absolutely trust the entity.
  2. +
  3. Roster presence is particulary sensitive, because presence informations of whole rosters are shared.
  4. +
+
+ + +

This document requires no interaction with &IANA;.

+
+ + + +

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

+
    +
  • urn:xmpp:privilege:0
  • +
+
+ + &NSVER; + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + ]]> + + + +

Thanks to Sergey Dobrov, Dave Cridland, Steven Lloyd Watkin, Lance Stout and Johannes Hund for their feedbacks. Thanks to Adrien Cossa for his typos/style corrections.

+

Privileged entity was initialy written to be a generic identity based access control (IBAC) which allows an entity to access sensitive data. After a discussion on standard mailing list, it has been decided to restrict the current XEP to immediate needs to build an external PEP service, and to implement separately an Attribute Based Access Control (ABAC) which is more modern, generic and flexible. This XEP is still interesting for being easy to implement and doing the job.

+ +
+ +
diff -r 1eb3ec190ea1 -r 21d0d0ab7aa0 xmpp/xep-proto-namespace-delegation.xml --- a/xmpp/xep-proto-namespace-delegation.xml Sun Mar 08 14:33:03 2015 +0100 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,572 +0,0 @@ - - -%ents; -]> - - -
- namespace delegation - This specification provides a way for XMPP server to delegate treatments for a namespace to an other entity - - This XMPP Extension Protocol is copyright (c) 1999 - 2014 by the XMPP Standards Foundation (XSF). - Permission is hereby granted, free of charge, to any person obtaining a copy of this specification (the "Specification"), to make use of the Specification without restriction, including without limitation the rights to implement the Specification in a software program, deploy the Specification in a network service, and copy, modify, merge, publish, translate, distribute, sublicense, or sell copies of the Specification, and to permit persons to whom the Specification is furnished to do so, subject to the condition that the foregoing copyright notice and this permission notice shall be included in all copies or substantial portions of the Specification. Unless separate permission is granted, modified works that are redistributed shall not contain misleading information regarding the authors, title, number, or publisher of the Specification, and shall not claim endorsement of the modified works by the authors, any organization or project to which the authors belong, or the XMPP Standards Foundation. - ## NOTE WELL: This Specification is provided on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, express or implied, including, without limitation, any warranties or conditions of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A PARTICULAR PURPOSE. In no event shall the XMPP Standards Foundation or the authors of this Specification be liable for any claim, damages, or other liability, whether in an action of contract, tort, or otherwise, arising from, out of, or in connection with the Specification or the implementation, deployment, or other use of the Specification. ## - In no event and under no legal theory, whether in tort (including negligence), contract, or otherwise, unless required by applicable law (such as deliberate and grossly negligent acts) or agreed to in writing, shall the XMPP Standards Foundation or any author of this Specification be liable for damages, including any direct, indirect, special, incidental, or consequential damages of any character arising out of the use or inability to use the Specification (including but not limited to damages for loss of goodwill, work stoppage, computer failure or malfunction, or any and all other commercial damages or losses), even if the XMPP Standards Foundation or such author has been advised of the possibility of such damages. - This XMPP Extension Protocol has been contributed in full conformance with the XSF's Intellectual Property Rights Policy (a copy of which may be found at <http://xmpp.org/extensions/ipr-policy.shtml> or obtained by writing to XSF, P.O. Box 1641, Denver, CO 80201 USA). - - xxxx - ProtoXEP - Standards Track - Standards - Council - - XMPP Core - XEP-0004 - XEP-0297 - - - - NOT_YET_ASSIGNED - - Jérôme - Poisson - goffi@goffi.org - goffi@jabber.fr - - - 0.0.2 - 2014-11-27 - jp -

-
- - 0.0.1 - 2014-11-13 - jp -

First draft.

-
-
- -

Some XMPP features must be offered by the server itself, or can't be available, that's the case of &xep0163; which is used in several places (e.g. bookmarks storage). But it can be desirable to use an external entity to manage some of these features, because it implements things that the server don't, or because it uses a special implementation useful in a particular case. Some people may also want to decentralize a feature on an entity under their control. This XEP try to solve these cases.
Additionaly, a method to do generic treatments (independent of server) on stanza is also provided.

-

This XEP is complementary to priviliged entity XEP (and works in a similar way), although they can be used together or separately.

-

Here are some use cases of namespace delegation:

-
    -
  • use an external component for a PEP service because the server doesn't implement it or lacks some features
  • -
  • decentralize a server feature to an entity under client control
  • -
  • make a component which react on new user registration, independent of server implementation
  • -
  • server agnostic roster filtering
  • -
-
- -

Namespace delegation can be used in two modes:

-
    -
  • admin mode, where delegation is specified by the server administrator.
  • -
  • client mode, where it can be requested by any user.
  • -
-

In admin mode, the managing entity manages stanza of the delegated namespace for all users registered on the server. The namespace delegation MUST be totally transparent for the managed entities.

-

In client mode, a managing entity MUST have an explicit authorization for any 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.

-
- -
    -
  • Delegated namespace — the namespace being managed by an external entity.
  • -
  • Managing entity — the entity which actualy manages the delegated namespace.
  • -
  • Managed entity — an entity which wants to have a namespace of its server delegated to a managing entity.
  • -
-
- - - - -

Once the managing entity is authenticated and stream is started, the entity can request to manage a namespace. It does it by sending an &IQ; stanza with 'urn:xmpp:delegation:0' namespace. The &QUERY; element MAY have a 'delegation' attribute with the value "admin".

-

Namespace delegations are asked with a <delegate/> element, which MUST contain a 'namespace' attribute set to the requested namespace.

-

Only <iq/> stanza namespaces can be delegated.

- - - - - - - ]]> -
- -

If the server accepts the delegation (e.g.: namespace mapping specified in configuration), it MUST return an &IQ; result stanza, with allowed delegations in <delegate> elements:

- - - - - - -]]> -

Note: the granted delegations MAY be different from the requested ones, according to server's configuration.

-

The server MUST then forward all requests made to itself on this namespace to the managing entity, except the requests made by the managing entity itself (see below).
- The server MUST NOT forward any request made to an other entity than itself or to a bare JID within its domain.

-
- -

If the server rejects the delegation, it MUST return a &forbidden; error:

- - - - - - ]]> -
-
- - -

When a server receives a stanza for a delegated namespace which is either directed to him (no 'to' attribute, or 'to' attribute with its own JID), or directed to the bare JID of the sender (e.g. if 'from' attribute is "juliet@capulet.lit/balcony" and 'to' attribute is "juliet@capulet.lit"), it MUST forward it to the managing entity by replacing the 'to' attribute with the JID of the managing entity:

- - - - - - - curse my nurse! - - - - - -]]> -

The server gets this stanza, sees that this namespace is delegated to pubsub.capulet.lit, so it forwards it:

- - - - - - - - curse my nurse! - - - - - -]]> - -

The managing entity replies normally to the stanza:

- - - -]]> - -

Then the server MUST change the from field of managing entity to its own JID, and send the answer back to Juliet with the original &IQ; id.

- - - - -]]> - -

The workflow is fully transparent for Juliet.

- -

If a stanza is sent by the managing entity on a managed namespace, the server MUST NOT forward it. This way, the managing entity can use privileged entity to do special treatments.

-

In the following examples, juliet@capulet.lit has its "jabber:iq:roster" namespace delegated to filter.capulet.lit. filter.capulet.lit is a server agnostic component which filters allowed entities (which can be added to a roster), and sort them in enforced groups.

- - - - - - - -]]> - - - - - - - -]]> - -

filter.capulet.lit accepts to add Romeo, but all JIDs with a montaigu.lit must be in a "Rivals" group, so it first returns a success result (Romeo is accepted).

- -]]> - -]]> - -

At this stade, the entity is accepted, but not added to the roster. filter.capulet.lit is also a privileged entity which can manage "jabber:iq:roster", so it uses this ability to add Romeo in the enforced group:

- - - - Rivals - - - -]]> -

The namespace is delegated, but as the stanza is from the managing entity, the server manages it normally. The entity is also privileged, so it can change the stanza of Juliet, the server accepts:

- - -]]> - -

The server will then send the roster pushes (with the enforced group) normally.

- -
- -
- - -
- - - -

In client mode, the managing entity is not certified by the server administrator, so the delegation MUST be explicitly allowed by the managed entity. This is initiated by the managing 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:

-
    -
  1. the delegation type is client instead of admin
  2. -
  3. the delegation is done per entity, so the managed entity MUST be specified in a 'to' attribute
  4. -
-

If an entity want to manage PEP service for Juliet, it can ask the delegation like this: -

- - - - - - ]]> -

Once received the delegation request, the server ask to the client if it grant access to the requested namespace using &xep0004;. The server use a challenge which it MUST have generated itself. -

- - - pubsub.montaigu.lit wants to manage a feature normally managed by the server. - Do you allow it to manage the following features? - - Be careful! According management to an entity is a serious thing, - think twice that you can trust the entity before doing this. - - - Delegation request - pubsub.montaigu.lit wants to manage the following features: - Do you allow it? - 5439123 - - urn:xmpp:delegation:0 - - - 0 - - - - - - ]]> -

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 '0' (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:

- - - - - - 5439123 - 1 - - - ]]> -

Here Juliet allows pubsub.montaigu.lit to manage the PubSub (and then PEP) service.

-

Finaly, the server notifies the entity of the granted delegation. For this it uses a &QUERY; element with the client JID in a 'from' attribute:

- - - - - - ]]> -

The managing entity can now manage the namespace the same way as in admin mode.

-
- -
- - -

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

-

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

-
- - - -

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

- - - - ]]> - - - ... - - ... - - - ]]> -
- - -

When a server delegates a namespace to a managing entity, the later can have particular features which must be advertised by the former with disco protocol.

-

This is done by using a disco node, which is done the following way: if pubsub.capulet.int manages pubsub namespace, it MUST report that fact in discovery feature, and have a 'urn:xmpp:delegation:0::http://jabber.org/protocol/pubsub' node which reports the managed features.

The node name is obtained by concatenating this XEP namespace (urn:xmpp:delegation:0), a '::' separator, and the delegated namespace (here http://jabber.org/protocol/pubsub).
The server MUST advertise the result in its own discovery answer, and MUST ignore features of its internal component (here internal PubSub service).

-

In the following example, the capulet.int server delegates its internal PEP component to pubsub.capulet.int. capulet.int only supports REQUIRED PubSub features and auto-create, while pubsub.capulet.int supports REQUIRED PubSub features and publish-options, but not auto-create.
juliet@capulet.int asks its server what it is capable of, she is specially interested in PubSub capabilities.

- - - - ]]> - -

Server delegates its PubSub namespace to pubsub.capulet.lit, so it asks its available features for this namespace like this:

- - - - ]]> - -

Note that in real situation, server has probably this information already in cache (see Implementation Notes).
- pubsub.capulet.lit returns its available features:

- - - - - - - - - ]]> - -

Server include the results in its own discovery info results:

- - - - ... - - - - - ... - - - ]]> - -

Note that 'http://jabber.org/protocol/pubsub#auto-create' is not available.

-
- -

As an entity may ask for discovery information on bare JID, which the server would answer, the managing entity must be able to send this kind of information.

-

To do so, the mechanism is the same as for server features, but the separator is ':bare:' instead of '::':

- - - - - ]]> - -

Server delegate its PubSub namespace to pubsub.capulet.lit, so it ask its available features for this namespace like this:

- - - - ]]> - -

As for general case, server has probably this information already in cache.
- pubsub.capulet.lit returns its available features:

- - - - - - - - - - - - - - - ... - - - ]]> - -

Then the server returns the answer to Juliet, as in general case, with requested bare JID in 'from' field.

- - - - - - - - - - - - - - - - ... - - - ]]> - - -
-
-
- - -
    -
  1. In client mode, server MAY keep delegations granted to an entity by a client from one session to an other, but if it does so, it MUST provide configuration like explained in the suitable section. If server offers this feature, it SHOULD add a field directly in configuration commands.
  2. -
  3. If a client can't check or revoke delegations (i.e. it doesn't support &xep0050;) when granting them, the server MUST NOT keep granted delegations from one session to an other, and delegations will be asked on each new session.
  4. -
  5. If delegations are changed during a session, server MUST notify managing entity of the new delegations, like in client delegation request use case.
  6. -
  7. The namespace of this XEP (urn:xmpp:delegation:0) MUST NOT be delegated. If an entity requests it, the server MUST return a &forbidden; error.
  8. -
-
- -
    -
  1. As admin mode is far more easy to implement than client mode, and client mode may impact performances, a server MAY choose to only implement the former.
  2. -
  3. Because of the performance impact, a server SHOULD ask for disco features to nest to managing entity when delegation is accepted, and keep them in cache.
  4. -
-
- -
    -
  1. Managing entity can manage sensitive data, admin delegation should be granted carefuly, only if you absolutely trust the entity.
  2. -
  3. A server MAY choose to filter allowed namespaces. In this case, it MUST always set the allowed type of filtered namespaces to 0.
  4. - -
  5. 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).
  6. -
-
- -

This document requires no interaction with &IANA;.

-
- - -

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

-
    -
  • urn:xmpp:delegation:0
  • -
-
- - &NSVER; - -
- - - - - - - - - - - - - - - - - - - - - - - - - ]]> - - -

This XEP is linked with XEP-XXXX privileged entity and works in a similar way.

-

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

-

Thanks to Adrien Cossa for his typos/style corrections

-
-
diff -r 1eb3ec190ea1 -r 21d0d0ab7aa0 xmpp/xep-proto-privileged-component.xml --- a/xmpp/xep-proto-privileged-component.xml Sun Mar 08 14:33:03 2015 +0100 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,386 +0,0 @@ - - -%ents; -]> - - -
- privileged entity - This specification provides a way for XMPP entities to have a privileged access to some other entities data - - This XMPP Extension Protocol is copyright (c) 1999 - 2014 by the XMPP Standards Foundation (XSF). - Permission is hereby granted, free of charge, to any person obtaining a copy of this specification (the "Specification"), to make use of the Specification without restriction, including without limitation the rights to implement the Specification in a software program, deploy the Specification in a network service, and copy, modify, merge, publish, translate, distribute, sublicense, or sell copies of the Specification, and to permit persons to whom the Specification is furnished to do so, subject to the condition that the foregoing copyright notice and this permission notice shall be included in all copies or substantial portions of the Specification. Unless separate permission is granted, modified works that are redistributed shall not contain misleading information regarding the authors, title, number, or publisher of the Specification, and shall not claim endorsement of the modified works by the authors, any organization or project to which the authors belong, or the XMPP Standards Foundation. - ## NOTE WELL: This Specification is provided on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, express or implied, including, without limitation, any warranties or conditions of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A PARTICULAR PURPOSE. In no event shall the XMPP Standards Foundation or the authors of this Specification be liable for any claim, damages, or other liability, whether in an action of contract, tort, or otherwise, arising from, out of, or in connection with the Specification or the implementation, deployment, or other use of the Specification. ## - In no event and under no legal theory, whether in tort (including negligence), contract, or otherwise, unless required by applicable law (such as deliberate and grossly negligent acts) or agreed to in writing, shall the XMPP Standards Foundation or any author of this Specification be liable for damages, including any direct, indirect, special, incidental, or consequential damages of any character arising out of the use or inability to use the Specification (including but not limited to damages for loss of goodwill, work stoppage, computer failure or malfunction, or any and all other commercial damages or losses), even if the XMPP Standards Foundation or such author has been advised of the possibility of such damages. - This XMPP Extension Protocol has been contributed in full conformance with the XSF's Intellectual Property Rights Policy (a copy of which may be found at <http://xmpp.org/extensions/ipr-policy.shtml> or obtained by writing to XSF, P.O. Box 1641, Denver, CO 80201 USA). - - xxxx - ProtoXEP - Standards Track - Standards - Council - - XMPP Core - - - - NOT_YET_ASSIGNED - - Jérôme - Poisson - goffi@goffi.org - goffi@jabber.fr - - - 0.0.4 - 2014-12-18 - jp -
    -
  • Big simplification and restriction following council's veto and standard@ discussions
  • -
  • Configuration is now done only on server own configuration
  • -
  • No more client mode
  • -
  • Permissions are adverised using &MESSAGE;
  • -
  • The only &IQ; privilege still available is jabber:iq:roster
  • -
-
-
- - 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 -
    -
  • changed for privileged entity
  • -
  • fixes after feedbacks on standard mailing list
  • -
  • completed missing required parts
  • -
-
-
- - 0.0.1 - 2014-05-09 - jp -

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 some other entity data with the same privileges than the entity itself, that means manage an entity roster on its behalf, send &MESSAGE; or receive &PRESENCE; stanzas in the name of the server.

-

Privileged entities 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
  • -
  • better integration of components: a gateway can add items to an entity roster itself
  • -
  • possibility to overpass a server limitation (typically: incomplete PEP implementation)
  • -
  • quick development cycle: developers can implement the components they need without waiting for a new server release
  • -
  • server agnostic
  • -
-

Privileged entity has been created with the main goal to create an external, server agnostic, PEP service. It is restricted to only a couple of features, see Acknowledgements section for more details

-
- - -

A privileged entity must be able to do what a PEP service can do and to access roster, so it must be able to (according to configuration):

-
    -
  • get and modify the roster of any entity managed by the server
  • -
  • send a &MESSAGE; stanza on behalf of the server
  • -
  • access &PRESENCE; informations for entities in a managed entity's roster (and for managed entity itself)
  • -
-

The privilege mechanism MUST be totally transparent for the managed entities.

-
- - -
    -
  • Privileged entity — the entity which has a privileged status.
  • -
  • Managed entity — the entity that is managed by a privileged entity.
  • -
-
- - - - -

Roster access is granted in the server configuration. Roster access can have 4 types:

-
    -
  • none — the entity is not allowed to access managed entity roster at all. This MUST be the default value.
  • -
  • get — the entity is allowed to send &IQ; stanzas of type 'get' for the namespace 'jabber:iq:roster'.
  • -
  • set — the entity is allowed to send &IQ; stanzas of type 'set' for namespace 'jabber:iq:roster'.
  • -
  • both — the entity is allowed to send &IQ; stanzas of type 'get' and 'set' for namespace 'jabber:iq:roster'.
  • -
-
- - -

Once an entity is authenticated and stream is started, the server send it a &MESSAGE; stanza with a <privilege> elements which MUST have the namespace 'urn:xmpp:privilege:0'. This element contains <perm> elements which MUST contain a 'namespace' attribute of the value "jabber:iq:roster" and a 'type' attribute which must correspond to the type configured as specified in "Server Allows Roster Access" section

- - - - - - ]]> -

Here pubsub.capulet.lit is allowed to do get and set operations on all entities managed by capulet.lit

-
- - -

Doing a get or set operation on the roster of a managed entity is done in the usual way (as described in &rfc6121; section 2), except that the 'to' attribute is set to the attribute of the managed entity. The server MUST check that the privileged entity has right to get or set the roster of managed entity, and MUST return a &forbidden; error if it is not the case:

- - - - ]]> - -

The server then answers normally, as it would have done to the managed entity:

- - - - - - - ]]> - -
-
- - - -

In some cases, it can be desirable to send notifications (e.g. PEP service), so the privileged entity must be able to send &MESSAGE; stanzas. This is allowed in server configuration in the same way as for roster permission. The permission type can have the following values:

-
    -
  • none — the entity is not allowed to send &MESSAGE; stanza in the name of the server. This MUST be the default value.
  • -
  • outgoing — the entity is allowed to send &MESSAGE; stanzas in the name of the server, according to following restrictions.
  • -
-

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. -
-

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.

-
- - -

Server advertise "message" permission in the same way as for "roster" permission, except that 'namespace' attribute has the value of "message", and the 'type' attribute as a value of 'outgoing':

- - - - - - -]]> -
- - -

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 sees 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 them notificiations). As privileges must be transparent for the managed entity, this presence has to be sent by the server without modifying managed entity roster.

-

This is allowed in server configuration in the same way as for roster and message permissions. The "presence" type can have the following values:

-
    -
  • none — the entity is not allowed to access &PRESENCE; informations at all. This MUST be the default value.
  • -
  • managed_entity — the entity is allowed to receive managed entity presence (see below).
  • -
  • roster — the entity is allowed to receive presence informations of managed entity contacts, see Roster Presence section.
  • -
-

If the privilege 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.

-
- - -

Server advertise "presence" permission in the same way as for "roster" or "message" permissions, except that 'namespace' attribute has the value of "presence", and the 'type' attribute has a value of "managed_entity"

-
- - -

Once the "presence" permission is granted, the server send presence informations:

- - 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).

-

As for other permissions, the access in granted in server's configuration, but there is a additional restriction: 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 privileged entity is receiving. Having "roster" type for "presence" permission imply that you have also implicitly "managed_entity" type.

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 gives access to presence of potentially a lot of entities to the privileged entity (see security considerations).

-
- - -

Server advertise roster "presence" permission in the same way as for other permissions, except that the 'namespace' attribute has the value of "presence", and the 'type' attribute has a value of "roster"

- - - - - - - -]]> -

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

-
- - - -]]> - - -]]> - -
- - -
    -
  1. Privileged entitiy has access to sensitive data, and can act as the server itself, permissions should be granted carefuly, only if you absolutely trust the entity.
  2. -
  3. Roster presence is particulary sensitive, because presence informations of whole rosters are shared.
  4. -
-
- - -

This document requires no interaction with &IANA;.

-
- - - -

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

-
    -
  • urn:xmpp:privilege:0
  • -
-
- - &NSVER; - -
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - ]]> - - - -

Thanks to Sergey Dobrov, Dave Cridland, Steven Lloyd Watkin, Lance Stout and Johannes Hund for their feedbacks. Thanks to Adrien Cossa for his typos/style corrections.

-

Privileged entity was initialy written to be a generic identity based access control (IBAC) which allows an entity to access sensitive data. After a discussion on standard mailing list, it has been decided to restrict the current XEP to immediate needs to build an external PEP service, and to implement separately an Attribute Based Access Control (ABAC) which is more modern, generic and flexible. This XEP is still interesting for being easy to implement and doing the job.

- -
- -