moved tests out and into t/lib/
[catagits/Catalyst-Authentication-Credential-HTTP.git] / t / lib / AuthDigestTestApp.pm
CommitLineData
861c2f44 1package AuthDigestTestApp;
2 use Catalyst qw/
3 Authentication
4 Cache
5 /;
6
7 our %users;
8 sub moose : Local {
9 my ( $self, $c ) = @_;
10 #$c->authenticate( { realm => 'testrealm@host.com' } );
11 $c->authenticate();
12 $c->res->body( $c->user->id );
13 }
14 my $digest_pass = Digest::MD5->new;
15 $digest_pass->add('Mufasa2:testrealm@host.com:Circle Of Life');
16 %users = (
17 Mufasa => { pass => "Circle Of Life", },
18 Mufasa2 => { pass => $digest_pass->hexdigest, },
19 );
20 __PACKAGE__->config->{cache}{backend} = {
21 class => 'Cache::FileCache',
22 };
23 __PACKAGE__->config( authentication => {
24 default_realm => 'testrealm@host.com',
25 realms => {
26 'testrealm@host.com' => {
27 store => {
28 class => 'Minimal',
29 users => \%users,
30 },
31 credential => {
32 class => 'HTTP',
33 type => 'digest',
34 password_type => 'clear',
35 password_field => 'pass'
36 },
37 },
38 },
39 });
40 __PACKAGE__->setup;