CoreCAS.pm untested

filter: Statementstmt 0.0% 0 / 39 Branchbran 0.0% 0 / 4 Conditioncond n/a MC/DCmcdc n/a Subroutinesub 0.0% 0 / 6 Podpod 0.0% 0 / 3 totaltotal 0.0% 0 / 52 CC 3 SCAR 13.9
CC
3
Cov
0%
get
6.0
get
6.0
locationRules
2.0
CRAP 4.0
1 package Lemonldap::Handlers::CoreCAS;
2 use strict;
3  
4 #A retirer en prod
5 use Data::Dumper;
6 our ( @ISA, $VERSION, @EXPORTS );
7 $VERSION = '3.1.0';
8 our $VERSION_LEMONLDAP = "3.1.0";
9 our $VERSION_INTERNAL = "3.1.0";
10  
11 sub locationRules {
12 my %param = @_;
13  
14 # first retrieve session
15 my $id = $param{'id'};
16 my $config = $param{'config'};
17 my $uri = $param{'uri'};
18 my $host = $param{'host'};
19 my $target = $param{'target'};
20 my $_session = $param{'session'};
21  
22 #my $_session = Lemonldap::Handlers::Session->get ('id' => $id ,
23 # 'config' => $config)# ;
24  
25 #if (keys(%{$_session}) == 0){
26 #return 0;
27 #}
28  
29 my $_trust = Lemonldap::Handlers::Policy->get(
30 'session' => $_session,
31 'parameters' => \%param
32 );
33 my $result = $_trust->{profil};
34 my $response = $_trust->{response};
35 my $h = {
36 dn => $_session->{dn},
37 uid => $_session->{uid},
38 string => $_trust->{profil},
39 response => $_trust->{response},
40 clientIPAdress => $_session->{clientIPAdress},
41 SessExpTime => $_session->{SessExpTime}
42 };
43  
44 return $h;
45 }
46  
47 package Lemonldap::Handlers::Session;
48 use Data::Dumper;
49  
50 sub get {
51 my $class = shift;
52 my %_param = @_;
53 $_param{config}->{'SESSIONSTOREPLUGIN'} = 'Lemonldap::Handlers::Memsession'
54 unless $_param{config}->{'SESSIONSTOREPLUGIN'};
55 my $api = $_param{config}->{'SESSIONSTOREPLUGIN'};
56 eval "use $api;";
57 my $html = $api->get(%_param);
58  
59 # bless $session, $class;
60  
61 return $html;
62 }
63  
64 package Lemonldap::Handlers::Policy;
65  
66 sub get {
67 my $class = shift;
68 my %_param = @_;
69 $_param{parameters}->{config}->{'PLUGINPOLICY'} =
70 'Lemonldap::Handlers::MatrixPolicy'
71 unless $_param{parameters}->{config}->{'PLUGINPOLICY'};
72 my $api = $_param{parameters}->{config}->{'PLUGINPOLICY'};
73 eval "use $api;";
74 my $trust = $api->get(%_param);
75  
76 # bless $trust , $class;
77 return $trust;
78 }
79  
80 1;