[Catalyst-commits] r10314 - in
branches/Catalyst-Plugin-Authentication/credential_remote/t: . lib
t0m at dev.catalyst.perl.org
t0m at dev.catalyst.perl.org
Wed May 27 13:58:46 GMT 2009
Author: t0m
Date: 2009-05-27 13:58:45 +0000 (Wed, 27 May 2009)
New Revision: 10314
Modified:
branches/Catalyst-Plugin-Authentication/credential_remote/t/lib/RemoteTestApp.pm
branches/Catalyst-Plugin-Authentication/credential_remote/t/lib/RemoteTestEngine.pm
branches/Catalyst-Plugin-Authentication/credential_remote/t/live_app_remote.t
Log:
Make the test pass
Modified: branches/Catalyst-Plugin-Authentication/credential_remote/t/lib/RemoteTestApp.pm
===================================================================
--- branches/Catalyst-Plugin-Authentication/credential_remote/t/lib/RemoteTestApp.pm 2009-05-27 09:40:41 UTC (rev 10313)
+++ branches/Catalyst-Plugin-Authentication/credential_remote/t/lib/RemoteTestApp.pm 2009-05-27 13:58:45 UTC (rev 10314)
@@ -17,7 +17,9 @@
deny_regexp=> 'denied',
cutname_regexp=> 'CN=(.*),',
},
- store => { class => 'Null', }
+ store => {
+ class => 'Null',
+ },
},
},
},
@@ -25,6 +27,14 @@
sub default : Local {
my ( $self, $c ) = @_;
+ if ($c->authenticate()) {
+ $c->res->body('OK');
+ }
+ else {
+ $c->res->body('FAIL');
+ $c->res->status(403);
+ }
}
-
+
__PACKAGE__->setup;
+
Modified: branches/Catalyst-Plugin-Authentication/credential_remote/t/lib/RemoteTestEngine.pm
===================================================================
--- branches/Catalyst-Plugin-Authentication/credential_remote/t/lib/RemoteTestEngine.pm 2009-05-27 09:40:41 UTC (rev 10313)
+++ branches/Catalyst-Plugin-Authentication/credential_remote/t/lib/RemoteTestEngine.pm 2009-05-27 13:58:45 UTC (rev 10314)
@@ -1,8 +1,13 @@
package RemoteTestEngine;
-use base 'Catalyst::Engine::HTTP';
+use base 'Catalyst::Engine::CGI';
-our %E = %ENV;
+our $REMOTE_USER;
-my $env = \%E;
+sub env {
+ my $self = shift;
+ return {
+ REMOTE_USER => $REMOTE_USER,
+ };
+};
1;
Modified: branches/Catalyst-Plugin-Authentication/credential_remote/t/live_app_remote.t
===================================================================
--- branches/Catalyst-Plugin-Authentication/credential_remote/t/live_app_remote.t 2009-05-27 09:40:41 UTC (rev 10313)
+++ branches/Catalyst-Plugin-Authentication/credential_remote/t/live_app_remote.t 2009-05-27 13:58:45 UTC (rev 10314)
@@ -1,22 +1,23 @@
use strict;
-use warnings;
+use warnings;
use Test::More tests => 5;
use lib 't/lib';
use Catalyst::Test qw/RemoteTestApp/;
-$RemoteTestEngine::E{REMOTE_USER} = 'john';
+$RemoteTestEngine::REMOTE_USER = 'john';
ok( request('/')->is_success );
-$RemoteTestEngine::E{REMOTE_USER} = 'nonexisting';
+$RemoteTestEngine::REMOTE_USER = 'nonexisting';
ok( !request('/')->is_success );
-$RemoteTestEngine::E{REMOTE_USER} = 'denieduser';
+$RemoteTestEngine::REMOTE_USER = 'denieduser';
ok( !request('/')->is_success );
-$RemoteTestEngine::E{REMOTE_USER} = undef;
+$RemoteTestEngine::REMOTE_USER = undef;
ok( !request('/')->is_success );
-$RemoteTestEngine::E{SSL_CLIENT_DN} = 'CN=user, OU=any';
+$RemoteTestEngine::SSL_CLIENT_DN = 'CN=user, OU=any';
# will probably fail on 5.80004 and before
ok( !request('/')->is_success );
+
More information about the Catalyst-commits
mailing list