File Coverage

blib/lib/Ark/Plugin/Authentication.pm
Criterion Covered Total %
statement 12 12 100.0
branch n/a
condition n/a
subroutine 4 4 100.0
pod n/a
total 16 16 100.0


line stmt bran cond sub pod time code
1             package Ark::Plugin::Authentication;
2 4     4   81250 use 5.008001;
  4         14  
  4         146  
3 4     4   20 use strict;
  4         8  
  4         108  
4 4     4   20 use warnings;
  4         16  
  4         207  
5              
6             our $VERSION = 0.01;
7              
8 4     4   791 use Ark::Plugin;
  4         33136  
  4         30  
9              
10             has auth => (
11             is => 'rw',
12             isa => 'Ark::Plugin::Authentication::Backend',
13             lazy => 1,
14             default => sub {
15             my $self = shift;
16              
17             my $conf = $self->app->config->{'Plugin::Authentication'} || {};
18              
19             $self->app->ensure_class_loaded('Ark::Plugin::Authentication::Backend');
20             my $class = $self->app->class_wrapper(
21             name => 'Auth',
22             base => 'Ark::Plugin::Authentication::Backend',
23             );
24              
25             $class->new(
26             app => $self->app,
27             %$conf,
28             );
29             },
30             handles => [qw/user authenticate logout/],
31             );
32              
33             1;
34             __END__