[Checkins] SVN: Products.PluggableAuthService/trunk/Products/PluggableAuthService/ Fixed deprecation warnings for use of Globals and avoid deprecation warnings for the md5 and sha modules.
Hanno Schlichting
plone at hannosch.info
Wed Jan 14 12:28:52 EST 2009
Log message for revision 94736:
Fixed deprecation warnings for use of Globals and avoid deprecation warnings for the md5 and sha modules.
Changed:
U Products.PluggableAuthService/trunk/Products/PluggableAuthService/doc/CHANGES.txt
U Products.PluggableAuthService/trunk/Products/PluggableAuthService/permissions.py
U Products.PluggableAuthService/trunk/Products/PluggableAuthService/plugins/ChallengeProtocolChooser.py
U Products.PluggableAuthService/trunk/Products/PluggableAuthService/plugins/DelegatingMultiPlugin.py
U Products.PluggableAuthService/trunk/Products/PluggableAuthService/plugins/DomainAuthHelper.py
U Products.PluggableAuthService/trunk/Products/PluggableAuthService/plugins/DynamicGroupsPlugin.py
U Products.PluggableAuthService/trunk/Products/PluggableAuthService/plugins/LocalRolePlugin.py
U Products.PluggableAuthService/trunk/Products/PluggableAuthService/plugins/RecursiveGroupsPlugin.py
U Products.PluggableAuthService/trunk/Products/PluggableAuthService/plugins/RequestTypeSniffer.py
U Products.PluggableAuthService/trunk/Products/PluggableAuthService/plugins/SearchPrincipalsPlugin.py
U Products.PluggableAuthService/trunk/Products/PluggableAuthService/plugins/ZODBGroupManager.py
U Products.PluggableAuthService/trunk/Products/PluggableAuthService/plugins/ZODBRoleManager.py
U Products.PluggableAuthService/trunk/Products/PluggableAuthService/plugins/ZODBUserManager.py
U Products.PluggableAuthService/trunk/Products/PluggableAuthService/plugins/tests/test_ZODBUserManager.py
U Products.PluggableAuthService/trunk/Products/PluggableAuthService/tests/test_utils.py
U Products.PluggableAuthService/trunk/Products/PluggableAuthService/utils.py
-=-
Modified: Products.PluggableAuthService/trunk/Products/PluggableAuthService/doc/CHANGES.txt
===================================================================
--- Products.PluggableAuthService/trunk/Products/PluggableAuthService/doc/CHANGES.txt 2009-01-14 17:27:20 UTC (rev 94735)
+++ Products.PluggableAuthService/trunk/Products/PluggableAuthService/doc/CHANGES.txt 2009-01-14 17:28:52 UTC (rev 94736)
@@ -4,6 +4,9 @@
PluggableAuthService 1.7 (unreleased)
-------------------------------------
+- Fixed deprecation warnings for use of Globals and avoid deprecation
+ warnings for the md5 and sha modules.
+
- Launchpad #273680: Avoid expensive / incorrect dive into 'enumerateUsers'
when trying to validate w/o either a real ID or login.
Modified: Products.PluggableAuthService/trunk/Products/PluggableAuthService/permissions.py
===================================================================
--- Products.PluggableAuthService/trunk/Products/PluggableAuthService/permissions.py 2009-01-14 17:27:20 UTC (rev 94735)
+++ Products.PluggableAuthService/trunk/Products/PluggableAuthService/permissions.py 2009-01-14 17:28:52 UTC (rev 94736)
@@ -20,7 +20,7 @@
from AccessControl import Permissions
from AccessControl.Permission import _registeredPermissions
from AccessControl.Permission import pname
-from Globals import ApplicationDefaultPermissions
+from AccessControl.Permission import ApplicationDefaultPermissions
import Products
security = ModuleSecurityInfo( 'Products.PluggableAuthService.permissions' )
Modified: Products.PluggableAuthService/trunk/Products/PluggableAuthService/plugins/ChallengeProtocolChooser.py
===================================================================
--- Products.PluggableAuthService/trunk/Products/PluggableAuthService/plugins/ChallengeProtocolChooser.py 2009-01-14 17:27:20 UTC (rev 94735)
+++ Products.PluggableAuthService/trunk/Products/PluggableAuthService/plugins/ChallengeProtocolChooser.py 2009-01-14 17:28:52 UTC (rev 94736)
@@ -20,7 +20,7 @@
from Acquisition import aq_parent
from AccessControl import ClassSecurityInfo
from BTrees.OOBTree import OOBTree
-from Globals import InitializeClass
+from App.class_init import InitializeClass
from zope.interface import Interface
Modified: Products.PluggableAuthService/trunk/Products/PluggableAuthService/plugins/DelegatingMultiPlugin.py
===================================================================
--- Products.PluggableAuthService/trunk/Products/PluggableAuthService/plugins/DelegatingMultiPlugin.py 2009-01-14 17:27:20 UTC (rev 94735)
+++ Products.PluggableAuthService/trunk/Products/PluggableAuthService/plugins/DelegatingMultiPlugin.py 2009-01-14 17:28:52 UTC (rev 94736)
@@ -26,7 +26,7 @@
# Zope imports
from Acquisition import aq_base
from OFS.Folder import Folder
-from Globals import InitializeClass
+from App.class_init import InitializeClass
from AccessControl import ClassSecurityInfo
from AccessControl.SpecialUsers import emergency_user
Modified: Products.PluggableAuthService/trunk/Products/PluggableAuthService/plugins/DomainAuthHelper.py
===================================================================
--- Products.PluggableAuthService/trunk/Products/PluggableAuthService/plugins/DomainAuthHelper.py 2009-01-14 17:27:20 UTC (rev 94735)
+++ Products.PluggableAuthService/trunk/Products/PluggableAuthService/plugins/DomainAuthHelper.py 2009-01-14 17:28:52 UTC (rev 94736)
@@ -32,7 +32,7 @@
# General Zope imports
from BTrees.OOBTree import OOBTree
-from Globals import InitializeClass
+from App.class_init import InitializeClass
from AccessControl import ClassSecurityInfo
from AccessControl.Permissions import manage_users
Modified: Products.PluggableAuthService/trunk/Products/PluggableAuthService/plugins/DynamicGroupsPlugin.py
===================================================================
--- Products.PluggableAuthService/trunk/Products/PluggableAuthService/plugins/DynamicGroupsPlugin.py 2009-01-14 17:27:20 UTC (rev 94735)
+++ Products.PluggableAuthService/trunk/Products/PluggableAuthService/plugins/DynamicGroupsPlugin.py 2009-01-14 17:28:52 UTC (rev 94736)
@@ -24,7 +24,7 @@
from OFS.PropertyManager import PropertyManager
from OFS.Folder import Folder
from OFS.Cache import Cacheable
-from Globals import InitializeClass
+from App.class_init import InitializeClass
from Persistence import PersistentMapping
from zope.interface import Interface
Modified: Products.PluggableAuthService/trunk/Products/PluggableAuthService/plugins/LocalRolePlugin.py
===================================================================
--- Products.PluggableAuthService/trunk/Products/PluggableAuthService/plugins/LocalRolePlugin.py 2009-01-14 17:27:20 UTC (rev 94735)
+++ Products.PluggableAuthService/trunk/Products/PluggableAuthService/plugins/LocalRolePlugin.py 2009-01-14 17:28:52 UTC (rev 94736)
@@ -17,7 +17,7 @@
$Id$
"""
from AccessControl import ClassSecurityInfo
-from Globals import InitializeClass
+from App.class_init import InitializeClass
from zope.interface import Interface
Modified: Products.PluggableAuthService/trunk/Products/PluggableAuthService/plugins/RecursiveGroupsPlugin.py
===================================================================
--- Products.PluggableAuthService/trunk/Products/PluggableAuthService/plugins/RecursiveGroupsPlugin.py 2009-01-14 17:27:20 UTC (rev 94735)
+++ Products.PluggableAuthService/trunk/Products/PluggableAuthService/plugins/RecursiveGroupsPlugin.py 2009-01-14 17:28:52 UTC (rev 94736)
@@ -18,7 +18,7 @@
"""
from Acquisition import aq_parent
from AccessControl import ClassSecurityInfo
-from Globals import InitializeClass
+from App.class_init import InitializeClass
from BTrees.OOBTree import OOBTree
from zope.interface import Interface
Modified: Products.PluggableAuthService/trunk/Products/PluggableAuthService/plugins/RequestTypeSniffer.py
===================================================================
--- Products.PluggableAuthService/trunk/Products/PluggableAuthService/plugins/RequestTypeSniffer.py 2009-01-14 17:27:20 UTC (rev 94735)
+++ Products.PluggableAuthService/trunk/Products/PluggableAuthService/plugins/RequestTypeSniffer.py 2009-01-14 17:28:52 UTC (rev 94736)
@@ -19,7 +19,7 @@
from Acquisition import aq_parent
from AccessControl import ClassSecurityInfo
-from Globals import InitializeClass
+from App.class_init import InitializeClass
from ZServer.FTPRequest import FTPRequest
from ZPublisher import xmlrpc
Modified: Products.PluggableAuthService/trunk/Products/PluggableAuthService/plugins/SearchPrincipalsPlugin.py
===================================================================
--- Products.PluggableAuthService/trunk/Products/PluggableAuthService/plugins/SearchPrincipalsPlugin.py 2009-01-14 17:27:20 UTC (rev 94735)
+++ Products.PluggableAuthService/trunk/Products/PluggableAuthService/plugins/SearchPrincipalsPlugin.py 2009-01-14 17:28:52 UTC (rev 94736)
@@ -24,7 +24,7 @@
# Zope imports
from Acquisition import aq_base
from OFS.Folder import Folder
-from Globals import InitializeClass
+from App.class_init import InitializeClass
from AccessControl import ClassSecurityInfo
from AccessControl.SpecialUsers import emergency_user
Modified: Products.PluggableAuthService/trunk/Products/PluggableAuthService/plugins/ZODBGroupManager.py
===================================================================
--- Products.PluggableAuthService/trunk/Products/PluggableAuthService/plugins/ZODBGroupManager.py 2009-01-14 17:27:20 UTC (rev 94735)
+++ Products.PluggableAuthService/trunk/Products/PluggableAuthService/plugins/ZODBGroupManager.py 2009-01-14 17:28:52 UTC (rev 94736)
@@ -18,7 +18,7 @@
"""
from Acquisition import aq_parent
from AccessControl import ClassSecurityInfo
-from Globals import InitializeClass
+from App.class_init import InitializeClass
from BTrees.OOBTree import OOBTree
from zope.interface import Interface
Modified: Products.PluggableAuthService/trunk/Products/PluggableAuthService/plugins/ZODBRoleManager.py
===================================================================
--- Products.PluggableAuthService/trunk/Products/PluggableAuthService/plugins/ZODBRoleManager.py 2009-01-14 17:27:20 UTC (rev 94735)
+++ Products.PluggableAuthService/trunk/Products/PluggableAuthService/plugins/ZODBRoleManager.py 2009-01-14 17:28:52 UTC (rev 94736)
@@ -19,7 +19,7 @@
from Acquisition import aq_parent, aq_inner
from AccessControl import ClassSecurityInfo
from BTrees.OOBTree import OOBTree
-from Globals import InitializeClass
+from App.class_init import InitializeClass
from zope.interface import Interface
Modified: Products.PluggableAuthService/trunk/Products/PluggableAuthService/plugins/ZODBUserManager.py
===================================================================
--- Products.PluggableAuthService/trunk/Products/PluggableAuthService/plugins/ZODBUserManager.py 2009-01-14 17:27:20 UTC (rev 94735)
+++ Products.PluggableAuthService/trunk/Products/PluggableAuthService/plugins/ZODBUserManager.py 2009-01-14 17:28:52 UTC (rev 94736)
@@ -16,8 +16,11 @@
$Id$
"""
-import sha
import copy
+try:
+ from hashlib import sha1 as sha
+except:
+ from sha import sha
from AccessControl import ClassSecurityInfo, AuthEncoding
from AccessControl.SecurityManagement import getSecurityManager
@@ -111,7 +114,7 @@
return userid, login
# Support previous naive behavior
- digested = sha.sha( password ).hexdigest()
+ digested = sha( password ).hexdigest()
if reference == digested:
return userid, login
Modified: Products.PluggableAuthService/trunk/Products/PluggableAuthService/plugins/tests/test_ZODBUserManager.py
===================================================================
--- Products.PluggableAuthService/trunk/Products/PluggableAuthService/plugins/tests/test_ZODBUserManager.py 2009-01-14 17:27:20 UTC (rev 94735)
+++ Products.PluggableAuthService/trunk/Products/PluggableAuthService/plugins/tests/test_ZODBUserManager.py 2009-01-14 17:28:52 UTC (rev 94736)
@@ -368,13 +368,16 @@
def test_authenticateWithOldPasswords( self ):
- import sha
+ try:
+ from hashlib import sha1 as sha
+ except:
+ from sha import sha
zum = self._makeOne()
# synthesize an older account
- old_password = sha.sha( 'old_password' ).hexdigest()
+ old_password = sha( 'old_password' ).hexdigest()
zum._user_passwords[ 'old_user' ] = old_password
zum._login_to_userid[ 'old_user at example.com' ] = 'old_user'
zum._userid_to_login[ 'old_user' ] = 'old_user at example.com'
Modified: Products.PluggableAuthService/trunk/Products/PluggableAuthService/tests/test_utils.py
===================================================================
--- Products.PluggableAuthService/trunk/Products/PluggableAuthService/tests/test_utils.py 2009-01-14 17:27:20 UTC (rev 94735)
+++ Products.PluggableAuthService/trunk/Products/PluggableAuthService/tests/test_utils.py 2009-01-14 17:28:52 UTC (rev 94736)
@@ -89,8 +89,12 @@
{'keywords': hashed})
def _createHashedValue(items):
- import sha
- hasher = sha.new()
+ try:
+ from hashlib import sha1 as sha
+ except:
+ from sha import new as sha
+
+ hasher = sha()
items = list(items)
items.sort()
for k, v in items:
Modified: Products.PluggableAuthService/trunk/Products/PluggableAuthService/utils.py
===================================================================
--- Products.PluggableAuthService/trunk/Products/PluggableAuthService/utils.py 2009-01-14 17:27:20 UTC (rev 94735)
+++ Products.PluggableAuthService/trunk/Products/PluggableAuthService/utils.py 2009-01-14 17:28:52 UTC (rev 94736)
@@ -13,11 +13,15 @@
#
##############################################################################
import os
-import sha
import unittest
+try:
+ from hashlib import sha1 as sha
+except:
+ from sha import new as sha
-from Globals import package_home
+from App.Common import package_home
+
try:
from Products.Five.bridge import fromZ2Interface
except ImportError:
@@ -200,7 +204,7 @@
Keywords are hashed so we don't accidentally expose sensitive
information.
"""
- keywords = sha.new()
+ keywords = sha()
items = kw.items()
items.sort()
More information about the Checkins
mailing list