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   27 use strict;
  4         10  
  4         126  
4 4     4   25 use Carp;
  4         9  
  4         926  
5              
6 7     7 0 34 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 10 my $class = shift;
11 4         12 my ($passwd_href) = @_;
12              
13 4         12 my $self = bless {
14             passwd_href => $passwd_href,
15             };
16            
17 4         15 return $self;
18             }
19              
20             sub check_credentials {
21 7     7 0 15 my $self = shift;
22 7         26 my ($user, $pass) = @_;
23 7         25 return $pass eq $self->get_passwd_href->{$user};
24             }
25              
26             1;