[Zope-CVS] CVS: Products/PluggableAuthService/interfaces -
request.py:1.4 authservice.py:1.6 plugins.py:1.9
propertysheets.py:1.4
Sidnei da Silva
sidnei at enfoldsystems.com
Wed Aug 17 16:53:44 EDT 2005
Update of /cvs-repository/Products/PluggableAuthService/interfaces
In directory cvs.zope.org:/tmp/cvs-serv13697/interfaces
Modified Files:
authservice.py plugins.py propertysheets.py
Added Files:
request.py
Log Message:
Merge changes from sidnei-challenge-protocol-chooser:
- Added two new interfaces, IChallengeProtocolChooser and
IRequestTypeSniffer. Those are used to select the 'authorization
protocol' or 'challenger protocol' to be used for challenging
according to the incoming request type.
- Fixed a couple more places where Zope 2-style __implements__
where being used to standardize on using classImplements.
- Fixed fallback implementations of providedBy and
implementedBy to always return a tuple.
- Make sure challenge doesn't break if existing instances of the
PluginRegistry don't yet have IChallengeProtocolChooser as a
registered interface. (Would be nice to have some sort of
migration for the PluginRegistry between PAS releases)
- Don't assume that just because zope.interface can be imported
that Five is present.
=== Products/PluggableAuthService/interfaces/request.py 1.3 => 1.4 ===
--- /dev/null Wed Aug 17 16:53:44 2005
+++ Products/PluggableAuthService/interfaces/request.py Wed Aug 17 16:53:13 2005
@@ -0,0 +1,58 @@
+##############################################################################
+#
+# Copyright (c) 2001 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.
+#
+##############################################################################
+""" Interfaces for PluggableAuthService
+
+$Id$
+"""
+# Eventually, those interfaces should be moved to Zope and imported
+# here as aliases for backward compatibility.
+
+try:
+ from zope.interface import Interface
+except ImportError:
+ from Interface import Interface
+
+class IRequest( Interface ):
+
+ """ Base Request Interface
+
+ XXX Add methods from BaseRequest?
+ """
+
+class IHTTPRequest( IRequest ):
+
+ """ HTTP Request
+ """
+
+class IBrowserRequest( IHTTPRequest ):
+
+ """Browser Request
+ """
+
+class IWebDAVRequest( IHTTPRequest ):
+
+ """ WebDAV Request
+ """
+
+class IXMLRPCRequest( IHTTPRequest ):
+
+ """ XML-RPC Request
+ """
+
+class IFTPRequest( IRequest ):
+
+ """ FTP Request
+ """
+
=== Products/PluggableAuthService/interfaces/authservice.py 1.5 => 1.6 ===
--- Products/PluggableAuthService/interfaces/authservice.py:1.5 Fri May 27 14:55:44 2005
+++ Products/PluggableAuthService/interfaces/authservice.py Wed Aug 17 16:53:13 2005
@@ -17,7 +17,10 @@
$Id$
"""
-from Interface import Interface
+try:
+ from zope.interface import Interface
+except ImportError:
+ from Interface import Interface
from AccessControl.ZopeSecurityPolicy import _noroles
=== Products/PluggableAuthService/interfaces/plugins.py 1.8 => 1.9 ===
--- Products/PluggableAuthService/interfaces/plugins.py:1.8 Wed Jul 6 14:48:02 2005
+++ Products/PluggableAuthService/interfaces/plugins.py Wed Aug 17 16:53:13 2005
@@ -430,6 +430,31 @@
scaling issues for some implementations.
"""
+class IRequestTypeSniffer( Interface ):
+
+ """ Given a request, detects the request type for later use by other plugins.
+ """
+ def sniffRequestType( request ):
+ """ Return a interface identifying what kind the request is.
+ """
+
+class IChallengeProtocolChooser( Interface ):
+
+ """ Choose a proper set of protocols to be used for challenging
+ the client given a request.
+ """
+ def chooseProtocols( request ):
+ """ -> ( protocol_1, ... protocol_N) | None
+
+ o If a set of protocols is returned, the first plugin with a
+ protocol that is in the set will define the protocol to be
+ used for the current request.
+
+ o If None is returned, the 'first found protocol' wins.
+
+ o Once the protocol is decided, all challenge plugins for that
+ protocol will be executed.
+ """
#
# XXX: Do we need a LocalRoleAlgorithm plugin type? E.g., base_cms
# has two different algorithms, based on whether or not the
=== Products/PluggableAuthService/interfaces/propertysheets.py 1.3 => 1.4 ===
--- Products/PluggableAuthService/interfaces/propertysheets.py:1.3 Thu Aug 12 11:15:54 2004
+++ Products/PluggableAuthService/interfaces/propertysheets.py Wed Aug 17 16:53:13 2005
@@ -17,7 +17,10 @@
$Id$
"""
-from Interface import Interface
+try:
+ from zope.interface import Interface
+except ImportError:
+ from Interface import Interface
class IPropertySheet( Interface ):
More information about the Zope-CVS
mailing list