New test for credentials with detach.
[catagits/Catalyst-Plugin-Authentication.git] / t / lib / AuthRealmTestAppProgressive.pm
CommitLineData
714e2bdc 1package AuthRealmTestAppProgressive;
2use warnings;
3use strict;
d055ce0c 4use base qw/Catalyst/;
714e2bdc 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.
12use Catalyst qw/
13 Authentication
14 Authentication::Store::Minimal
15/;
16
714e2bdc 17our %members = (
18 'members' => {
19 bob => { password => "s00p3r" }
20 },
21 'other' => {
22 sally => { password => "s00p3r" }
23 },
24);
25
05e98f5f 26# Matches user above so we can test against a detach and confirm
27# it gets skipped and auths in 'members' realm
28our $detach_test_info = {
29 'user' => 'bob',
30 'password' => 's00p3r',
31 'realm_to_pass' => 'members',
32};
33
d055ce0c 34__PACKAGE__->config('Plugin::Authentication' => {
714e2bdc 35 default_realm => 'progressive',
36 progressive => {
37 class => 'Progressive',
75f03cff 38 realms => [ 'alwaysdetach', 'other', 'members' ],
39 },
40 alwaysdetach => {
41 credential => {
42 class => 'AlwaysDetach',
43 },
44 store => {
45 class => 'Minimal',
46 users => {},
47 },
714e2bdc 48 },
49 other => {
50 credential => {
51 class => 'Password',
52 password_field => 'password',
53 password_type => 'clear'
54 },
55 store => {
56 class => 'Minimal',
57 users => $members{other},
58 }
59 },
60 members => {
61 credential => {
62 class => 'Password',
63 password_field => 'password',
64 password_type => 'clear'
65 },
66 store => {
67 class => 'Minimal',
68 users => $members{members},
69 }
70 },
d055ce0c 71});
714e2bdc 72
73__PACKAGE__->setup;
74
d055ce0c 751;
76