[Catalyst-commits] r11233 - in Catalyst-Plugin-Authentication/0.10000/trunk: lib/Catalyst/Authentication/Credential t t/lib

t0m at dev.catalyst.perl.org t0m at dev.catalyst.perl.org
Mon Aug 24 13:30:52 GMT 2009


Author: t0m
Date: 2009-08-24 13:30:51 +0000 (Mon, 24 Aug 2009)
New Revision: 11233

Modified:
   Catalyst-Plugin-Authentication/0.10000/trunk/lib/Catalyst/Authentication/Credential/Remote.pm
   Catalyst-Plugin-Authentication/0.10000/trunk/t/lib/RemoteTestApp2.pm
   Catalyst-Plugin-Authentication/0.10000/trunk/t/live_app_remote2.t
Log:
Stop forcing $authinfo->{id} to be passed down to the store, instead using just configurable username_field.

Modified: Catalyst-Plugin-Authentication/0.10000/trunk/lib/Catalyst/Authentication/Credential/Remote.pm
===================================================================
--- Catalyst-Plugin-Authentication/0.10000/trunk/lib/Catalyst/Authentication/Credential/Remote.pm	2009-08-24 12:51:03 UTC (rev 11232)
+++ Catalyst-Plugin-Authentication/0.10000/trunk/lib/Catalyst/Authentication/Credential/Remote.pm	2009-08-24 13:30:51 UTC (rev 11233)
@@ -35,7 +35,7 @@
     }
     $self->source($config->{source} || 'REMOTE_USER');
     $self->realm($realm);
-    $self->username_field($config->{username_field} || 'username');
+    $self->username_field($config->{username_field} || 'id');
     return $self;
 }
 
@@ -104,9 +104,8 @@
             $usr = $1;
         }
     }
-    
-    $authinfo->{id} = $authinfo->{ $self->username_field } = $usr;
-    $authinfo->{remote_user} = $remuser; # just to keep the original value
+
+    $authinfo->{ $self->username_field } = $usr;
     my $user_obj = $realm->find_user( $authinfo, $c );
     return ref($user_obj) ? $user_obj : undef;
 }

Modified: Catalyst-Plugin-Authentication/0.10000/trunk/t/lib/RemoteTestApp2.pm
===================================================================
--- Catalyst-Plugin-Authentication/0.10000/trunk/t/lib/RemoteTestApp2.pm	2009-08-24 12:51:03 UTC (rev 11232)
+++ Catalyst-Plugin-Authentication/0.10000/trunk/t/lib/RemoteTestApp2.pm	2009-08-24 13:30:51 UTC (rev 11233)
@@ -30,10 +30,10 @@
 sub default : Local {
     my ( $self, $c ) = @_;
     if ($c->authenticate()) {
-        $c->res->body( 'User:'
-              . $c->user->{id} . "\n"
-              . 'my_user_name:'
-              . $c->user->{my_user_name} );
+        $c->res->body( 
+              'my_user_name:'
+              . $c->user->{my_user_name}
+        );
     }
     else {
         $c->res->body('FAIL');

Modified: Catalyst-Plugin-Authentication/0.10000/trunk/t/live_app_remote2.t
===================================================================
--- Catalyst-Plugin-Authentication/0.10000/trunk/t/live_app_remote2.t	2009-08-24 12:51:03 UTC (rev 11232)
+++ Catalyst-Plugin-Authentication/0.10000/trunk/t/live_app_remote2.t	2009-08-24 13:30:51 UTC (rev 11233)
@@ -16,5 +16,5 @@
 
 $RemoteTestEngine::SSL_CLIENT_S_DN = 'CN=namexyz/OU=Test/C=Company';
 ok( request('/')->is_success, 'testing "source" + "cutname" 1' );
-is( request('/')->content, "User:namexyz\nmy_user_name:namexyz",
+is( request('/')->content, "my_user_name:namexyz",
    'testing "source" + "cutname" 2' );




More information about the Catalyst-commits mailing list