File: AuthRealmTestApp.pm

package info (click to toggle)
libcatalyst-plugin-authentication-perl 0.10024-1
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid, trixie
  • size: 508 kB
  • sloc: perl: 1,531; makefile: 2
file content (58 lines) | stat: -rw-r--r-- 1,077 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
package AuthRealmTestApp;
use warnings;
use strict;

use Catalyst qw/
    Authentication
    Authentication::Store::Minimal
/;

use Test::More;

our $members = {
    bob => {
        password => "s00p3r"
    },
    william => {
        password => "s3cr3t"
    }
};

our $admins = {
    joe => {
        password => "31337"
    }
};

__PACKAGE__->config('Plugin::Authentication' => {
    default_realm => 'members',
    realms => {
        members => {
            credential => {
                class => 'Password',
                password_field => 'password',
                password_type => 'clear'
            },
            store => {
                class => 'Minimal',
                users => $members
            }
        },
        admins => {
            credential => {
                class => 'Password',
                password_field => 'password',
                password_type => 'clear'
            },
            store => {
                class => 'Minimal',
                users => $admins
            }
        }
    }
});

__PACKAGE__->setup;

1;