There is always one host. I don't see a reason why multiple hosts would be needed.
It would be also faster if ldap.initialize(ldap_host) is called only once in waiverdb request.
ldap.initialize(ldap_host)
Better to have a single new option with both base and filter values. E.g.:
LDAP_SEARCHES = [ { "base": "ou=Groups,dc=example,dc=com", "filter": "(memberUid={user})"}, }, # ... ]
You would just need to handle the backwards compatibility elsewhere.
If you check the set(group_membership) & set(allowed_groups) here, you can avoid doing any following LDAP queries.
set(group_membership) & set(allowed_groups)
1 new commit added
fixup! Rename the variable in test_monitor.py according to PEP8
Updated
+1
Pull-Request has been merged by vmaljulin