[Catalyst-commits] r13019 - in Catalyst-Authentication-Credential-HTTP/1.000/trunk/t/lib: . AuthDigestTestApp AuthDigestTestApp/Controller AuthTestApp AuthTestApp/Controller

t0m at dev.catalyst.perl.org t0m at dev.catalyst.perl.org
Sun Mar 7 21:05:58 GMT 2010


Author: t0m
Date: 2010-03-07 21:05:57 +0000 (Sun, 07 Mar 2010)
New Revision: 13019

Added:
   Catalyst-Authentication-Credential-HTTP/1.000/trunk/t/lib/AuthDigestTestApp/
   Catalyst-Authentication-Credential-HTTP/1.000/trunk/t/lib/AuthDigestTestApp/Controller/
   Catalyst-Authentication-Credential-HTTP/1.000/trunk/t/lib/AuthDigestTestApp/Controller/Root.pm
   Catalyst-Authentication-Credential-HTTP/1.000/trunk/t/lib/AuthTestApp/
   Catalyst-Authentication-Credential-HTTP/1.000/trunk/t/lib/AuthTestApp/Controller/
   Catalyst-Authentication-Credential-HTTP/1.000/trunk/t/lib/AuthTestApp/Controller/Root.pm
Modified:
   Catalyst-Authentication-Credential-HTTP/1.000/trunk/t/lib/AuthDigestTestApp.pm
   Catalyst-Authentication-Credential-HTTP/1.000/trunk/t/lib/AuthTestApp.pm
Log:
Move actions out of test app

Added: Catalyst-Authentication-Credential-HTTP/1.000/trunk/t/lib/AuthDigestTestApp/Controller/Root.pm
===================================================================
--- Catalyst-Authentication-Credential-HTTP/1.000/trunk/t/lib/AuthDigestTestApp/Controller/Root.pm	                        (rev 0)
+++ Catalyst-Authentication-Credential-HTTP/1.000/trunk/t/lib/AuthDigestTestApp/Controller/Root.pm	2010-03-07 21:05:57 UTC (rev 13019)
@@ -0,0 +1,17 @@
+package AuthDigestTestApp::Controller::Root;
+use strict;
+use warnings;
+
+use base qw/ Catalyst::Controller /;
+
+__PACKAGE__->config(namespace => '');
+
+sub moose : Local {
+    my ( $self, $c ) = @_;
+    #$c->authenticate( { realm => 'testrealm at host.com' } );
+    $c->authenticate();
+    $c->res->body( $c->user->id );
+}
+
+1;
+

Modified: Catalyst-Authentication-Credential-HTTP/1.000/trunk/t/lib/AuthDigestTestApp.pm
===================================================================
--- Catalyst-Authentication-Credential-HTTP/1.000/trunk/t/lib/AuthDigestTestApp.pm	2010-03-07 20:56:42 UTC (rev 13018)
+++ Catalyst-Authentication-Credential-HTTP/1.000/trunk/t/lib/AuthDigestTestApp.pm	2010-03-07 21:05:57 UTC (rev 13019)
@@ -1,26 +1,23 @@
 package AuthDigestTestApp;
-    use Catalyst qw/
-      Authentication
-      Cache
-      /;
-    
-    our %users;
-    sub moose : Local {
-        my ( $self, $c ) = @_;
-        #$c->authenticate( { realm => 'testrealm at host.com' } );
-        $c->authenticate();
-        $c->res->body( $c->user->id );
-    }
-    my $digest_pass = Digest::MD5->new;
-    $digest_pass->add('Mufasa2:testrealm at host.com:Circle Of Life');
-    %users = ( 
-        Mufasa  => { pass         => "Circle Of Life",          }, 
+use Catalyst qw/
+    Authentication
+    Cache
+/;
+
+our %users;
+my $digest_pass = Digest::MD5->new;
+$digest_pass->add('Mufasa2:testrealm at host.com:Circle Of Life');
+%users = (
+        Mufasa  => { pass         => "Circle Of Life",          },
         Mufasa2 => { pass         => $digest_pass->hexdigest, },
-    );
-    __PACKAGE__->config->{cache}{backend} = {
-        class => 'Cache::FileCache',
-    };
-    __PACKAGE__->config( authentication => {
+);
+__PACKAGE__->config(
+    cache => {
+        backend => {
+            class => 'Cache::FileCache',
+        },
+    },
+    authentication => {
         default_realm => 'testrealm at host.com',
         realms => {
             'testrealm at host.com' => {
@@ -31,10 +28,14 @@
                 credential => {
                     class => 'HTTP',
                     type  => 'digest',
-                    password_type => 'clear', 
+                    password_type => 'clear',
                     password_field => 'pass'
                 },
             },
         },
-    });
-    __PACKAGE__->setup;
+    },
+);
+__PACKAGE__->setup;
+
+1;
+

Added: Catalyst-Authentication-Credential-HTTP/1.000/trunk/t/lib/AuthTestApp/Controller/Root.pm
===================================================================
--- Catalyst-Authentication-Credential-HTTP/1.000/trunk/t/lib/AuthTestApp/Controller/Root.pm	                        (rev 0)
+++ Catalyst-Authentication-Credential-HTTP/1.000/trunk/t/lib/AuthTestApp/Controller/Root.pm	2010-03-07 21:05:57 UTC (rev 13019)
@@ -0,0 +1,19 @@
+package AuthTestApp::Controller::Root;
+use strict;
+use warnings;
+
+use base qw/ Catalyst::Controller /;
+
+__PACKAGE__->config( namespace => '' );
+
+sub auto : Private {
+    my ($self, $c) = @_;
+    $c->authenticate();
+}
+sub moose : Local {
+    my ( $self, $c ) = @_;
+    $c->res->body( $c->user->id );
+}
+
+1;
+

Modified: Catalyst-Authentication-Credential-HTTP/1.000/trunk/t/lib/AuthTestApp.pm
===================================================================
--- Catalyst-Authentication-Credential-HTTP/1.000/trunk/t/lib/AuthTestApp.pm	2010-03-07 20:56:42 UTC (rev 13018)
+++ Catalyst-Authentication-Credential-HTTP/1.000/trunk/t/lib/AuthTestApp.pm	2010-03-07 21:05:57 UTC (rev 13019)
@@ -1,34 +1,29 @@
 package AuthTestApp;
-    use Catalyst qw/
-      Authentication
-      /;
-    our %users;
-    __PACKAGE__->config(authentication => {
+use Catalyst qw/
+    Authentication
+/;
+our %users;
+__PACKAGE__->config(
+    'Plugin::Authentication' => {
         default_realm => 'test',
-        realms => {
-            test => {
-                store => { 
-                    class => 'Minimal',
-                    users => \%users,
-                },
-                credential => { 
-                    class => 'HTTP', 
-                    type  => 'basic',
-                    password_type => 'clear', 
-                    password_field => 'password'
-                },
+        test => {
+            store => {
+                class => 'Minimal',
+                users => \%users,
             },
+            credential => {
+                class => 'HTTP',
+                type  => 'basic',
+                password_type => 'clear',
+                password_field => 'password'
+            },
         },
-    });
-    sub auto : Private {
-        my ($self, $c) = @_;
-        $c->authenticate();
-    }
-    sub moose : Local {
-        my ( $self, $c ) = @_;
-	    $c->res->body( $c->user->id );
-    }
-    %users = (
-        foo => { password         => "s3cr3t", },
-    );
-    __PACKAGE__->setup;
+    },
+);
+%users = (
+    foo => { password         => "s3cr3t", },
+);
+__PACKAGE__->setup;
+
+1;
+




More information about the Catalyst-commits mailing list