[Catalyst] Patch for Catalyst::Authentication::Store::DBIx::Class::User

Matt S Trout dbix-class at trout.me.uk
Mon Aug 25 19:38:57 BST 2008


On Fri, Aug 22, 2008 at 09:42:07AM -0600, Jason Kuri wrote:
> >>On Thursday 21 August 2008 23:12:40 David Jack Wange Olrik wrote:
> >>>Wouldn't it be neat to have the username field configurable, just
> >>>like 'password_field' ?
> >>
> >>You don't need that, read this:
> >>[ ... ]
> >>Basically you pass whatever hashref you need to $c->authenticate. The
> >>password_field is necessary because of the possible changes done by
> >>Credential::Password .
> >
> >I think the point is that it should be possible to rename fields on
> >the
> >DBIC side without eneding to change your $c->authenticate line.
> 
> I disagree.  The goal seems to be to loosely bind to the DB fields
> from the auth side.  This should be handled long before the
> DBIx::Class store.
> 
> The problem is that If we made 'username' configurable, we would have
> to make every field configurable.  We'd need essentially a map of
> 'inbound fields' to 'fields to send to ->search()' because username is
> only one of the possible ways to search users during authentication.
> 
> To do it properly, we'd also have to make a generic way to handle
> values and translate them to what would be in the database.  Taking
> the example from the POD  status => 'active'  in the auth call would
> need to be translatable to a 'user_access_level' field which could
> have the values of 'logged in' 'registered' or 'admin'.
> 
> There are too many more reasonable ways to accomplish this in an
> application that would not be convoluted and would not bury the fact
> that it is occuring at all.  Adding it at the store level would be
> difficult to do well for relatively questionable gain.

Hmm. Actually, I think having the DBIC level be able to keep the mapping
would probably be better.

Which of course means I need SQLA2 and the DBIC collection API I have
planned for DBICMoose.

Which of course means now it's my problem again.

In the friendliest possible way, fuck you you fucking fuck :P

*crawls off into a corner to dream of enough tuits to get all this done*

-- 
      Matt S Trout       Need help with your Catalyst or DBIx::Class project?
   Technical Director                    http://www.shadowcat.co.uk/catalyst/
 Shadowcat Systems Ltd.  Want a managed development or deployment platform?
http://chainsawblues.vox.com/            http://www.shadowcat.co.uk/servers/



More information about the Catalyst mailing list