[Checkins] SVN: PluggableAuthService/branches/1.4/ Backport trunk fixes to 1.4 release branch.

Tres Seaver tseaver at palladion.com
Mon Aug 28 23:25:40 EDT 2006


Log message for revision 69829:
  Backport trunk fixes to 1.4 release branch.

Changed:
  U   PluggableAuthService/branches/1.4/README.txt
  U   PluggableAuthService/branches/1.4/doc/CHANGES.txt
  U   PluggableAuthService/branches/1.4/interfaces/plugins.py
  U   PluggableAuthService/branches/1.4/plugins/DomainAuthHelper.py
  A   PluggableAuthService/branches/1.4/plugins/tests/test_DomainAuthHelper.py
  U   PluggableAuthService/branches/1.4/version.txt

-=-
Modified: PluggableAuthService/branches/1.4/README.txt
===================================================================
--- PluggableAuthService/branches/1.4/README.txt	2006-08-29 03:22:00 UTC (rev 69828)
+++ PluggableAuthService/branches/1.4/README.txt	2006-08-29 03:25:40 UTC (rev 69829)
@@ -7,9 +7,7 @@
 
   Documentation
 
-    Please see the following documentation in the packaed software for 
-    more information:
+    Please see the files under doc/ in the packaged software for more
+    information, and consult the interfaces files under interfaces/ in
+    the software package for PluggableAuthService and plugin APIs.
 
-      - doc/framework_overview.stx (Framework overview)
-
-      - doc/plugin_APIs.stx (Plugin APIs)

Modified: PluggableAuthService/branches/1.4/doc/CHANGES.txt
===================================================================
--- PluggableAuthService/branches/1.4/doc/CHANGES.txt	2006-08-29 03:22:00 UTC (rev 69828)
+++ PluggableAuthService/branches/1.4/doc/CHANGES.txt	2006-08-29 03:25:40 UTC (rev 69829)
@@ -1,5 +1,18 @@
 PluggableAuthService changelog
 
+  PluggableAuthService 1.4 (2006/08/28)
+
+    Bugs Fixed
+
+      - Extended the DomainAuthHelper to function as its own extraction
+        plugin, to allow for the case that another extractor is registered,
+        but does not return any credentials.
+        (http://www.zope.org/Collectors/PAS/46)
+
+      - Re-worded parts of the README so they don't point to specific or 
+        non-existing files (http://www.zope.org/Collectors/PAS/6 and
+        http://www.zope.org/Collectors/PAS/47)
+
   PluggableAuthService 1.4-beta (2006/08/07)
 
     Features Added
@@ -37,7 +50,6 @@
 
       - Added a DEPENDENCIES.txt. (http://www.zope.org/Collectors/PAS/44)
 
-
   PluggableAuthService 1.3 (2006/06/09)
 
     No changes from version 1.3-beta

Modified: PluggableAuthService/branches/1.4/interfaces/plugins.py
===================================================================
--- PluggableAuthService/branches/1.4/interfaces/plugins.py	2006-08-29 03:22:00 UTC (rev 69828)
+++ PluggableAuthService/branches/1.4/interfaces/plugins.py	2006-08-29 03:25:40 UTC (rev 69829)
@@ -29,9 +29,12 @@
 
     def extractCredentials( request ):
 
-        """ request -> {}
+        """ request -> {...}
 
         o Return a mapping of any derived credentials.
+
+        o Return an empty mapping to indicate that the plugin found no
+          appropriate credentials.
         """
 
 class ILoginPasswordExtractionPlugin( IExtractionPlugin ):
@@ -46,10 +49,13 @@
                        , k1 : v1
                        ,   ...
                        , kN : vN
-                       }
+                       } | {}
 
-        o Returned mapping will contain at least 'login' and 'password'
-          keys, with the password in plaintext.
+        o If credentials are found, the returned mapping will contain at
+          least 'login' and 'password' keys, with the password in plaintext.
+
+        o Return an empty mapping to indicate that the plugin found no
+          appropriate credentials.
         """
 
 class ILoginPasswordHostExtractionPlugin( ILoginPasswordExtractionPlugin ):
@@ -66,11 +72,14 @@
                        , k1 : v1
                        ,   ...
                        , kN : vN
-                       }
+                       } | {}
 
-        o Returned mapping will contain at least 'login', 'password',
-          'remote_host' and 'remote_addr' keys, with the password in 
-          plaintext.
+        o If credentials are found, the returned mapping will contain at
+          least 'login', 'password', 'remote_host' and 'remote_addr' keys,
+          with the password in plaintext.
+
+        o Return an empty mapping to indicate that the plugin found no
+          appropriate credentials.
         """
 
 class IAuthenticationPlugin( Interface ):

Modified: PluggableAuthService/branches/1.4/plugins/DomainAuthHelper.py
===================================================================
--- PluggableAuthService/branches/1.4/plugins/DomainAuthHelper.py	2006-08-29 03:22:00 UTC (rev 69828)
+++ PluggableAuthService/branches/1.4/plugins/DomainAuthHelper.py	2006-08-29 03:25:40 UTC (rev 69829)
@@ -32,6 +32,8 @@
 from Products.PluggableAuthService.interfaces.plugins import \
     IAuthenticationPlugin
 from Products.PluggableAuthService.interfaces.plugins import \
+    IExtractionPlugin
+from Products.PluggableAuthService.interfaces.plugins import \
     IRolesPlugin
 from Products.PluggableAuthService.plugins.BasePlugin import BasePlugin
 from Products.PluggableAuthService.utils import classImplements
@@ -91,6 +93,23 @@
         self._domain_map = OOBTree()
 
 
+    security.declarePrivate('extractCredentials')
+    def extractCredentials(self, request):
+        """ Extract credentials from 'request'.
+        """
+        creds = {}
+
+        remote_host = request.get('REMOTE_HOST', '')
+        if remote_host:
+            creds['remote_host'] = request.get('REMOTE_HOST', '')
+
+            try:
+                creds['remote_address'] = request.getClientAddr()
+            except AttributeError:
+                creds['remote_address'] = request.get('REMOTE_ADDR', '')
+
+        return creds
+
     security.declarePrivate('authenticateCredentials')
     def authenticateCredentials(self, credentials):
         """ Fulfill AuthenticationPlugin requirements """
@@ -300,6 +319,7 @@
 
 classImplements( DomainAuthHelper
                , IDomainAuthHelper
+               , IExtractionPlugin
                , IAuthenticationPlugin
                , IRolesPlugin
                )

Copied: PluggableAuthService/branches/1.4/plugins/tests/test_DomainAuthHelper.py (from rev 69828, PluggableAuthService/trunk/plugins/tests/test_DomainAuthHelper.py)

Modified: PluggableAuthService/branches/1.4/version.txt
===================================================================
--- PluggableAuthService/branches/1.4/version.txt	2006-08-29 03:22:00 UTC (rev 69828)
+++ PluggableAuthService/branches/1.4/version.txt	2006-08-29 03:25:40 UTC (rev 69829)
@@ -1 +1 @@
-PluggableAuthService-1.4-beta
+PluggableAuthService-1.4



More information about the Checkins mailing list