File Coverage

blib/lib/Event/RPC/AuthPasswdHash.pm
Criterion Covered Total %
statement 14 15 93.3
branch n/a
condition n/a
subroutine 5 6 83.3
pod 0 4 0.0
total 19 25 76.0


line stmt bran cond sub pod time code
1             package Event::RPC::AuthPasswdHash;
2              
3 4     4   31 use strict;
  4         11  
  4         187  
4 4     4   24 use Carp;
  4         10  
  4         947  
5              
6 7     7 0 54 sub get_passwd_href { shift->{passwd_href} }
7 0     0 0 0 sub set_passwd_href { shift->{passwd_href} = $_[1] }
8              
9             sub new {
10 4     4 0 12 my $class = shift;
11 4         17 my ($passwd_href) = @_;
12              
13 4         19 my $self = bless {
14             passwd_href => $passwd_href,
15             };
16            
17 4         16 return $self;
18             }
19              
20             sub check_credentials {
21 7     7 0 20 my $self = shift;
22 7         25 my ($user, $pass) = @_;
23 7         42 return $pass eq $self->get_passwd_href->{$user};
24             }
25              
26             1;