From 3529c3052821493eb85a526d4309cbde39e11916 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=A9r=C3=B4me=20Poisson?= Date: Fri, 15 Oct 2021 14:44:59 +0200 Subject: [PATCH] XEP-0355: version 0.513 - delegation of Remaining Discovery Infos - delegation of Bare JID Disco Items - Security Consideration about disco requests - namespace bump - typos --- xep-0355.xml | 343 +++++++++++++++++++++++++++++++++++++++++++++------ 1 file changed, 307 insertions(+), 36 deletions(-) diff --git a/xep-0355.xml b/xep-0355.xml index 9430611d..650bff21 100644 --- a/xep-0355.xml +++ b/xep-0355.xml @@ -10,7 +10,7 @@ This specification provides a way for XMPP server to delegate treatments for a namespace to an other entity &LEGALNOTICE; 0355 - Deferred + Experimental Standards Track Standards Council @@ -28,18 +28,36 @@ goffi@goffi.org goffi@jabber.fr + + + 0.5 + 2021-10-15 + jp + +
    +
  • delegation of Remaining Discovery Infos
  • +
  • delegation of Bare JID Disco Items
  • +
  • Security Consideration about disco requests
  • +
  • namespace bump
  • +
  • typos
  • +
+
+
+ 0.4.2 2021-03-04 mw

Cross-document editorial adjustments for inclusive language.

+ 0.4.1 2018-11-03 pep Fix a bunch of typos, batch-style. + 0.4 2017-09-11 @@ -81,7 +99,7 @@
  • Added attribute filtering, mainly to manage correctly MAM
  • Simplification of configuration in admin mode: no more &IQ; negociation
  • Delegations notifications to the managing entity are now done with a &MESSAGE; stanza
  • -
  • Forwarding now use &xep0297; to avoid server to parse every stanza and a to have a cleaner separation
  • +
  • Forwarding now use &xep0297; to avoid server to parse every stanza and to have a cleaner separation
  • The behaviour when managing entity is unavailable is specified
  • Use of namespace in field var for client mode negociation is now mandatory
  • Behaviour when managing a delegation kept between session in client mode, when managing entity is not available, is specified
  • @@ -142,18 +160,18 @@

    Namespaces delegations are granted in the server configuration. Only &IQ; stanza namespaces can be delegated.

    A feature is delegated using:

      -
    1. its namespace: e.g. 'urn:xmpp:mam:0'
    2. +
    3. its namespace: e.g. 'urn:xmpp:mam:2'
    4. zero or more filtering attribute (attributes which must be present in the initial &IQ; child element): e.g. 'node'
    5. the jid of the managing entity: e.g. 'managing.capulet.lit'
    -

    Once the managing entity is authenticated and stream is started, the server send it a &MESSAGE; stanza with a <delegation/> elements which MUST have the 'urn:xmpp:delegation:1' namespace. This element contains <delegated/> elements which MUST contain a 'namespace' attribute indicating the delegated namespace. If there is additional attribute filtering, the <delegated/> can have children <attribute/> elements which MUST contain a 'name' attribute with the name of the filtering attribute.

    +

    Once the managing entity is authenticated and stream is started, the server send it a &MESSAGE; stanza with a <delegation/> elements which MUST have the 'urn:xmpp:delegation:2' namespace. This element contains <delegated/> elements which MUST contain a 'namespace' attribute indicating the delegated namespace. If there is additional attribute filtering, the <delegated/> can have children <attribute/> elements which MUST contain a 'name' attribute with the name of the filtering attribute.

    - - + + @@ -182,14 +200,14 @@ ]]>

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

    -

    To forward, an &IQ; stanza of type "set" is used which contain a <delegation/> element (with namespace 'urn:xmpp:delegation:1') which in turn contain a <forwarded/> element encapsulating the initial stanza, according to &xep0297;:

    +

    To forward, an &IQ; stanza of type "set" is used which contain a <delegation/> element (with namespace 'urn:xmpp:delegation:2') which in turn contain a <forwarded/> element encapsulating the initial stanza, according to &xep0297;:

    - - + ]]>

    The managing entity replies to the stanza by encapsulating its &IQ; result in the same way:

    - - + Then the server MUST decapsulate the &IQ; result, MUST insure that the 'to' and the 'from' attribute corresponds to respectively the 'from' and the 'to' attributes of the initial stanza, MUST insure that the 'id' attribute of the decapsulated stanza is the same as the initial 'id' attribute and that 'type' is "result". If everything is alright, it can send the decapsulated stanza to Juliet.

    If the forwarded result from managing entity is bad (i.e. wrong 'to', 'from', 'id' or 'result' attributes), the server MUST send an &IQ; error with condition <service-unavailable/> to managed entity, and MAY close the connexion with managing entity.

    - @@ -265,7 +283,7 @@ to='pubsub.capulet.lit' id='delegate1' type='set'> - + - +

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

    -

    To request delegation for a particular entity, the managing entity MUST have an &IQ; stanza with 'urn:xmpp:delegation:1' namespace. The &QUERY; element MUST have a 'to' attribute which specify the entity it wants to manage.

    +

    To request delegation for a particular entity, the managing entity MUST have an &IQ; stanza with 'urn:xmpp:delegation:2' namespace. The &QUERY; element MUST have a 'to' attribute which specify the entity it wants to manage.

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

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

    - @@ -369,7 +387,7 @@ Do you allow it? 5439123 - urn:xmpp:delegation:1 + urn:xmpp:delegation:2 Finaly, the server notifies the entity of the granted delegation. It do this in the same way as for admin mode, except that the <delegation/> element has an attitional 'to' attribute set to the managed entity bare jid:

    - + @@ -418,13 +436,13 @@ -

    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:1#configure'.

    +

    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:2#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:1" in response to a &xep0030; information request:

    +

    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:2" in response to a &xep0030; information request:

    ... - + ...
    @@ -449,7 +467,7 @@

    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 built in the following way: if pubsub.capulet.int manages pubsub namespace, it MUST report that fact in discovery feature, and have a 'urn:xmpp:delegation:1::http://jabber.org/protocol/pubsub' node which reports the managed features.

    The node name is obtained by concatenating this XEP namespace (urn:xmpp:delegation:1), 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).

    +

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

    The node name is obtained by concatenating this XEP namespace (urn:xmpp:delegation:2), 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.

    + node='urn:xmpp:delegation:2::http://jabber.org/protocol/pubsub'/>
    ]]>
    @@ -479,7 +497,7 @@ to='capulet.lit' type='result'> + node='urn:xmpp:delegation:2::http://jabber.org/protocol/pubsub'> @@ -495,7 +513,7 @@ to='juliet@capulet.lit/balcony' type='result'> - + ... @@ -509,11 +527,11 @@

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

    N.B.: In the special case of attribute filtering, the server still display managing entity's features for the whole delegated namespace instead of its own internal ones.

    - +

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

    - + node='urn:xmpp:delegation:2:bare:http://jabber.org/protocol/pubsub'/>
    ]]>
    @@ -541,7 +559,7 @@ to='capulet.lit' type='result'> + node='urn:xmpp:delegation:2:bare:http://jabber.org/protocol/pubsub'> @@ -589,6 +607,259 @@

    Extensions of Service Discovery as specified in &xep0128; follow the same rules: for the delegated namespace, internal extensions MUST be removed and extensions of managing entity MUST be included instead.

    + + +

    It may be necessary for a managing entity to advertise feature on a node which is unknown at the time of configuration. This is notably the case for a PEP component: features must be advertisable on disco nodes mapping pubsub nodes.

    +

    To allows that, the special namespace 'urn:xmpp:delegation:2:bare:disco#info:*' is used, and means "delegate information discovery requests made on bare jids for any discovery node which is not already managed by the server".

    + + + +]]> + +

    The node 'urn:xmpp:microblog:0' is not managed by the server. Normally, this would result as an <item-not-found> &IQ; error, but the namespace 'urn:xmpp:delegation:2:bare:disco#info:*' is delegated to pubsub.capulet.lit, thus the server delegate the stanza to the managing entity:

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

    The managing entity answers with its own disco features for the requested node:

    + + + + + + + + + + http://jabber.org/protocol/pubsub#meta-data + + + leaf + + + true + + + max + + + whitelist + + + + + + + + + + +]]> + +

    Then the server decapsulate the &IQ; result, validate it as explained in Server Forwards Delegated &IQ; Stanza, and send the result to Juliet:

    + + + + + + http://jabber.org/protocol/pubsub#meta-data + + + leaf + + + true + + + max + + + whitelist + + + + + + + +]]> +
    + + +

    A managing entity must be able to answer items discovery requests on bare jids. For PEP components, this is used to show available nodes on the service. Furthermore, An information discovery request or an items discovery requests on a node corresponding to an item advertised by the managing entity must be forwarded to the managing entity too.

    +

    This is done by using the special namespace 'urn:xmpp:delegation:2:bare:disco#items:*' which means "delegate items discovery made on bare jids with no node specified and all items discovery requests made on bare jids with a node which is not already managed by the server".

    +

    Note: When no node is used, and unlike the disco#info case, the server SHOULD NOT nest its internal items with the ones from managing entity. The reason is that bare jids disco items are usually used for PEP nodes, and the server would then mix internal PEP nodes with the managing entity nodes, which would be confusing for XMPP clients and end-users. The server implementation MAY choose to nest items anyway, in which case the mechanism is the same as for disco#info.

    +

    A server SHOULD NOT cache result of forwarded disco#items requests, as this is highly dynamic.

    + + + + +]]> + +

    The namespace 'urn:xmpp:delegation:2:bare:disco#items:*' is delegated to pubsub.capulet.lit, thus the server delegate the stanza to the managing entity:

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

    The managing entity answers with its own disco items for Juliet's JID:

    + + + + + + + + + … + + … + + + + + +]]> + +

    Then the server decapsulate the &IQ; result, validate it as explained in Server Forwards Delegated &IQ; Stanza, and send the result to Juliet:

    + + + + + … + + … + + +]]> + +

    Juliet now wants to know the IDs of blog items which has been published on her blog, to do so she does an items discovery request on her own bare jid with the 'urn:xmpp:microblog:0' node:

    + + + + +]]> + +

    Because the special namespace 'urn:xmpp:delegation:2:bare:disco#items:*' is delegated to pubsub.capulet.lit, the server forward the request to this managing entity:

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

    The managing entity answers with its own disco items for the requested entity and node (pubsub.capulet.lit being a PEP service, the items are actually Juliet's blog items IDs):

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

    The server decapsulates the &IQ; result, validate it as explained in Server Forwards Delegated &IQ; Stanza, and send the result to Juliet:

    + + + + + + + +]]> + +
    +
    @@ -598,14 +869,14 @@
  • 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.
  • If delegations are changed during a session, server MUST notify managing entity of the new delegations, like in client delegation request use case.
  • If delegations are kept between sessions in client mode, and the managing entity is not available or return an error, the server MUST return an &IQ; error with condition <service-unavailable/> when a delegated namespace is requested, like explained in "Server Forwards Delegated &IQ; Stanza" section.
  • -
  • The namespace of this XEP (urn:xmpp:delegation:1) MUST NOT be delegated. If an entity requests it, the server MUST return a &forbidden; error.
  • +
  • The namespace of this XEP (urn:xmpp:delegation:2) MUST NOT be delegated. If an entity requests it, the server MUST return a &forbidden; error.
    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. 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.
    3. -
    4. &rfc6120; section 10.1 require in-order processing of stanzas, which may be problematic for this extension: either the server blocks the traffic until the managing entity answer - which can lead to severe performance impact -, or the server doesn't block and may loose order. The recommended way is to not block the traffic while waiting for managing entity answer to avoid performance issues. A future version of this XEP may include an attribute to request traffic blocking. In admin mode the server implementation MAY chooses to have a blocking option (which SHOULD be per namespace, not global). +
    5. &rfc6120; section 10.1 require in-order processing of stanzas, which may be problematic for this extension: either the server blocks the traffic until the managing entity answers - which can lead to severe performance impact -, or the server doesn't block and may loose order. The recommended way is to not block the traffic while waiting for managing entity answer to avoid performance issues. A future version of this XEP may include an attribute to request traffic blocking. In admin mode the server implementation MAY chooses to have a blocking option (which SHOULD be per namespace, not global).
    @@ -613,8 +884,8 @@
    1. Managing entity can manage sensitive data, admin delegation should be granted carefuly, only if you absolutely trust the entity.
    2. A server MAY choose to filter allowed namespaces. In this case, it MUST always set the allowed type of filtered namespaces to 0.
    3. -
    4. In case of filtering, an allowlist system is more secure and SHOULD be prefered to a blocklist (idealy, configuration would allow no filtering, allowlist filtering and blocklist filtering).
    5. +
    6. Managing entity must be careful about not leaking the existence of an account (see XEP-0030 Security Considerations).
    @@ -622,9 +893,9 @@ -

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

    +

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

      -
    • urn:xmpp:delegation:1
    • +
    • urn:xmpp:delegation:2
    @@ -637,8 +908,8 @@