Răsfoiți Sursa

Change plugin structure, bump version

Daniel Gruno 5 ani în urmă
părinte
comite
ca8a32514e
3 a modificat fișierele cu 17 adăugiri și 4 ștergeri
  1. 13 0
      CHANGELOG.md
  2. 0 0
      plugins/ldap.py
  3. 4 4
      pypubsub.py

+ 13 - 0
CHANGELOG.md

@@ -0,0 +1,13 @@
+# 0.4.2
+- Changed plugin structure
+
+# 0.4.1
+- Added CLI arguments for specifying configuration file paths.
+
+# 0.4.0
+- Various internal optimizations
+- Better configuration vetting
+- Added asynchronous LDAP ACL support (see README.md for details)
+
+# 0.3.0
+- Initial public release.

+ 0 - 0
pypubsub_ldap.py → plugins/ldap.py


+ 4 - 4
pypubsub.py

@@ -26,10 +26,10 @@ import netaddr
 import binascii
 import base64
 import argparse
-import pypubsub_ldap
+import plugins.ldap
 
 # Some consts
-PUBSUB_VERSION = '0.4.1'
+PUBSUB_VERSION = '0.4.2'
 PUBSUB_BAD_REQUEST = "I could not understand your request, sorry! Please see https://pubsub.apache.org/api.html \
 for usage documentation.\n"
 PUBSUB_PAYLOAD_RECEIVED = "Payload received, thank you very much!\n"
@@ -49,7 +49,7 @@ class Server:
 
         if 'ldap' in self.config.get('clients', {}):
             self.lconfig = self.config['clients']['ldap']
-            pypubsub_ldap.vet_settings(self.lconfig)
+            plugins.ldap.vet_settings(self.lconfig)
         self.acl = {}
         try:
             self.acl = yaml.safe_load(open(args.acl))
@@ -191,7 +191,7 @@ class Subscriber:
                     return acl
             elif self.server.lconfig:
                 acl = {}
-                groups = await pypubsub_ldap.get_groups(self.server.lconfig, u, p)
+                groups = await plugins.ldap.get_groups(self.server.lconfig, u, p)
                 # Make sure each ACL segment is a list of topics
                 for k, v in self.server.lconfig['acl'].items():
                     if k in groups: