From 3e5851cd31e0c4f3d9f6745936c79891cbc30698 Mon Sep 17 00:00:00 2001 From: "tmp_github@goffi.org" Date: Tue, 15 Oct 2024 17:01:36 +0200 Subject: [PATCH] Add ProtoXEP: Pubsub Extended Subscriptions This specification extends the XMPP PubSub protocol by introducing mechanisms for users to subscribe to an entire node hierarchy or to receive notifications on node metadata updates. --- inbox/pubsub-extended-subscription.xml | 275 +++++++++++++++++++++++++ 1 file changed, 275 insertions(+) create mode 100644 inbox/pubsub-extended-subscription.xml diff --git a/inbox/pubsub-extended-subscription.xml b/inbox/pubsub-extended-subscription.xml new file mode 100644 index 00000000..9a36ddf9 --- /dev/null +++ b/inbox/pubsub-extended-subscription.xml @@ -0,0 +1,275 @@ + + +%ents; +]> + + +
+ Pubsub Extended Subscriptions +This specification extends the XMPP PubSub protocol by introducing mechanisms for users to subscribe to an entire node hierarchy or to receive notifications on node metadata updates. + &LEGALNOTICE; + xxxx + ProtoXEP + Standards Track + Standards + Council + + XMPP Core + XEP-0001 + XEP-0060 + + + + pubsub-ext-sub + + Jérôme + Poisson + goffi@goffi.org + goffi@jabber.fr + + + 0.0.1 + 2024-10-15 + jp +

First draft.

+
+
+ + +

One of the key mechanisms in &xep0060; is its subscription functionality, which allows users to be notified of changes in node content. This specification extends this mechanism by allowing subscriptions to an entire hierarchy using "parent" relationships as defined in XEP-XXXX: Pubsub Node Relationships. Subscribers will receive notifications when items are published or retracted, nodes are added or removed from a branch, or nodes and their descendants are deleted. Additionally, the specification introduces an option for subscribing to metadata updates, enabling users to be notified of changes in node relationships, access models, or any other kind of metadata.

+
+ + +

The design goals of this XEP are:

+
    +
  • be backward compatible: nothing must be broken for existing implementations;
  • +
  • use existing mechanisms whenever possible;
  • +
  • allow clients to get node metadata updates;
  • +
  • allow clients to subscribe to node hierarchy when XEP-XXXX Pubsub Node Relationships' parent relationship is used;
  • +
  • allow clients to subscribe to linked nodes when XEP-XXXX Pubsub Node Relationships' link relationship is used.
  • +
+
+ + +

This specification uses subscription options as defined in &xep0060;. Those options can be configured by following §6.3 Configure Subscription Options.

+ +

The type of subscription is defined by the 'var' attribute with a value of "{urn:xmpp:pubsub-ext-sub:0}type". This option MUST have the type "list-multi", and it MUST default to only the "items" value. The possible values for this field are:

+
    +
  • items: subscribe to items notification, which is equivalent to a usual node subscription as defined at XEP-0060 §6.1 Subscribe to a Node.
  • +
  • metadata: subscribe to metadata updates, as explained in Metadata Notification.
  • +
  • linked items: subscribe to items with "link" relationship to this node, as explained in Linked Items Notification.
  • +
+
+ +

The subscription depth is used when a client wants to subscribe to a parent node and all its descendants (up to requested depth). The "parent" relationship is explained in XEP-XXXX Pubsub Node Relationships.

+

The 'var' attribute for the subscription depth field MUST be "{urn:xmpp:pubsub-ext-sub:0}depth", and it MUST have a type of "text-single".

+

The value MUST be castable to a signed integer, and it MUST default to "0". This value indicates how many levels of descendants this subscription must apply to:

+
    +
  • "0" for subscribing only to items on this node (the default);
  • +
  • "1" for subscribing to its items and direct children's items;
  • +
  • "2" for subscribing to items including up to two descendant levels, and so forth.
  • +
  • A negative value means unlimited depth is requested (i.e., subscription to the whole arborescence).
  • +
+

However, an implementation MAY limit the maximum depth for performance reasons; in such cases, it MUST be advertised through disco as explained in Discovering Support. When the subscription depth has a value different from "0", subscriptions must dynamically adapt to nodes added or removed within the arborescence: if a node gains a new "parent" relationship to any subscribed node, it will automatically become part of the subscription; conversely, if such a relationship is modified or the node is deleted, it will no longer be included in the subscription.

+
+
+ + + +

In this example, Romeo is subscribing to the 'some-node-name' node and requesting to receive notifications for items, metadata updates, and linked items within the entire node hierarchy (unlimited depth).

+ + + + + + + http://jabber.org/protocol/pubsub#subscribe_options + + + items + metadata + linked items + + + -1 + + + + + + ]]> + +

If the service allows the subscription, it MUST inform the requesting entity that it is now subscribed.

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

This section describes the notifications that are sent for each subscription type: items, metadata, and linked items.

+ + +

When a user subscribes to items, notifications are sent for items published or retracted within the subscribed node and its descendants (if applicable, and if the entity is allowed to see the item). Each notification contains an <items> element within an <event> element, which includes one or more <item> elements. This is the same notification as explained in XEP-0060 §7.1.2.1 Notification With Payload.

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

When a user subscribes to metadata updates, notifications are sent for changes in node metadata. Each notification contains a <configuration> element within an <event> element, which includes the updated metadata. The notification SHOULD include only the updated data.

+ + + + + + http://jabber.org/protocol/pubsub#meta-data + + + New Title + + + New Description + + + open + + + + + + ]]> +

When a node is removed from a branch of a parent relationship tree-like structure by changing the 'parent' field, and if it is part of a subscription with suitable depth, the last metadata notification is sent. This notifies the XMPP client that the node has been removed by checking the modified 'parent' field.

+

In the following example, the 'parent' field is changed to remove the node from the branch it was on. Note that the field is present, but set to an empty value.

+ + + + + + http://jabber.org/protocol/pubsub#meta-data + + + + + + + ]]> +
+ + +

When a user subscribes to linked items, notifications are sent for items published or retracted within nodes that have a "link" relationship with the subscribed node. Each notification contains an <items> element within an <event> element, which includes one or more <item> elements, as explained in &xep0060;. The subscription is effective even if the linked relationship was established after the initial subscription.

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

When subscribing with a specified depth on a node, an implicit subscription is created for all descendants up to the indicated number of levels (or without limit if the depth is a negative number). The depth implicit subscription depends on the subscription type: if "linked items" are requested, linked items MUST be included; otherwise, they MUST NOT be included (i.e., only descendants with no 'link' field set will trigger notifications).

+

Implicit subscriptions MUST respect the access model of the node where the item has been published and all its parent nodes as explained in XEP-XXXX: Pubsub Node Relationships §4.4 Parent Relationship Rules.

+
+ +
+
+ + +

A pubsub service MAY filter out metadata fields from notification, e.g., if they are not relevant in this use case, or if they would trigger too many notifications. This is an implementation-dependent decision.

+
+ + +

If a pubsub service supports the protocol specified in this XEP, it MUST advertise it by including the "urn:xmpp:pubsub-ext-sub:0" discovery feature in response to a &xep0030; information request.

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

If a pubsub service has a limitation in the maximum supported subscription depth, it MUST advertise that fact in the node metadata (as specified in XEP-0060 §5.4 Discover Node Metadata) with a field which MUST have a 'var' attribute set to "{urn:xmpp:pubsub-ext-sub:0}max-depth", a 'type' attribute set to "text-single", and a value which MUST be castable to an integer. If no such field is defined, that means the pubsub service has no depth limit.

+ + + + + + + + http://jabber.org/protocol/pubsub#meta-data + + + 20 + + + + +]]> + +
+ + + +

When doing an implicit subscription, pubsub service MUST be sure to respect the access model of implicitely subscribed node and all its parents as explained in XEP-XXXX Pubsub Node Relationships 4.4 Parent Relationship Rules. If an entity is not allowed by any of the access model, the pubsub service MUST NOT send a notification.

+

Similarly, a metadata update notification MUST NOT be send if the subscribed entity would not otherwise be allowed to see the metadata.

+ +
+ + +

This document does not require interaction with &IANA;.

+
+ + +

TODO

+
+ + +

Thanks to NLNet foundation/NGI Zero Core for funding the work on this specification.

+
+ +