File Coverage

lib/File/UnixAuth.pm
Criterion Covered Total %
statement 20 20 100.0
branch n/a
condition n/a
subroutine 7 7 100.0
pod n/a
total 27 27 100.0


line stmt bran cond sub pod time code
1             package File::UnixAuth;
2              
3 1     1   806 use 5.010001;
  1         4  
4 1     1   6 use namespace::autoclean;
  1         1  
  1         11  
5 1     1   70 use version; our $VERSION = qv( sprintf '0.25.%d', q$Rev: 1 $ =~ /\d+/gmx );
  1         2  
  1         7  
6              
7 1     1   104 use File::DataClass::Constants qw( NUL TRUE );
  1         2  
  1         62  
8 1     1   779 use File::DataClass::Types qw( CodeRef Maybe Str );
  1         35523  
  1         14  
9 1     1   1946 use File::UnixAuth::Result;
  1         2  
  1         28  
10 1     1   6 use Moo;
  1         2  
  1         4  
11              
12             extends q(File::DataClass::Schema);
13              
14             has 'post_update_hook' => is => 'ro', isa => Maybe[CodeRef];
15              
16             has '+result_source_attributes' =>
17             default => sub { {
18             group => {
19             attributes => [ qw( password gid members ) ],
20             defaults => { password => 'x' },
21             resultset_attributes => {
22             result_class => 'File::UnixAuth::Result', }, },
23             passwd => {
24             attributes => [ qw( password id pgid gecos homedir shell
25             first_name last_name location work_phone
26             home_phone ) ],
27             defaults => { password => 'x' }, },
28             shadow => {
29             attributes => [ qw( password pwlast pwnext pwafter
30             pwwarn pwexpires pwdisable reserved ) ],
31             defaults => { password => '*', pwlast => 0,
32             pwnext => 0, pwafter => 99_999,
33             pwwarn => 7, pwexpires => 90,
34             reserved => NUL }, }, } };
35              
36             has '+storage_attributes' => default => sub { { backup => '.bak', } };
37              
38             has '+storage_class' => default => '+File::UnixAuth::Storage';
39              
40             has 'source_name' => is => 'ro', isa => Str, required => TRUE;
41              
42             around 'source' => sub {
43             my ($orig, $self) = @_; return $self->$orig( $self->source_name );
44             };
45              
46             around 'resultset' => sub {
47             my ($orig, $self) = @_; return $self->$orig( $self->source_name );
48             };
49              
50             1;
51              
52             __END__