[Zope-CVS] CVS: Products/PluggableAuthService - PluggableAuthService.py:1.11

Zachery Bir zbir at urbanape.com
Tue Sep 7 14:21:08 EDT 2004


Update of /cvs-repository/Products/PluggableAuthService
In directory cvs.zope.org:/tmp/cvs-serv23166

Modified Files:
	PluggableAuthService.py 
Log Message:
  - _extractUserIds *must* mangle the id that is returned via
    authentication with the id of the authenticating plugin, since a
    single credentials extractor can attempt authentication against
    any number of authenticating mechanisms.

  - Implement the registration for what will be our hook-point for the
    IChallengePlugin plugins.


=== Products/PluggableAuthService/PluggableAuthService.py 1.10 => 1.11 ===
--- Products/PluggableAuthService/PluggableAuthService.py:1.10	Tue Aug 31 13:50:56 2004
+++ Products/PluggableAuthService/PluggableAuthService.py	Tue Sep  7 14:21:08 2004
@@ -19,6 +19,8 @@
 
 import sys
 
+from ZPublisher import BeforeTraverse
+
 from Acquisition import Implicit, aq_parent, aq_base, aq_inner
 
 from AccessControl import ClassSecurityInfo, ModuleSecurityInfo
@@ -276,7 +278,7 @@
 
         if not is_top:
             return None
-                        
+
         #
         #   No other user folder above us can satisfy, and we have no user;
         #   return a constructed anonymous only if anonymous is authorized.
@@ -707,7 +709,8 @@
                             continue
 
                         if user_id is not None:
-                            mangled_id = self._verifyUser(plugins, user_id)
+                            mangled_id = self._mangleId(authenticator_id,
+                                                        user_id)
                             user_ids.append( (mangled_id, name) )
 
 
@@ -731,7 +734,7 @@
 
     security.declarePrivate( '_mangleId' )
     def _mangleId( self, namespace, id ):
-    
+
         return MANGLE_DELIMITER.join( ( namespace, id ) )
 
     security.declarePrivate( '_computeMangledId' )
@@ -1062,10 +1065,31 @@
             except:
                 pass
 
+            handle = self.meta_type + '/' + self.getId()
+            BeforeTraverse.unregisterBeforeTraverse(container, handle)
+
     security.declarePrivate( 'manage_afterAdd' )
     def manage_afterAdd(self, item, container):
         if item is self:
             container.__allow_groups__ = aq_base(self)
+
+            handle = self.meta_type + '/' + self.getId()
+            container = container.this()
+            nc = BeforeTraverse.NameCaller(self.getId())
+            BeforeTraverse.registerBeforeTraverse(container, nc, handle)
+
+    def __call__(self, container, req):
+        """ The __before_publishing_traverse__ hook. """
+        # resp = self.REQUEST['RESPONSE']
+
+        # plugins = self._getOb('plugins')
+
+        # challengers = plugins.listPlugins( IChallengePlugin )
+
+        # for challenger_id, challenger in challengers:
+        #     challenger.challenge(req, resp)
+
+        return
 
     security.declarePublic( 'hasUsers' )
     def hasUsers(self):



More information about the Zope-CVS mailing list