blib/lib/Event/RPC/AuthPasswdHash.pm untested

filter: Statementstmt 0.0% 0 / 15 Branchbran n/a Conditioncond n/a MC/DCmcdc n/a Subroutinesub 0.0% 0 / 6 Podpod 0.0% 0 / 4 totaltotal 0.0% 0 / 25 CC 1 SCAR 6.9
CC
1
Cov
0%
get_passwd_href
2.0
set_passwd_href
2.0
new
2.0
CRAP 2.0
1 package Event::RPC::AuthPasswdHash;
2  
3 use strict;
4 use Carp;
5  
6 sub get_passwd_href { shift->{passwd_href} }
7 sub set_passwd_href { shift->{passwd_href} = $_[1] }
8  
9 sub new {
10 my $class = shift;
11 my ($passwd_href) = @_;
12  
13 my $self = bless {
14 passwd_href => $passwd_href,
15 };
16
17 return $self;
18 }
19  
20 sub check_credentials {
21 my $self = shift;
22 my ($user, $pass) = @_;
23 return $pass eq $self->get_passwd_href->{$user};
24 }
25  
26 1;