[Checkins] SVN: Products.PluggableAuthService/branches/maurits-login-transform/Products/PluggableAuthService/ Let PAS.updateAllLoginNames call plugin.updateEveryLoginName.
Maurits van Rees
cvs-admin at zope.org
Sat Jan 19 00:33:28 UTC 2013
Log message for revision 129056:
Let PAS.updateAllLoginNames call plugin.updateEveryLoginName.
Due to acquisition these methods should be called differently,
otherwise you could get into a recursion when a plugin does not have the method,
even though it should have according to the plugin interface.
Changed:
U Products.PluggableAuthService/branches/maurits-login-transform/Products/PluggableAuthService/PluggableAuthService.py
U Products.PluggableAuthService/branches/maurits-login-transform/Products/PluggableAuthService/interfaces/plugins.py
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
U Products.PluggableAuthService/branches/maurits-login-transform/Products/PluggableAuthService/tests/test_PluggableAuthService.py
-=-
Modified: Products.PluggableAuthService/branches/maurits-login-transform/Products/PluggableAuthService/PluggableAuthService.py
===================================================================
--- Products.PluggableAuthService/branches/maurits-login-transform/Products/PluggableAuthService/PluggableAuthService.py 2013-01-19 00:21:16 UTC (rev 129055)
+++ Products.PluggableAuthService/branches/maurits-login-transform/Products/PluggableAuthService/PluggableAuthService.py 2013-01-19 00:33:27 UTC (rev 129056)
@@ -1345,7 +1345,7 @@
updaters = plugins.listPlugins(IUserEnumerationPlugin)
for updater_id, updater in updaters:
# Note: do not swallow any exceptions here.
- updater.updateAllLoginNames(
+ updater.updateEveryLoginName(
quit_on_first_error=quit_on_first_error)
Modified: Products.PluggableAuthService/branches/maurits-login-transform/Products/PluggableAuthService/interfaces/plugins.py
===================================================================
--- Products.PluggableAuthService/branches/maurits-login-transform/Products/PluggableAuthService/interfaces/plugins.py 2013-01-19 00:21:16 UTC (rev 129055)
+++ Products.PluggableAuthService/branches/maurits-login-transform/Products/PluggableAuthService/interfaces/plugins.py 2013-01-19 00:33:27 UTC (rev 129056)
@@ -348,7 +348,7 @@
""" Update the login name of the user with id user_id.
"""
- def updateAllLoginNames(quit_on_first_error=True):
+ def updateEveryLoginName(quit_on_first_error=True):
"""Update login names of all users to their canonical value.
This should be done after changing the login_transform
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 00:21:16 UTC (rev 129055)
+++ Products.PluggableAuthService/branches/maurits-login-transform/Products/PluggableAuthService/plugins/ZODBUserManager.py 2013-01-19 00:33:27 UTC (rev 129056)
@@ -330,8 +330,8 @@
self._login_to_userid[login_name] = user_id
self._userid_to_login[user_id] = login_name
- security.declarePrivate('updateAllLoginNames')
- def updateAllLoginNames(self, quit_on_first_error=True):
+ security.declarePrivate('updateEveryLoginName')
+ def updateEveryLoginName(self, quit_on_first_error=True):
# Update all login names to their canonical value. This
# should be done after changing the login_transform property
# of pas. You can set quit_on_first_error to False to report
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 00:21:16 UTC (rev 129055)
+++ Products.PluggableAuthService/branches/maurits-login-transform/Products/PluggableAuthService/plugins/tests/test_ZODBUserManager.py 2013-01-19 00:33:27 UTC (rev 129056)
@@ -517,7 +517,7 @@
self.assertEqual(user_id, 'user1')
self.assertEqual(login, 'user1 at foobar.com')
- def test_updateAllLoginNames(self):
+ def test_updateEveryLoginName(self):
zum = self._makeOne()
zum._getPAS = lambda: FakePAS()
@@ -536,7 +536,7 @@
# Give all users a new login, using the applyTransform method
# of PAS. There should be no changes.
- zum.updateAllLoginNames()
+ zum.updateEveryLoginName()
self.failUnless(zum.authenticateCredentials(info1))
self.failUnless(zum.authenticateCredentials(info2))
@@ -544,7 +544,7 @@
zum._getPAS = lambda: FakeLowerCasePAS()
# Update all login names
- zum.updateAllLoginNames()
+ zum.updateEveryLoginName()
# The old mixed case logins no longer work. Note that if you
# query PAS (via the validate or _extractUserIds method), PAS
Modified: Products.PluggableAuthService/branches/maurits-login-transform/Products/PluggableAuthService/tests/test_PluggableAuthService.py
===================================================================
--- Products.PluggableAuthService/branches/maurits-login-transform/Products/PluggableAuthService/tests/test_PluggableAuthService.py 2013-01-19 00:21:16 UTC (rev 129055)
+++ Products.PluggableAuthService/branches/maurits-login-transform/Products/PluggableAuthService/tests/test_PluggableAuthService.py 2013-01-19 00:33:27 UTC (rev 129056)
@@ -119,7 +119,7 @@
info['login'] = login_name
return
- def updateAllLoginNames(self, quit_on_first_error=True):
+ def updateEveryLoginName(self, quit_on_first_error=True):
# Let's lowercase all login names.
for info in self.users:
info['login'] = info['login'].lower()
More information about the checkins
mailing list