diff twisted/plugins/pubsub.py @ 478:b544109ab4c4

Privileged Entity update + Pubsub Account Management partial implementation + Public Pubsub Subscription /!\ pgsql schema needs to be updated /!\ /!\ server conf needs to be updated for privileged entity: only the new `urn:xmpp:privilege:2` namespace is handled now /!\ Privileged entity has been updated to hanlde the new namespace and IQ permission. Roster pushes are not managed yet. XEP-0376 (Pubsub Account Management) is partially implemented. The XEP is not fully specified at the moment, and my messages on standard@ haven't seen any reply. Thus for now only "Subscribing", "Unsubscribing" and "Listing Subscriptions" is implemented, "Auto Subscriptions" and "Filtering" is not. Public Pubsub Subscription (https://xmpp.org/extensions/inbox/pubsub-public-subscriptions.html) is implemented; the XEP has been accepted by council but is not yet published. It will be updated to use subscription options instead of the <public> element actually specified, I'm waiting for publication to update the XEP. unsubscribe has been updated to return the `<subscription>` element as expected by XEP-0060 (sat_tmp needs to be updated). database schema has been updated to add columns necessary to keep track of subscriptions to external nodes and to mark subscriptions as public.
author Goffi <goffi@goffi.org>
date Wed, 11 May 2022 13:39:08 +0200
parents 607616f9ef5b
children
line wrap: on
line diff
--- a/twisted/plugins/pubsub.py	Mon Jan 03 16:48:22 2022 +0100
+++ b/twisted/plugins/pubsub.py	Wed May 11 13:39:08 2022 +0200
@@ -232,6 +232,7 @@
         from sat_pubsub.backend import BackendService, ExtraDiscoHandler
         from sat_pubsub.privilege import PrivilegesHandler
         from sat_pubsub.delegation import DelegationsHandler
+        from sat_pubsub.pam import PAMHandler
 
         if not config['jid'] or not config['xmpp_pwd']:
             raise usage.UsageError("You must specify jid and xmpp_pwd")
@@ -290,6 +291,10 @@
         ph.setHandlerParent(cs)
         bs.privilege = ph
 
+        pam = PAMHandler(config["jid"])
+        pam.setHandlerParent(cs)
+        bs.pam = pam
+
         resource = IPubSubResource(bs)
         resource.hideNodes = config["hide-nodes"]
         resource.serviceJID = config["jid"]