[Zodb-checkins] CVS: ZODB3/ZEO/auth - base.py:1.5 auth_digest.py:1.4 __init__.py:1.3

Jeremy Hylton jeremy at zope.com
Thu Oct 2 14:17:53 EDT 2003


Update of /cvs-repository/ZODB3/ZEO/auth
In directory cvs.zope.org:/tmp/cvs-serv18770/ZEO/auth

Modified Files:
	base.py auth_digest.py __init__.py 
Log Message:
Merge changes from Zope-2_7-branch to the trunk.


=== ZODB3/ZEO/auth/base.py 1.4 => 1.5 ===
--- ZODB3/ZEO/auth/base.py:1.4	Mon Jul 28 01:04:44 2003
+++ ZODB3/ZEO/auth/base.py	Thu Oct  2 14:17:21 2003
@@ -34,19 +34,19 @@
     """Sort a list in-place and return it."""
     L.sort()
     return L
-    
+
 class Database:
     """Abstracts a password database.
 
     This class is used both in the authentication process (via
     get_password()) and by client scripts that manage the password
-    database file. 
+    database file.
 
     The password file is a simple, colon-separated text file mapping
     usernames to password hashes. The hashes are SHA hex digests
     produced from the password string.
     """
-    
+
     def __init__(self, filename, realm=None):
         """Creates a new Database
 
@@ -61,7 +61,7 @@
         self.filename = filename
         self.realm = realm
         self.load()
-        
+
     def save(self, fd=None):
         filename = self.filename
 
@@ -72,7 +72,7 @@
 
         for username in sort(self._users.keys()):
             print >> fd, "%s: %s" % (username, self._users[username])
-            
+
     def load(self):
         filename = self.filename
         if not filename:
@@ -80,7 +80,7 @@
 
         if not os.path.exists(filename):
             return
-        
+
         fd = open(filename)
         L = fd.readlines()
 
@@ -90,7 +90,7 @@
         if L[0].startswith("realm "):
             line = L.pop(0).strip()
             self.realm = line[len("realm "):]
-            
+
         for line in L:
             username, hash = line.strip().split(":", 1)
             self._users[username] = hash.strip()
@@ -103,10 +103,10 @@
 
         Callers must check for LookupError, which is raised in
         the case of a non-existent user specified."""
-	if not self._users.has_key(username):
+        if not self._users.has_key(username):
             raise LookupError, "No such user: %s" % username
         return self._users[username]
-    
+
     def hash(self, s):
         return sha.new(s).hexdigest()
 
@@ -116,7 +116,7 @@
         self._store_password(username, password)
 
     def del_user(self, username):
-	if not self._users.has_key(username):
+        if not self._users.has_key(username):
             raise LookupError, "No such user: %s" % username
         del self._users[username]
 


=== ZODB3/ZEO/auth/auth_digest.py 1.3 => 1.4 ===
--- ZODB3/ZEO/auth/auth_digest.py:1.3	Fri May 30 15:26:42 2003
+++ ZODB3/ZEO/auth/auth_digest.py	Thu Oct  2 14:17:21 2003
@@ -61,7 +61,7 @@
 class DigestDatabase(Database):
     def __init__(self, filename, realm=None):
         Database.__init__(self, filename, realm)
-        
+
         # Initialize a key used to build the nonce for a challenge.
         # We need one key for the lifetime of the server, so it
         # is convenient to store in on the database.
@@ -134,7 +134,7 @@
             raise AuthError("expected realm %r, got realm %r"
                             % (_realm, realm))
         h_up = hexdigest("%s:%s:%s" % (username, realm, password))
-        
+
         resp_dig = hexdigest("%s:%s" % (h_up, challenge))
         result = self.stub.auth_response((username, challenge, resp_dig))
         if result:


=== ZODB3/ZEO/auth/__init__.py 1.2 => 1.3 ===
--- ZODB3/ZEO/auth/__init__.py:1.2	Fri May 30 15:20:57 2003
+++ ZODB3/ZEO/auth/__init__.py	Thu Oct  2 14:17:21 2003
@@ -28,4 +28,3 @@
     if _auth_modules.has_key(name):
         raise TypeError, "%s is already registred" % name
     _auth_modules[name] = storage_class, client, db
-




More information about the Zodb-checkins mailing list