示例#1
0
 def setup_ldap(self, registry: Registry, app_config: CFG):
     manager = ConnectionManager(
         uri=app_config.LDAP_URL,
         bind=app_config.LDAP_BIND_DN,
         passwd=app_config.LDAP_BIND_PASS,
         tls=app_config.LDAP_TLS,
         use_pool=app_config.LDAP_USE_POOL,
         pool_size=app_config.LDAP_POOL_SIZE,
         pool_lifetime=app_config.LDAP_POOL_LIFETIME,
         get_info=app_config.LDAP_GET_INFO)
     registry.ldap_login_query = _LDAPQuery(
         base_dn=app_config.LDAP_USER_BASE_DN,
         filter_tmpl=app_config.LDAP_USER_FILTER,
         scope=ldap3.LEVEL,
         attributes=ldap3.ALL_ATTRIBUTES,
         cache_period=0)
     registry.ldap_connector = Connector(registry, manager)
     return registry
示例#2
0
 def _makeOne(self, registry, manager):
     from pyramid_ldap3 import Connector
     return Connector(registry, manager)
示例#3
0
 def _make_one(self, registry, manager, realm=None):
     from pyramid_ldap3 import Connector
     return Connector(registry, manager, realm)