def execute(self): for connection_id, connection in userdb.active_connections(): if connection.type() != "ldap": continue if connection.use_ssl(): yield ACResultOK(_("%s: Uses SSL") % connection_id) else: yield ACResultWARN( _("%s: Not using SSL. Consider enabling it in the " "connection settings.") % connection_id)
def execute(self) -> Iterator[ACResult]: for connection_id, connection in userdb.active_connections(): if connection.type() != "ldap": continue assert isinstance(connection, ldap.LDAPUserConnector) if connection.use_ssl(): yield ACResultOK(_("%s: Uses SSL") % connection_id) else: yield ACResultWARN( _("%s: Not using SSL. Consider enabling it in the " "connection settings.") % connection_id)
def is_relevant(self): return bool([ c for _cid, c in userdb.active_connections() if c.type() == "ldap" ])