#389 Add support for multiple LDAP queries
Merged by vmaljulin. Opened by vmaljulin.
vmaljulin/waiverdb RHELWF-1187  into  master

Download 389.patch
no initial comment

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.

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.

1 new commit added

  • fixup! Rename the variable in test_monitor.py according to PEP8

Updated

Pull-Request has been merged by vmaljulin

Metadata