[Checkins] SVN: PluggableAuthService/trunk/ - Add support for
registering plugin types via ZCML.
Tres Seaver
tseaver at palladion.com
Tue Feb 27 13:24:42 EST 2007
Log message for revision 72891:
- Add support for registering plugin types via ZCML.
Changed:
U PluggableAuthService/trunk/doc/CHANGES.txt
A PluggableAuthService/trunk/meta.zcml
A PluggableAuthService/trunk/zcml.py
-=-
Modified: PluggableAuthService/trunk/doc/CHANGES.txt
===================================================================
--- PluggableAuthService/trunk/doc/CHANGES.txt 2007-02-27 17:16:36 UTC (rev 72890)
+++ PluggableAuthService/trunk/doc/CHANGES.txt 2007-02-27 18:24:41 UTC (rev 72891)
@@ -4,12 +4,19 @@
Features Added
+ - Added support for registering plugin types via ZCML.
+
- Implemented authentication caching in _extractUserIds.
- Ported standard user folder tests from the AccessControl test suite.
Bugs Fixed
+ - Made the CookieAuthHelper only use the '__ac_name' field if
+ '__ac_password' is also present. This fixes a login problem for
+ CMF sites where the login name was remembered between sessions with
+ an '__ac_name' cookie.
+
- Made the DomainAuthHelper return the remote address, even it the
remote host is not available (http://www.zope.org/Collectors/PAS/49).
Added: PluggableAuthService/trunk/meta.zcml
===================================================================
--- PluggableAuthService/trunk/meta.zcml 2007-02-27 17:16:36 UTC (rev 72890)
+++ PluggableAuthService/trunk/meta.zcml 2007-02-27 18:24:41 UTC (rev 72891)
@@ -0,0 +1,12 @@
+<configure
+ xmlns="http://namespaces.zope.org/zope"
+ xmlns:meta="http://namespaces.zope.org/meta">
+
+ <meta:directive
+ name="registerMultiPlugin"
+ namespace="http://namespaces.zope.org/pluggableauthservice"
+ schema=".zcml.IRegisterMultiPlugin"
+ handler=".zcml.registerMultiPlugin"
+ />
+
+</configure>
Added: PluggableAuthService/trunk/zcml.py
===================================================================
--- PluggableAuthService/trunk/zcml.py 2007-02-27 17:16:36 UTC (rev 72890)
+++ PluggableAuthService/trunk/zcml.py 2007-02-27 18:24:41 UTC (rev 72891)
@@ -0,0 +1,68 @@
+##############################################################################
+#
+# Copyright (c) 2007 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.
+#
+##############################################################################
+"""PAS ZCML directives.
+
+$Id$
+"""
+from zope.configuration.fields import PythonIdentifier
+from zope.interface import Interface
+
+from PluggableAuthService import MultiPlugins
+from PluggableAuthService import registerMultiPlugin as rMP
+
+
+class IRegisterMultiPlugin(Interface):
+
+ """Register profiles with the global registry.
+ """
+
+ class_ = PythonIdentifier(
+ title=u'Class',
+ description=u'',
+ required=False)
+
+ meta_type = PythonIdentifier(
+ title=u'Meta-Type',
+ description=u"If not specified, 'class/meta_type' is used.",
+ required=False)
+
+
+_mt_regs = []
+def registerMultiPlugin(_context, class_=None, meta_type=None):
+ """ Add a new meta_type to the registry.
+ """
+ if not class_ and not meta_type:
+ raise ConfigurationError(
+ "At least one of 'class' or 'meta_type' is required.")
+
+ if not meta_type:
+ meta_type = class_.meta_type
+
+ _mt_regs.append(meta_type)
+
+ _context.action(
+ discriminator = ('registerMultiPlugin', meta_type),
+ callable = rMP,
+ args = (meta_type,),
+ )
+
+
+def cleanUp():
+ global _mt_regs
+ for meta_type in _mt_regs:
+ MultiPlugins.remove(meta_type)
+ _mt_regs = []
+
+from zope.testing.cleanup import addCleanUp
+addCleanUp(cleanUp)
+del addCleanUp
Property changes on: PluggableAuthService/trunk/zcml.py
___________________________________________________________________
Name: svn:keywords
+ Id
Name: svn:eol-style
+ native
More information about the Checkins
mailing list