diff MoinMoin/_tests/ldap_testbase.py @ 4249:b8ea98d74d8d

Fixed LDAP auth: Use of MoinMoin.auth.handle_login instead of request.handle_auth / SLAPD without cleartext-support breaks tests
author Florian Krupicka <florian.krupicka@googlemail.com>
date Fri, 25 Jul 2008 22:48:12 +0200
parents 2d5a325ae247
children 07862b0663fd
line wrap: on
line diff
--- a/MoinMoin/_tests/ldap_testbase.py	Fri Jul 25 13:19:25 2008 +0200
+++ b/MoinMoin/_tests/ldap_testbase.py	Fri Jul 25 22:48:12 2008 +0200
@@ -39,7 +39,7 @@
 SLAPD_EXECUTABLE = 'slapd'  # filename of LDAP server executable - if it is not
                             # in your PATH, you have to give full path/filename.
 
-import os, shutil, tempfile, time
+import os, shutil, tempfile, time, base64, md5
 from StringIO import StringIO
 import signal
 
@@ -185,6 +185,8 @@
         f.write(db_config)
         f.close()
 
+        rootpw = '{MD5}' + base64.b64encode(md5.new(self.rootpw).digest())
+
         # create slapd.conf from content template in slapd_config
         slapd_config = slapd_config % {
             'ldap_dir': self.ldap_dir,
@@ -192,7 +194,7 @@
             'schema_dir': self.schema_dir,
             'basedn': self.basedn,
             'rootdn': self.rootdn,
-            'rootpw': self.rootpw,
+            'rootpw': rootpw,
         }
         if isinstance(slapd_config, unicode):
             slapd_config = slapd_config.encode(self.coding)