[Zope-Checkins] CVS: Zope3/lib/python/Zope/Server/Authentication - DictionaryAuthentication.py:1.1.2.4 IAuthentication.py:1.1.2.5

Stephan Richter srichter@cbu.edu
Mon, 8 Apr 2002 02:50:58 -0400


Update of /cvs-repository/Zope3/lib/python/Zope/Server/Authentication
In directory cvs.zope.org:/tmp/cvs-serv31265/Authentication

Modified Files:
      Tag: Zope3-Server-Branch
	DictionaryAuthentication.py IAuthentication.py 
Log Message:
This is the first working version of the SMTP server. There is still a lot
of work to be done, but it is a start. Now I need to stabalize the code and
write some tests. 

Also, Gerson Kunze (author of Shicks!), whose code I used as a template,
told me that he would be working on implementing ESMTP and a better SPAM 
filter, whcih should make the server even cooler.

I guess we should start discussing how a possible MailService could look
like. 


=== Zope3/lib/python/Zope/Server/Authentication/DictionaryAuthentication.py 1.1.2.3 => 1.1.2.4 ===
     ############################################################
     # Implementation methods for interface
-    # Zope.Server.Authentication.IAuthentication.
+    # Zope.Server.Authentication.IAuthentication.IAuthentication
 
     def authenticate(self, username, password):
         'See Zope.Server.Authentication.IAuthentication.IAuthentication'
@@ -42,6 +42,14 @@
         else:
             return 0, 'Password invalid.'
 
+    def hasUser(self, username):
+        'See Zope.Server.Authentication.IAuthentication.IAuthentication'
+        return self.user_dict.has_key(username)
+
+    def getPassword(self, username):
+        'See Zope.Server.Authentication.IAuthentication.IAuthentication'
+        return self.user_dict[username]
+    
     #
     ############################################################
 


=== Zope3/lib/python/Zope/Server/Authentication/IAuthentication.py 1.1.2.4 => 1.1.2.5 ===
 
     def authenticate(username, password):
+        """Authenticate a user using the passed username and password pair.
         """
+        return Boolean, str("Message")
+
+
+    def hasUser(username):
+        """Check whether a user is defined.
         """
+        return Boolean
 
-        return Boolean, str("Message")
+
+    def getPassword(username):
+        """Get the password for this username, sinc esome applicaitons want to
+           do some extraordinary encoding and other things themselves.
+        """