Version 0.10017
[catagits/Catalyst-Plugin-Authentication.git] / t / lib / AuthRealmTestApp.pm
1 package AuthRealmTestApp;
2 use warnings;
3 use strict;
4
5 use Catalyst qw/
6     Authentication
7     Authentication::Store::Minimal
8 /;
9
10 use Test::More;
11 use Test::Exception;
12
13 our $members = {
14     bob => {
15         password => "s00p3r"
16     },
17     william => {
18         password => "s3cr3t"
19     }
20 };
21
22 our $admins = {
23     joe => {
24         password => "31337"
25     }
26 };
27
28 __PACKAGE__->config('Plugin::Authentication' => {
29     default_realm => 'members',
30     realms => {
31         members => {
32             credential => {
33                 class => 'Password',
34                 password_field => 'password',
35                 password_type => 'clear'
36             },
37             store => {
38                 class => 'Minimal',
39                 users => $members
40             }
41         },
42         admins => {
43             credential => {
44                 class => 'Password',
45                 password_field => 'password',
46                 password_type => 'clear'
47             },
48             store => {
49                 class => 'Minimal',
50                 users => $admins
51             }
52         }
53     }
54 });
55
56 __PACKAGE__->setup;
57
58 1;
59