[Catalyst] C-P-Authentication-Store-DBIC auto_create()

David Kamholz davekam at pobox.com
Fri Mar 10 06:06:40 CET 2006


On Mar 9, 2006, at 3:27 PM, Carl Franks wrote:
> Instead of the user having to provide the auto_create() method in
> their DBIC User class, how about having it defined in
> C-P-Authentication-Store-DBIC-User ?
> It should be able to make the call to create() using the column spec
> from config()

The problem with this is that there isn't really a general way to  
know how to create the new user -- there may be more information  
stored about them beyond username and password. This feature was  
actually added with Credential::TypeKey in mind, and it specifically  
needs to store other stuff. But Store::DBIC shouldn't have logic for  
Credential::TypeKey's fields inside of it. And the general idea,  
anyway, is as much as possible not to enforce a database schema -- so  
for now it just leaves it up to the author of the CDBI or DBIC table  
class. On IRC yesterday nothingmuch was saying he planned to write a  
generic user creation, modification, and deletion api for the  
Authentication plugins. That will hopefully be a more fully thought  
out solution, although the issues I just mentioned will still be there.

> And instead of having C-P-Authentication-Store-DBIC support both  
> DBIC and CDBI,
> how about creating a new C-P-Authentication-Store-CDBI module which
> inherits from C-P-Authentication-Store-DBIC, overridding when
> necessary.
> e.g. the auto_create() method which needs to call create() for DBIC
> and insert() for CDBI.

Well, at the moment almost all of the code is the same for the two  
implementations, which is why they've never been split (plus, the  
CDBI stuff has been considered "only if you really have to"). But it  
may well be necessary to do so as more features get added.

Any suggestions for how user management should work in general in the  
auth framework would be much appreciated.

Dave



More information about the Catalyst mailing list