blib/lib/Lemonldap/NG/Portal/Auth/Slave.pm

filter: Statementstmt 88.8% 32 / 36 Branchbran 60.0% 6 / 10 Conditioncond 33.3% 1 / 3 MC/DCmcdc 0.0% 0 / 2 Subroutinesub 88.8% 8 / 9 Podpod 0.0% 0 / 6 totaltotal 71.2% 47 / 66 CC 7 SCAR 12.6
CC
7
Cov
80%
extractFormInfo
6.8
getDisplayType
2.1
authLogout
2.0
CRAP 3.5
« blib/lib/Lemonldap/NG/Portal/CertificateResetByMail/Custom.pm ↑ Summary blib/lib/Lemonldap/NG/Portal/Lib/OtherSessions.pm »
1 package Lemonldap::NG::Portal::Auth::Slave;
2  
3 5 ▶use strict;
Subroutine BEGIN: called CC=1 SCAR=0.0
4 5 ▶use Mouse;
Subroutine BEGIN: called CC=1 SCAR=0.0
5  
6 # Add constants used by this module
7 5 use Lemonldap::NG::Portal::Main::Constants qw(
8 PE_OK
9 PE_FORBIDDENIP
10 PE_USERNOTFOUND
11 PE_MALFORMEDUSER
12 5 ▶);
Subroutine BEGIN: called CC=1 SCAR=0.0
13  
14 5 our $VERSION = '2.17.0';
15  
16 5 extends qw(
17 Lemonldap::NG::Portal::Main::Auth
18 Lemonldap::NG::Portal::Lib::Slave
19 );
20  
21 # INITIALIZATION
22  
23 11 ▶sub init { 1 }
Subroutine init: called CC=1 SCAR=0.0
Pod undocumented
24  
25 # RUNNING METHODS
26  
27 sub extractFormInfo {
28 2 ▶ my ( $self, $req ) = @_;
Subroutine extractFormInfo: called CC=6 SCAR=19.2
Pod undocumented
29 2 ▶ return PE_FORBIDDENIP
Branch: 1 branch
BranchTrueFalseTotal
unless $self->checkIP($req) and $self->checkHeader($req) 0 2 2
Condition33%1/3
$self->checkIP($req) and $self->checkHeader($req)
!ll&&!rl&&r
002
MC/DC0%0/2
$self->checkIP($req) and $self->checkHeader($req)
$self->checkIP($req) $self->checkHeader($req)
Truth table33%1/3
A and B
A= $self->checkIP($req)B= $self->checkHeader($req)
ABresult
0X0
100
111
30 unless ( $self->checkIP($req) and $self->checkHeader($req) );
31  
32 2 ▶ unless ( $self->conf->{slaveUserHeader} ) {
Branch: 1 branch
BranchTrueFalseTotal
unless ($self->conf->{"slaveUserHeader"}) 0 2 2
33 0 $self->logger->debug('slaveUserHeader is undefined');
34 0 return PE_USERNOTFOUND;
35 }
36  
37 2 my $user_header = $self->conf->{slaveUserHeader};
38 2 $user_header = 'HTTP_' . uc($user_header);
39 2 $user_header =~ s/\-/_/g;
40  
41 2 ▶ unless ( $req->env->{$user_header} ) {
Branch: 1 branch
BranchTrueFalseTotal
unless ($req->env->{$user_header}) 1 1 2
42 $self->userLogger->error(
43 1 "No header " . $self->conf->{slaveUserHeader} . " found" );
44 1 return PE_USERNOTFOUND;
45 }
46  
47 return PE_MALFORMEDUSER
48 1 ▶ unless ( $req->env->{$user_header} =~ /$self->{conf}->{userControl}/ );
Branch: 1 branch
BranchTrueFalseTotal
unless $req->env->{$user_header} =~ /$self->{"conf"}{"userControl"}/ 0 1 1
49  
50 1 $req->{user} = $req->env->{$user_header};
51 1 return PE_OK;
52 }
53  
54 sub authenticate {
55 1 ▶ my ( $self, $req ) = @_;
Subroutine authenticate: called CC=1 SCAR=0.0
Pod undocumented
56 1 return PE_OK;
57 }
58  
59 sub setAuthSessionInfo {
60 1 ▶ my ( $self, $req ) = @_;
Subroutine setAuthSessionInfo: called CC=1 SCAR=0.0
Pod undocumented
61 1 $req->{sessionInfo}->{authenticationLevel} = $self->conf->{slaveAuthnLevel};
62 1 return PE_OK;
63 }
64  
65 sub getDisplayType {
66 2 ▶ my ($self) = @_;
Subroutine getDisplayType: called CC=2 SCAR=7.2
Pod undocumented
67 2 ▶ return ( $self->{conf}->{slaveDisplayLogo} ? "logo" : "_none_" );
Branch: 1 branch
BranchTrueFalseTotal
$self->{'conf'}{'slaveDisplayLogo'} ? : 2 0 2
68 }
69  
70 sub authLogout {
71 0 ▶ my ( $self, $req ) = @_;
Subroutine authLogout: not called CC=1 SCAR=6.9
Pod undocumented
72 0 return PE_OK;
73 }
74  
75 5 1;
« blib/lib/Lemonldap/NG/Portal/CertificateResetByMail/Custom.pm ↑ Summary blib/lib/Lemonldap/NG/Portal/Lib/OtherSessions.pm »