1
0
Fork 0
mirror of https://github.com/kakwa/ldapcherry synced 2025-07-04 04:17:43 +02:00

multiple changes

* implemeting recover user attributes
* adding a unit test for unavailable ldap
* adding a parameter timeout to set the ldap timeout connexion
This commit is contained in:
kakwa 2015-05-22 20:05:24 +02:00
parent 6460c33b28
commit 63062be433
4 changed files with 26 additions and 7 deletions

View file

@ -77,6 +77,7 @@ ldap.starttls = 'on'
ldap.checkcert = 'off'
ldap.user_filter_tmpl = '(uid=%(username)s)'
ldap.group_filter_tmpl = '(member=%(userdn)s)'
ldap.timeout = 1
ad.module = 'ldapcherry.backend.backendSamba4'
ad.auth = 'Administrator'

View file

@ -28,7 +28,7 @@ cfg = {
}
cherrypy.log.error = syslog_error
attr = ['shell', 'cn', 'uid', 'uidNumber', 'gidNumber', 'home', 'userPassword', 'givenName', 'email', 'sn']
attr = ['shéll', 'shell', 'cn', 'uid', 'uidNumber', 'gidNumber', 'home', 'userPassword', 'givenName', 'email', 'sn']
class TestError(object):
@ -110,4 +110,6 @@ class TestError(object):
def testGetUser(self):
inv = Backend(cfg, cherrypy.log, 'ldap', attr)
return True
ret = inv.get_user('jwatson')
expected = ('cn=John Watson,ou=People,dc=example,dc=org', {'uid': ['jwatson'], 'cn': ['John Watson'], 'sn': ['watson']})
assert ret == expected