Commit | Line | Data |
52eebd31 |
1 | package AuthRealmTestApp; |
2 | use warnings; |
3 | use strict; |
4 | |
692dcea4 |
5 | use Catalyst qw/ |
6 | Authentication |
7 | Authentication::Store::Minimal |
8 | /; |
52eebd31 |
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 | |
d055ce0c |
28 | __PACKAGE__->config('Plugin::Authentication' => { |
52eebd31 |
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', |
d055ce0c |
39 | users => $members |
52eebd31 |
40 | } |
41 | }, |
42 | admins => { |
43 | credential => { |
44 | class => 'Password', |
45 | password_field => 'password', |
46 | password_type => 'clear' |
47 | }, |
48 | store => { |
49 | class => 'Minimal', |
d055ce0c |
50 | users => $admins |
52eebd31 |
51 | } |
52 | } |
53 | } |
d055ce0c |
54 | }); |
52eebd31 |
55 | |
56 | __PACKAGE__->setup; |
d055ce0c |
57 | |
58 | 1; |
59 | |