[Zope3-checkins] SVN: Zope3/trunk/src/zope/app/pas/ extractionplugins.py renamed to browserplugins.py

Helmut Merz helmutm at cyberconcepts.de
Sun Oct 10 09:20:00 EDT 2004


Log message for revision 27900:
  extractionplugins.py renamed to browserplugins.py


Changed:
  A   Zope3/trunk/src/zope/app/pas/browserplugins.py
  D   Zope3/trunk/src/zope/app/pas/extractionplugins.py
  U   Zope3/trunk/src/zope/app/pas/tests.py


-=-
Copied: Zope3/trunk/src/zope/app/pas/browserplugins.py (from rev 27890, Zope3/trunk/src/zope/app/pas/extractionplugins.py)
===================================================================
--- Zope3/trunk/src/zope/app/pas/extractionplugins.py	2004-10-10 12:26:07 UTC (rev 27890)
+++ Zope3/trunk/src/zope/app/pas/browserplugins.py	2004-10-10 13:20:00 UTC (rev 27900)
@@ -0,0 +1,49 @@
+##############################################################################
+#
+# Copyright (c) 2004 Zope Corporation and Contributors.
+# All Rights Reserved.
+#
+# This software is subject to the provisions of the Zope Public License,
+# Version 2.1 (ZPL).  A copy of the ZPL should accompany this distribution.
+# THIS SOFTWARE IS PROVIDED "AS IS" AND ANY AND ALL EXPRESS OR IMPLIED
+# WARRANTIES ARE DISCLAIMED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+# WARRANTIES OF TITLE, MERCHANTABILITY, AGAINST INFRINGEMENT, AND FITNESS
+# FOR A PARTICULAR PURPOSE.
+#
+##############################################################################
+""" Implementations of the session-based and cookie-based extractor and
+    challenge plugins.
+
+$Id$
+"""
+
+import zope.interface
+from zope.app.session.interfaces import ISession
+from zope.app.pas import interfaces
+
+class SessionExtractor:
+    """ session-based credential extractor
+    """
+    zope.interface.implements(interfaces.IExtractionPlugin)
+
+    def extractCredentials(self, request):
+        """ Extract the credentials that are referenced in the
+            request by looking them up in the session.
+
+            >>> from zope.app.session.session import RAMSessionDataContainer
+            >>> from zope.app.session.session import Session
+            >>> from tests import sessionSetUp
+            >>> request = sessionSetUp(RAMSessionDataContainer)
+            >>> sessionData = Session(request)['pas_credentials']
+            >>> sessionData['username'] = 'scott'
+            >>> sessionData['password'] = 'tiger'
+
+            >>> se = SessionExtractor()
+            >>> se.extractCredentials(request)
+            {'username': 'scott', 'password': 'tiger'}
+        """
+        sessionData = ISession(request)['pas_credentials']
+        return {'username': sessionData['username'],
+                'password': sessionData['password']}
+
+

Deleted: Zope3/trunk/src/zope/app/pas/extractionplugins.py
===================================================================
--- Zope3/trunk/src/zope/app/pas/extractionplugins.py	2004-10-10 13:14:50 UTC (rev 27899)
+++ Zope3/trunk/src/zope/app/pas/extractionplugins.py	2004-10-10 13:20:00 UTC (rev 27900)
@@ -1,48 +0,0 @@
-##############################################################################
-#
-# Copyright (c) 2004 Zope Corporation and Contributors.
-# All Rights Reserved.
-#
-# This software is subject to the provisions of the Zope Public License,
-# Version 2.1 (ZPL).  A copy of the ZPL should accompany this distribution.
-# THIS SOFTWARE IS PROVIDED "AS IS" AND ANY AND ALL EXPRESS OR IMPLIED
-# WARRANTIES ARE DISCLAIMED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
-# WARRANTIES OF TITLE, MERCHANTABILITY, AGAINST INFRINGEMENT, AND FITNESS
-# FOR A PARTICULAR PURPOSE.
-#
-##############################################################################
-""" Implementations of standard credentials extractor plugins.
-
-$Id$
-"""
-
-import zope.interface
-from zope.app.session.interfaces import ISession
-from zope.app.pas import interfaces
-
-class SessionExtractor:
-    """ session-based credential extractor
-    """
-    zope.interface.implements(interfaces.IExtractionPlugin)
-
-    def extractCredentials(self, request):
-        """ Extract the credentials that are referenced in the
-            request by looking them up in the session.
-
-            >>> from zope.app.session.session import RAMSessionDataContainer
-            >>> from zope.app.session.session import Session
-            >>> from tests import sessionSetUp
-            >>> request = sessionSetUp(RAMSessionDataContainer)
-            >>> sessionData = Session(request)['pas_credentials']
-            >>> sessionData['username'] = 'scott'
-            >>> sessionData['password'] = 'tiger'
-
-            >>> se = SessionExtractor()
-            >>> se.extractCredentials(request)
-            {'username': 'scott', 'password': 'tiger'}
-        """
-        sessionData = ISession(request)['pas_credentials']
-        return {'username': sessionData['username'],
-                'password': sessionData['password']}
-
-

Modified: Zope3/trunk/src/zope/app/pas/tests.py
===================================================================
--- Zope3/trunk/src/zope/app/pas/tests.py	2004-10-10 13:14:50 UTC (rev 27899)
+++ Zope3/trunk/src/zope/app/pas/tests.py	2004-10-10 13:20:00 UTC (rev 27900)
@@ -38,8 +38,7 @@
     ztapi.provideAdapter(IRequest, ISession, Session)
     ztapi.provideUtility(IClientIdManager, CookieClientIdManager())
     sdc = session_data_container_class()
-    for product_id in ('', 'products.foo', 'products.bar', 'products.baz'):
-        ztapi.provideUtility(ISessionDataContainer, sdc, product_id)
+    ztapi.provideUtility(ISessionDataContainer, sdc, 'pas_credentials')
     request = HTTPRequest(None, None, {}, None)
     return request
 
@@ -52,7 +51,7 @@
                              globs={'provideUtility': ztapi.provideUtility,
                                     'getEvents': getEvents,
                                     }),
-        doctest.DocTestSuite('zope.app.pas.extractionplugins'),
+        doctest.DocTestSuite('zope.app.pas.browserplugins'),
         ))
 
 if __name__ == '__main__':



More information about the Zope3-Checkins mailing list