def __init__()

in plugins/ldap.py [0:0]


    def __init__(self, yml: dict):
        self.uri = yml.get('uri')
        assert isinstance(self.uri, str), "LDAP URI must be a string."

        self.user = yml.get('user_dn')
        assert isinstance(self.user, str) or self.user is None, "LDAP user DN must be a string or absent."

        self.base = yml.get('base_scope')
        assert isinstance(self.base, str), "LDAP Base scope must be a string"

        self.patterns: list = yml.get('membership_patterns', [])
        assert isinstance(self.patterns, list), "LDAP membership patterns must be a list of pattern strings"

        self.acl = yml.get('acl')
        assert isinstance(self.acl, dict), "LDAP ACL must be a dictionary (hash) of ACLs"

        assert ldap.initialize(self.uri)
        print("==== LDAP configuration looks kosher, enabling LDAP authentication as fallback ====")