[Checkins] SVN: Products.PluggableAuthService/branches/maurits-login-transform/Products/PluggableAuthService/plugins/ plugin.updateUser no longer needs to call self.applyTransform.

Maurits van Rees cvs-admin at zope.org
Sat Jan 19 21:59:58 UTC 2013


Log message for revision 129059:
  plugin.updateUser no longer needs to call self.applyTransform.
  
  PAS is responsible for transforming the login.

Changed:
  U   Products.PluggableAuthService/branches/maurits-login-transform/Products/PluggableAuthService/plugins/ZODBUserManager.py
  U   Products.PluggableAuthService/branches/maurits-login-transform/Products/PluggableAuthService/plugins/tests/test_ZODBUserManager.py

-=-
Modified: Products.PluggableAuthService/branches/maurits-login-transform/Products/PluggableAuthService/plugins/ZODBUserManager.py
===================================================================
--- Products.PluggableAuthService/branches/maurits-login-transform/Products/PluggableAuthService/plugins/ZODBUserManager.py	2013-01-19 21:31:44 UTC (rev 129058)
+++ Products.PluggableAuthService/branches/maurits-login-transform/Products/PluggableAuthService/plugins/ZODBUserManager.py	2013-01-19 21:59:57 UTC (rev 129059)
@@ -317,10 +317,6 @@
         # The following raises a KeyError if the user_id is invalid
         old_login = self.getLoginForUserId(user_id)
 
-        # updateUser is not called from PAS, so we need to apply the
-        # login_transform (if set) ourselves.
-        login_name = self.applyTransform(login_name)
-
         if old_login != login_name:
 
             if self._login_to_userid.get(login_name) is not None:

Modified: Products.PluggableAuthService/branches/maurits-login-transform/Products/PluggableAuthService/plugins/tests/test_ZODBUserManager.py
===================================================================
--- Products.PluggableAuthService/branches/maurits-login-transform/Products/PluggableAuthService/plugins/tests/test_ZODBUserManager.py	2013-01-19 21:31:44 UTC (rev 129058)
+++ Products.PluggableAuthService/branches/maurits-login-transform/Products/PluggableAuthService/plugins/tests/test_ZODBUserManager.py	2013-01-19 21:59:57 UTC (rev 129059)
@@ -493,30 +493,6 @@
         self.assertRaises(ValueError,
                           zum.updateUser, 'user1', 'user2 at example.com')
 
-    def test_updateUser_transform(self):
-
-        zum = self._makeOne()
-        zum._getPAS = lambda: FakeLowerCasePAS()
-
-        # Create a user and make sure we can authenticate with it
-        zum.addUser( 'user1', 'user1 at example.com', 'password' )
-        info1 = { 'login' : 'user1 at example.com', 'password' : 'password' }
-        user_id, login = zum.authenticateCredentials(info1)
-        self.assertEqual(user_id, 'user1')
-        self.assertEqual(login, 'user1 at example.com')
-
-        # Give the user a new login; attempts to authenticate with the
-        # old login must fail.  This is currently the only spot where
-        # the plugin itself needs to apply the login name transform
-        zum.updateUser('user1', 'USER1 at Foobar.Com')
-        self.failIf(zum.authenticateCredentials(info1))
-
-        # Try to authenticate with the new login, this must succeed.
-        info2 = { 'login' : 'user1 at foobar.com', 'password' : 'password' }
-        user_id, login = zum.authenticateCredentials(info2)
-        self.assertEqual(user_id, 'user1')
-        self.assertEqual(login, 'user1 at foobar.com')
-
     def test_updateEveryLoginName(self):
 
         zum = self._makeOne()



More information about the checkins mailing list