Example #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
Example #2
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
Example #3
0
 def _makeOne(self, base_dn, filter_tmpl, scope, attributes, cache_period):
     from pyramid_ldap3 import _LDAPQuery
     return _LDAPQuery(
         base_dn, filter_tmpl, scope, attributes, cache_period)
Example #4
0
 def _make_one(self, base_dn, filter_tmpl, scope, attributes, cache_period):
     from pyramid_ldap3 import _LDAPQuery
     return _LDAPQuery(
         base_dn, filter_tmpl, scope, attributes, cache_period)