blib/lib/Lemonldap/NG/Portal/UserDB/OpenID.pm

filter: Statementstmt 40.0% 12 / 30 Branchbran 0.0% 0 / 6 Conditioncond 0.0% 0 / 3 MC/DCmcdc 0.0% 0 / 2 Subroutinesub 42.8% 3 / 7 Podpod 0.0% 0 / 4 totaltotal 28.8% 15 / 52 CC 5 SCAR 26.7
CC
5
Cov
31%
setSessionInfo
30.0
init
2.0
getUser
2.0
CRAP 14.5
« blib/lib/Lemonldap/NG/Portal/Main/Run.pm ↑ Summary blib/lib/Lemonldap/NG/Portal/Auth/WebAuthn.pm »
1 package Lemonldap::NG::Portal::UserDB::OpenID;
2  
3 1 ▶use strict;
Subroutine BEGIN: called CC=1 SCAR=0.0
4 1 ▶use Mouse;
Subroutine BEGIN: called CC=1 SCAR=0.0
5 1 ▶use Lemonldap::NG::Portal::Main::Constants qw(
Subroutine BEGIN: called CC=1 SCAR=0.0
6 PE_OK
7 PE_MISSINGREQATTR
8 1 );
9  
10 1 our $VERSION = '2.19.0';
11  
12 1 extends qw(
13 Lemonldap::NG::Portal::Main::UserDB
14 Lemonldap::NG::Portal::Lib::OpenIDConnect
15 );
16  
17 # INITIALIZATION
18  
19 0 ▶sub init {
Subroutine init: not called CC=1 SCAR=6.9
Pod undocumented
20 0 return 1;
21 }
22  
23 # RUNNING METHODS
24  
25 0 ▶sub getUser {
Subroutine getUser: not called CC=1 SCAR=6.9
Pod undocumented
26 0 return PE_OK;
27 }
28  
29 0 ▶sub findUser {
Subroutine findUser: not called CC=1 SCAR=6.9
Pod undocumented
30 0 return PE_OK;
31 }
32  
33 0 ▶sub setSessionInfo {
Subroutine setSessionInfo: not called CC=5 SCAR=34.0
Pod undocumented
34 0 my ( $self, $req ) = @_;
35 my %vars = (
36 0 %{ $self->conf->{exportedVars} },
37 0 %{ $self->conf->{openIdExportedVars} }
38 );
39 0 ▶ while ( my ( $k, $v ) = each %vars ) {
Branch: 1 branch
BranchTrueFalseTotal
if (() = each %vars) 0 0 0
40 0 my $attr = $k;
41 0 my $required = ( $attr =~ s/^!// );
42 0 ▶ if ( $v =~ Lemonldap::NG::Common::Regexp::OPENIDSREGATTR() ) {
Branch: 1 branch
BranchTrueFalseTotal
if ($v =~ Lemonldap::NG::Common::Regexp::OPENIDSREGATTR()) { } 0 0 0
43 0 my $p = $req->param("openid.sreg.$v");
44 0 ▶ if ( $required and not defined $p ) {
Branch: 1 branch
BranchTrueFalseTotal
if ($required and not defined $p) 0 0 0
Condition0%0/3
$required and not defined $p
!ll&&!rl&&r
000
MC/DC0%0/2
$required and not defined $p
$required not defined $p
Truth table0%0/3
A and not(B)
A= $requiredB= not defined $p
ABresult
0X0
100
111
45 0 $self->userLogger->warn(
46 "Required parameter $attr is not provided by OpenID server, aborted"
47 );
48 0 return PE_MISSINGREQATTR;
49 }
50 0 $req->{sessionInfo}->{$attr} = $p;
51 }
52 else {
53 0 $self->userLogger->warn(
54 "Ignoring attribute $v which is not a valid OpenID SREG attribute"
55 );
56 }
57 }
58  
59 0 return PE_OK;
60 }
61  
62 1 1;
« blib/lib/Lemonldap/NG/Portal/Main/Run.pm ↑ Summary blib/lib/Lemonldap/NG/Portal/Auth/WebAuthn.pm »