[Zope] Use of GRUF with exUserFolder/PostgreSQL broken?

Joel Burton joel@joelburton.com
Tue, 11 Mar 2003 14:51:06 -0500


Dear GRUF and exUserFolder developers, and others familiar with both
APIs:

I'm trying to use both of your products together, as in:


acl_users [ GRUF Folder ]
 |
 \- Users
 |  |
 |  \- acl_users [ exUserFolder/PostgreSQL ]
 |
 \- Groups
    |
    \- acl_users [ normal Zope UserFolder ]

I've used exUserFolder before without problems, and have tested GRUF
with normal Zope UserFolders without problem.

I'm able to setup the configuration above and can add users using the
exUserFolder acl_users interface.

The problem is:

When a user tries to log in, this calls the GRUF authenticate method,
which is:


    def authenticate(self, password, request):
            return self.__underlying__.authenticate(password, request)


This calls the actual acl_users folder authenticate method. For a
standard Zope UserFolder, this is:


    def authenticate(self, password, request):
    	[ ... ]

so it works fine.

However, when called with an exUserFolder as the UserFolder, there is no
authenticate method on the user folder for PostgreSQL authentication.
Rather, there is an authenticate method only on the User object itself.
The signature for this is:

    def authenticate(self, listOneUser, password, request, remoteAuth=None):

There are "std_validate" and "cookie_validate" methods of
exUserFolder.exUserFolder, but these validate, rather than just
authenticate a user.

So, when GRUF tries to authenticate a user using the standard Zopish
API, it misses the user folder (which has no matching API method), and
hits the xUF.User object, which has a different method.

I could modify the GRUF source to hardcode my listOneUser object, and
pass that along with the call (though I haven't tested this yet).
However, I'm not sure that's The Right Thing To Do, and that would have
me lose all of the caching that xUF can provide, since it would do a DB
call every time.

I'd love to use your products together. Can either of you provide any
help on this? If this is something not in your anticipated development
improvements for the product, it's possible that we'd consider
sponsoring some time to get these two products working together.

Thanks!

- j.

--

Joel BURTON  |  joel@joelburton.com  |  joelburton.com  |  aim: wjoelburton
Independent Knowledge Management Consultant