[Catalyst-dev] Bug/Feature request in C::P::A::Backend

Evan Carroll evan at dealermade.com
Mon Feb 19 17:51:28 GMT 2007


Ok, because me rewriting stuff seems to piss everyone off. I have a
feature request line 122 of C::P::A::S reads as such:

    $c->_user( my $user = $store->from_session( $c, $frozen_user ) ); 

This is a problem, because ->from_session this should take the same args
that are sent to ->get_user. ( ->get_user's args should be cached and
resent to ->from_session )
package Catalyst::Plugin::Authentication::Store::LDAP::Backend; ( my
version )
sub from_session {
  my ( $self, $c, $id, @args ) = @_;
  $self->get_user($id, @args);
}

But it seems as if it extends further than my ::LDAP rewrite, ::DBIC
doesn't accept a third argument to ->from_session at all. (I would
suggest ::DBIC::Backend to send the third+ arguments to ->get_user too
for consistency) 
package Catalyst::Plugin::Authentication::Store::DBIC::Backend;

sub from_session {
    my ( $self, $c, $id ) = @_;

    return $id if ref $id;

    # XXX: hits the database on every request?  Not good...
    return $self->get_user( $id );
}

Most stores implement ->from_session as ->get_user, but they don't send
third+ args.

This makes life more difficult, as anything on $c->login's component
will work, but any time $c->user is called in a later request, it blows
up and eats your face.


-- 
Evan Carroll
System Lord of the Internets
evan at dealermade.com
888-403-9143





More information about the Catalyst-dev mailing list