WARNING: This document has not yet been accepted for consideration or approved in any official manner by the XMPP Standards Foundation, and this document is not yet an XMPP Extension Protocol (XEP). If this document is accepted as a XEP by the XMPP Council, it will be published at <https://xmpp.org/extensions/> and announced on the <email@example.com> mailing list.
The introduction of PubSub brought a lot of new extensions that are now extensively used across the whole XMPP network. However PubSub never specified a way to clearly identify which extension is actually used on a specific node.
This extension defines a new namespace attribute on a node helping clients and servers implementations to know exactly what kind of data is in a node and how it should be used, i.e., server doing validation, or clients adapting their UI/UX to the type of data.
Having access to this data also enables a new range of features to base on top of this extension, such as filtering, restrictions, etc.
PubSub Namespace introduces a new PubSub Node metadata (as defined in Discover Entity Metadata) called urn:xmpp:pubsub-ns:0#namespace.
If a server supports the "Pubsub Namespaces" protocol, it MUST advertise the "urn:xmpp:pubsub-ns:0" feature (see Protocol Namespaces regarding issuance of one or more permanent namespaces) in response to a Service Discovery (XEP-0030) information request.
When a Pubsub service enables Pubsub namespaces all the node creation and configuration on this service MUST have a configured urn:xmpp:pubsub-ns:0#namespace with the namespace declared in the corresponding specification.
5.1.1 Configuring a node with an undefined namespace¶
Existing clients and libraries that are not implementing PubSub Namespaces will not provide the urn:xmpp:pubsub-ns:0#namespace attribute when creating or configuring a PubSub node.
Therefore, if the server supports Pubsub Namespaces and if the client is creating a node where the nodeid is contained in the list of nodes available in the Pubsub Namespaces Registrar, the server MUST then set the corresponding namespace referring to the nodeid.
If a node is created or configured with an empty namespace and the server doesn't find any correspondence in the Registrar, it MUST then return an error of type modify containing a bad-request element in the urn:ietf:params:xml:ns:xmpp-stanzas namespace, alongside a namespace-required element of namespace urn:xmpp:pubsub-ns:errors:0.
Services MUST expose the list of currently used namespaces in the result of a disco#info in a jabber:x:data form with a FORM_TYPE of value urn:xmpp:pubsub-ns:0 and a used-namespaces text-multi type field containing the various namespaces.
5.1.3 Restrict the list of allowed namespaces on a service¶
The server can define, per service, a list of namespaces to allow or block. The service will then expose the urn:xmpp:pubsub-ns:restrict:0 feature in its disco#info, and return a jabber:x:data form with a FORM_TYPE of value urn:xmpp:pubsub-ns:0 and an allowed-namespaces or blocked-namespaces text-multi type field containing the various namespaces.
If a list of allowed namespaces is defined, only those namespaces are authorized by the server to be used when a node is created on it.
If a list of blocked namespaces is defined, all the namespaces are authorized except those in the list.
If both allowed and blocked lists are defined, only the allowed list is considered.
The resulting list of blocked or allowed namespaces is available by doing a disco#info on the service.
This will be returned alongside used namespaces results, in the same jabber:x:data form.
TODO: iq/set interface to service for clients (perms implementation-defined) to set allowed / blocked namespaces? Which would justify the additional disco feature.
If the set namespace is forbidden by the service, it MUST return an error of type modify containing a bad-request element in the urn:ietf:params:xml:ns:xmpp-stanzas namespace, alongside a restricted-value element of namespace urn:xmpp:pubsub-ns:errors:0.
While requesting disco#items on a PubSub service, a client might want to only get nodes that are contained in certain namespaces. The client will then add a filter child of namespace urn:xmpp:pubsub-ns:0 to the query element, containing a jabber:x:data form with FORM_TYPE of value urn:xmpp:pubsub-ns:0 and an allowed-namespaces or blocked-namespaces text-multi type field containing the various namespaces it wants to filter.
In order to submit new values to this registry, the registrant shall define an XML fragment of the following form and either include it in the relevant XMPP Extension Protocol or send it to the email address <firstname.lastname@example.org>:
The registrant may register more than one namespace at a time, each contained in a separate <namespace/> element.
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.
Disclaimer of Warranty
## 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. ##
Limitation of Liability
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 from, out of, or in connection with the Specification or the implementation, deployment, or other use of 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 can be found at <https://xmpp.org/about/xsf/ipr-policy> or obtained by writing to XMPP Standards Foundation, P.O. Box 787, Parker, CO 80134 USA).
The HTML representation (you are looking at) is maintained by the XSF. It is based on the YAML CSS Framework, which is licensed under the terms of the CC-BY-SA 2.0 license.
The Extensible Messaging and Presence Protocol (XMPP) is defined in the XMPP Core (RFC 6120) and XMPP IM (RFC 6121) specifications contributed by the XMPP Standards Foundation to the Internet Standards Process, which is managed by the Internet Engineering Task Force in accordance with RFC 2026. Any protocol defined in this document has been developed outside the Internet Standards Process and is to be understood as an extension to XMPP rather than as an evolution, development, or modification of XMPP itself.
The following requirements keywords as used in this document are to be interpreted as described in RFC 2119: "MUST", "SHALL", "REQUIRED"; "MUST NOT", "SHALL NOT"; "SHOULD", "RECOMMENDED"; "SHOULD NOT", "NOT RECOMMENDED"; "MAY", "OPTIONAL".