Version 0.10017
[catagits/Catalyst-Plugin-Authentication.git] / t / lib / AuthRealmTestAppProgressive.pm
1 package AuthRealmTestAppProgressive;
2 use warnings;
3 use strict;
4 use base qw/Catalyst/;
5
6 ### using A::Store::minimal with new style realms
7 ### makes the app blow up, since c::p::a::s::minimal
8 ### isa c:a::s::minimal, and it's compat setup() gets
9 ### run, with an unexpected config has (realms on top,
10 ### not users). This tests makes sure the app no longer
11 ### blows up when this happens.
12 use Catalyst qw/
13     Authentication
14     Authentication::Store::Minimal
15 /;
16
17 our %members = (
18     'members' => {
19         bob => { password => "s00p3r" }
20     },
21     'other' => {
22         sally => { password => "s00p3r" }
23     },
24 );
25
26 __PACKAGE__->config('Plugin::Authentication' => {
27     default_realm => 'progressive',
28     progressive => {
29         class  => 'Progressive',
30         realms => [ 'other', 'members' ],
31     },
32     other => {
33         credential => {
34             class => 'Password',
35             password_field => 'password',
36             password_type  => 'clear'
37         },
38         store => {
39             class => 'Minimal',
40             users => $members{other},
41         }
42     },
43     members => {
44         credential => {
45             class => 'Password',
46             password_field => 'password',
47             password_type => 'clear'
48         },
49         store => {
50             class => 'Minimal',
51             users => $members{members},
52         }
53     },
54 });
55
56 __PACKAGE__->setup;
57
58 1;
59