Move actions out of test app
[catagits/Catalyst-Authentication-Credential-HTTP.git] / t / lib / AuthTestApp.pm
index 2b8f44a..c8300df 100644 (file)
@@ -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;
+