[Zope3-Users] Programatically add plugins to PAU

Florian Lindner mailinglists at xgm.de
Wed Apr 12 10:39:07 EDT 2006


Am Mittwoch, 12. April 2006 08:50 schrieb Stephan Richter:
> On Wednesday 12 April 2006 02:39, Michael Howitz wrote:
> > This is how we did it in a project:
> > createAuthenticationUtils is called on handling the ObjectAddedEvent for
> > the folder (which is programmatically made a site) which should contain
> > the PAU.
>
> Interesting. We did, of course, something similar too in our current
> project. This either means that (a) PAU is too hard to set up and/or (b)
> that we need another "helper" layer.
>
> I would like to think the problem is (b), because I like the flexibility of
> PAU. The configuration package we wrote is step one, but it would be good
> to agree on a set of high-level helper functions too.

I think it's fine the way it is beside one thing.


# This is fine, it's added just like all the other utilites.

pau = ensureUtility(cs, IPluggableAuthentication, '', 
PluggableAuthentication , asObject = True)



# This is ok for adding, but I got no idea how to register it. A nice thing 
would be function like ensurePlugin that works analog to ensureUtility (adds 
und registers a plugin, does the NameChooser call if needed, ...)

principal_folder = PrincipalFolder(prefix = "cs")
pau["PrincipalFolder"] = principal_folder
            

# This is pretty straightforward but I was not expecting to give a string, 
rather I thougt it expected a Interface or something like that.

pau.credentialsPlugins = (u'Session Credentials',)



The only thing I would change is to add a ensurePlugin function to either the 
pau object itself or also as part of zope.app.appsetup. (like all the other 
ensure* functions).

Florian


More information about the Zope3-users mailing list