[CalendarServer-changes] [12526] twext/trunk/twext/who

source_changes at macosforge.org source_changes at macosforge.org
Wed Mar 12 11:18:41 PDT 2014


Revision: 12526
          http://trac.calendarserver.org//changeset/12526
Author:   wsanchez at apple.com
Date:     2014-01-31 16:34:02 -0800 (Fri, 31 Jan 2014)
Log Message:
-----------
verify* now defers

Modified Paths:
--------------
    twext/trunk/twext/who/checker.py
    twext/trunk/twext/who/directory.py
    twext/trunk/twext/who/idirectory.py
    twext/trunk/twext/who/opendirectory/_service.py

Modified: twext/trunk/twext/who/checker.py
===================================================================
--- twext/trunk/twext/who/checker.py	2014-02-01 00:33:43 UTC (rev 12525)
+++ twext/trunk/twext/who/checker.py	2014-02-01 00:34:02 UTC (rev 12526)
@@ -76,7 +76,8 @@
                 "Not an IPlaintextPasswordVerifier: {0!r}".format(record)
             )
 
-        if record.verifyPlaintextPassword(credentials.password):
+        auth = yield record.verifyPlaintextPassword(credentials.password)
+        if auth:
             returnValue(record)
 
         raise UnauthorizedLogin("Incorrect password")

Modified: twext/trunk/twext/who/directory.py
===================================================================
--- twext/trunk/twext/who/directory.py	2014-02-01 00:33:43 UTC (rev 12525)
+++ twext/trunk/twext/who/directory.py	2014-02-01 00:34:02 UTC (rev 12526)
@@ -482,9 +482,9 @@
 
     def verifyPlaintextPassword(self, password):
         if self.password == password:
-            return True
+            return succeed(True)
         else:
-            return False
+            return succeed(False)
 
 
     def verifyHTTPDigest(
@@ -505,4 +505,4 @@
             )
         )
 
-        return helperCreds.checkPassword(self.password)
+        return succeed(helperCreds.checkPassword(self.password))

Modified: twext/trunk/twext/who/idirectory.py
===================================================================
--- twext/trunk/twext/who/idirectory.py	2014-02-01 00:33:43 UTC (rev 12525)
+++ twext/trunk/twext/who/idirectory.py	2014-02-01 00:34:02 UTC (rev 12526)
@@ -465,7 +465,7 @@
         @type password: L{unicode}
 
         @return: L{True} if the password matches, L{False} otherwise.
-        @rtype: L{BOOL}
+        @rtype: deferred L{BOOL}
         """
 
 
@@ -483,5 +483,5 @@
         @type password: L{unicode}
 
         @return: L{True} if the password matches, L{False} otherwise.
-        @rtype: L{BOOL}
+        @rtype: deferred L{BOOL}
         """

Modified: twext/trunk/twext/who/opendirectory/_service.py
===================================================================
--- twext/trunk/twext/who/opendirectory/_service.py	2014-02-01 00:33:43 UTC (rev 12525)
+++ twext/trunk/twext/who/opendirectory/_service.py	2014-02-01 00:34:02 UTC (rev 12526)
@@ -610,9 +610,9 @@
         result, error = self._odRecord.verifyPassword_error_(password, None)
 
         if error:
-            return False
+            return succeed(False)
 
-        return result
+        return succeed(result)
 
 
     def verifyHTTPDigest(
@@ -647,9 +647,9 @@
         print(result, m1, m2, error)
 
         if error:
-            return False
+            return succeed(False)
 
-        return result
+        return succeed(result)
 
 
 
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.macosforge.org/pipermail/calendarserver-changes/attachments/20140312/c3e6fbf6/attachment.html>


More information about the calendarserver-changes mailing list