« blib/lib/Lemonldap/NG/Portal/Auth/WebAuthn.pm
↑ Summary
blib/lib/Lemonldap/NG/Portal/Auth/PAM.pm »
| 1 | # This module loads known enabled plugins. To add custom modules, just add them | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 2 | # into "plugins" list in lemonldap-ng.ini, section "portal" | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 3 | package Lemonldap::NG::Portal::Main::Plugins; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 4 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 5 | 454 | our $VERSION = '2.23.0'; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 6 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 7 | package Lemonldap::NG::Portal::Main; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 8 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 9 | 454 | ▶ | use strict; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 10 | 454 | ▶ | use Mouse; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 11 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 12 | # Plugins enabled by a simple boolean value (ordered list) | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 13 | # | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 14 | # Developers: 2FA must be loaded before Notifications | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 15 | # Developers: GlobalLogout must be the last loaded plugin | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 16 | # Developers: Notifications must be loaded before PublicNotifications | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 17 | 454 | our @pList = ( | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 18 | portalDisplayResetPassword => '::Plugins::MailPasswordReset', | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 19 | portalDisplayCertificateResetByMail => '::Plugins::CertificateResetByMail', | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 20 | cda => '::Plugins::CDA', | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 21 | notification => '::Plugins::Notifications', | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 22 | publicNotifications => '::Plugins::PublicNotifications', | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 23 | rememberAuthChoiceRule => '::Plugins::RememberAuthChoice', | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 24 | stayConnected => '::Plugins::StayConnected', | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 25 | portalCheckLogins => '::Plugins::History', | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 26 | bruteForceProtection => '::Plugins::BruteForceProtection', | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 27 | grantSessionRules => '::Plugins::GrantSession', | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 28 | upgradeSession => '::Plugins::Upgrade', | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 29 | autoSigninRules => '::Plugins::AutoSignin', | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 30 | checkState => '::Plugins::CheckState', | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 31 | webCronSecret => '::Plugins::WebCron', | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 32 | portalForceAuthn => '::Plugins::ForceAuthn', | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 33 | checkUser => '::Plugins::CheckUser', | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 34 | checkDevOps => '::Plugins::CheckDevOps', | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 35 | contextSwitchingRule => '::Plugins::ContextSwitching', | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 36 | decryptValueRule => '::Plugins::DecryptValue', | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 37 | findUser => '::Plugins::FindUser', | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 38 | newLocationWarning => '::Plugins::NewLocationWarning', | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 39 | passwordPolicyActivation => '::Plugins::BasePasswordPolicy', | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 40 | checkHIBP => '::Plugins::CheckHIBP', | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 41 | checkEntropy => '::Plugins::CheckEntropy', | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 42 | initializePasswordReset => '::Plugins::InitializePasswordReset', | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 43 | oidcOfflineTokens => '::Plugins::OIDC::OfflineTokens', | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 44 | oidcServiceAllowDynamicRegistration => | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 45 | '::Plugins::OIDC::DynamicRegistration', | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 46 | adaptativeAuthenticationLevelRules => | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 47 | '::Plugins::AdaptativeAuthenticationLevel', | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 48 | refreshSessions => '::Plugins::Refresh', | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 49 | externalMenu => '::Plugins::ExternalMenu', | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 50 | crowdsecAgent => '::Plugins::CrowdSecAgent', | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 51 | crowdsec => '::Plugins::CrowdSec', | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 52 | locationDetect => '::Plugins::LocationDetect', | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 53 | globalLogoutRule => '::Plugins::GlobalLogout', | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 54 | samlFederationFiles => '::Plugins::SamlFederation', | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 55 | adminLogoutServerSecret => '::Plugins::AdminLogout', | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 56 | 'or::oidcRPMetaDataOptions/*/oidcRPMetaDataOptionsAllowNativeSso' => | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 57 | '::Plugins::OIDC::NativeSso', | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 58 | 'or::oidcOPMetaDataOptions/*/oidcOPMetaDataOptionsRequirePkce' => | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 59 | '::Plugins::OIDC::AuthPkce', | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 60 | 'or::oidcRPMetaDataOptions/*/oidcRPMetaDataOptionsTokenXAuthorizedRP' => | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 61 | '::Plugins::OIDC::InternalTokenExchange', | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 62 | 'or::oidcRPMetaDataOptions/*/oidcRPMetaDataOptionsAllowPasswordGrant' => | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 63 | '::Plugins::OIDC::PasswordGrant', | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 64 | 'or::oidcRPMetaDataOptions/*/oidcRPMetaDataOptionsAllowClientCredentialsGrant' | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 65 | => '::Plugins::OIDC::ClientCredentialsGrant', | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 66 | ); | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 67 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 68 | ##@method list enabledPlugins | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 69 | # | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 70 | #@return list of enabled plugins | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 71 | # | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 72 | # List can be: | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 73 | # * a plugin name | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 74 | # * an array ref containing: | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 75 | # - the property into which the plugin has to be linked | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 76 | # - the plugin name | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 77 | # | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 78 | # If plugin name starts with '::', the prefix Lemonldap::NG::Portal will be | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 79 | # added | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 80 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 81 | 671 | ▶ | sub enabledServices { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Subroutine
enabledServices: called CC=8 SCAR=21.0
Pod
undocumented
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 82 | 671 | my ($self) = @_; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 83 | 671 | my $conf = $self->conf; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 84 | 671 | my @res; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 85 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 86 | # Second factor | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 87 | 671 | push @res, [ secondFactor => $self->conf->{'sfEngine'} ]; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 88 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 89 | # Portal menu | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 90 | 671 | push @res, [ menu => "::Main::Menu" ]; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 91 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 92 | # Trusted browser | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 93 | 671 | ▶ | if ( $self->conf->{trustedBrowserRule} or $self->conf->{stayConnected} ) { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
Condition100%3/3
$self->conf->{"trustedBrowserRule"} or $self->conf->{"stayConnected"}
MC/DC100%2/2
$self->conf->{"trustedBrowserRule"} or $self->conf->{"stayConnected"}
$self->conf->{"trustedBrowserRule"}
$self->conf->{"stayConnected"}
Truth table100%3/3
A or B
A= $self->conf->{"trustedBrowserRule"}B= $self->conf->{"stayConnected"}
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 94 | my $module = | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 95 | 8 | ▶ | $self->conf->{'trustedBrowserEngine'} || '::Plugins::TrustedBrowser'; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Condition50%1/2
$self->conf->{'trustedBrowserEngine'} || '::Plugins::TrustedBrowser'
MC/DC0%0/1
$self->conf->{'trustedBrowserEngine'} || '::Plugins::TrustedBrowser'
$self->conf->{'trustedBrowserEngine'}
Truth table50%1/2
A
A= $self->conf->{'trustedBrowserEngine'}
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 96 | 8 | $self->logger->debug("$module needed"); | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 97 | 8 | push @res, [ trustedBrowser => $module ]; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 98 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 99 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 100 | # Captcha | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 101 | 671 | ▶ | if ( $self->conf->{captcha_mail_enabled} | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
Condition66%4/6
$self->conf->{"captcha_mail_enabled"} or $self->conf->{"captcha_login_enabled"} or $self->conf->{"captcha_register_enabled"}
$self->conf->{"captcha_mail_enabled"} or $self->conf->{"captcha_login_enabled"}
MC/DC0%0/3
$self->conf->{"captcha_mail_enabled"} or $self->conf->{"captcha_login_enabled"} or $self->conf->{"captcha_register_enabled"}
$self->conf->{"captcha_mail_enabled"}
$self->conf->{"captcha_login_enabled"}
$self->conf->{"captcha_register_enabled"}
Truth table50%2/4
A or B or C
A= $self->conf->{"captcha_mail_enabled"}B= $self->conf->{"captcha_login_enabled"}C= $self->conf->{"captcha_register_enabled"}
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 102 | || $self->conf->{captcha_login_enabled} | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 103 | || $self->conf->{captcha_register_enabled} ) | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 104 | { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 105 | 671 | ▶ | my $module = $self->conf->{'captcha'} || '::Captcha::SecurityImage'; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Condition100%2/2
$self->conf->{'captcha'} || '::Captcha::SecurityImage'
MC/DC100%1/1
$self->conf->{'captcha'} || '::Captcha::SecurityImage'
$self->conf->{'captcha'}
Truth table100%2/2
A
A= $self->conf->{'captcha'}
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 106 | 671 | $self->logger->debug("$module needed"); | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 107 | 671 | push @res, [ captcha => $module ]; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 108 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 109 | 671 | return @res; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 110 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 111 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 112 | 331 | ▶ | sub enabledPlugins { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Subroutine
enabledPlugins: called CC=19 SCAR=30.1
Pod
undocumented
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 113 | 331 | my ($self) = @_; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 114 | 331 | my $conf = $self->conf; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 115 | 331 | my @res; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 116 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 117 | # Search for Issuer* modules enabled | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 118 | 331 | foreach my $key (qw(SAML OpenID CAS OpenIDConnect Get JitsiMeetTokens)) { | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 119 | 1986 | ▶ | if ( $conf->{"issuerDB${key}Activation"} ) { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 120 | 112 | $self->logger->debug("Issuer${key} enabled"); | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 121 | 112 | push @res, "::Issuer::$key"; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 122 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 123 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 124 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 125 | # Load single session | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 126 | push @res, '::Plugins::SingleSession' | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 127 | if ( $conf->{singleSession} | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 128 | or $conf->{singleIP} | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 129 | or $conf->{singleUserByIP} | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 130 | 331 | ▶ | or $conf->{notifyOther} ); | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
Condition88%8/9
$conf->{"singleSession"} or $conf->{"singleIP"} or $conf->{"singleUserByIP"} or $conf->{"notifyOther"}
$conf->{"singleSession"} or $conf->{"singleIP"} or $conf->{"singleUserByIP"}
$conf->{"singleSession"} or $conf->{"singleIP"}
MC/DC75%3/4
$conf->{"singleSession"} or $conf->{"singleIP"} or $conf->{"singleUserByIP"} or $conf->{"notifyOther"}
$conf->{"singleSession"}
$conf->{"singleIP"}
$conf->{"singleUserByIP"}
$conf->{"notifyOther"}
Truth table80%4/5
A or B or C or D
A= $conf->{"singleSession"}B= $conf->{"singleIP"}C= $conf->{"singleUserByIP"}D= $conf->{"notifyOther"}
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 131 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 132 | # Load static plugin list | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 133 | 331 | ▶ | for ( my $i = 0 ; $i < @pList ; $i += 2 ) { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 134 | 13571 | my $pluginConf; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 135 | 13571 | ▶ | if ( $pList[$i] =~ /^(.*?)::(.*)$/ ) { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 136 | 1655 | $pluginConf = checkConf( $conf, $2, $1 ); | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 137 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 138 | else { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 139 | 11916 | my $c = $conf->{ $pList[$i] }; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 140 | 11916 | ▶ | $pluginConf = ( ref($c) && ref($c) eq 'HASH' ? scalar(%$c) : $c ); | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
Condition66%2/3
ref $c and ref $c eq "HASH"
MC/DC50%1/2
ref $c and ref $c eq "HASH"
ref $c
ref $c eq "HASH"
Truth table66%2/3
A and B
A= ref $cB= ref $c eq "HASH"
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 141 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 142 | 13571 | ▶ | push @res, $pList[ $i + 1 ] if $pluginConf; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 143 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 144 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 145 | # Check if SOAP is enabled | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 146 | push @res, '::Plugins::SOAPServer' | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 147 | if ( $conf->{soapSessionServer} | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 148 | 331 | ▶ | or $conf->{soapConfigServer} ); | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
Condition33%1/3
$conf->{"soapSessionServer"} or $conf->{"soapConfigServer"}
MC/DC0%0/2
$conf->{"soapSessionServer"} or $conf->{"soapConfigServer"}
$conf->{"soapSessionServer"}
$conf->{"soapConfigServer"}
Truth table33%1/3
A or B
A= $conf->{"soapSessionServer"}B= $conf->{"soapConfigServer"}
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 149 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 150 | # Add REST (check is done by plugin itself) | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 151 | 331 | push @res, '::Plugins::RESTServer'; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 152 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 153 | # Check if password is enabled | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 154 | 331 | ▶ | if ( my $p = $conf->{passwordDB} ) { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 155 | 331 | push @res, "::Password::$p"; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 156 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 157 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 158 | # Check if register is enabled | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 159 | push @res, '::Plugins::Register' | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 160 | 331 | ▶ | if ( $conf->{registerDB} and $conf->{registerDB} ne 'Null' ); | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
Condition33%1/3
$conf->{"registerDB"} and $conf->{"registerDB"} ne "Null"
MC/DC0%0/2
$conf->{"registerDB"} and $conf->{"registerDB"} ne "Null"
$conf->{"registerDB"}
$conf->{"registerDB"} ne "Null"
Truth table33%1/3
A and B
A= $conf->{"registerDB"}B= $conf->{"registerDB"} ne "Null"
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 161 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 162 | # Check if custom plugins are required | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 163 | 331 | ▶ | if ( $conf->{customPlugins} ) { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 164 | 15 | $self->logger->debug( 'Custom plugins: ' . $conf->{customPlugins} ); | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 165 | 15 | push @res, grep ( /\w+/, split( /[,\s]+/, $conf->{customPlugins} ) ); | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 166 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 167 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 168 | # Impersonation overwrites req->step and pops 'afterData' EP. | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 169 | # Static and custom 'afterData' plugins will be never launched | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 170 | # if they are loaded after Impersonation. | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 171 | # This plugin must be the last 'afterData' loaded plugin. Fix #2655 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 172 | push @res, '::Plugins::Impersonation' | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 173 | 331 | ▶ | if $conf->{impersonationRule}; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 174 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 175 | 331 | return @res; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 176 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 177 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 178 | 3619 | ▶ | sub checkConf { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Subroutine
checkConf: called CC=7 SCAR=19.5
Pod
undocumented
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 179 | 3619 | my ( $conf, $path, $type ) = @_; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 180 | 3619 | ▶ | if ( $path =~ s#^(.*?)/## ) { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 181 | 3310 | my $w = $1; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 182 | 3310 | ▶ | if ( $w eq '*' ) { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 183 | 1655 | my @res; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 184 | 1655 | ▶ | foreach my $k ( keys %{ $conf || {} } ) { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Condition100%2/2
$conf || {}
MC/DC100%1/1
$conf || {}
$conf
Truth table100%2/2
A
A= $conf
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 185 | 309 | push @res, checkConf( $conf->{$k}, $path, $type ); | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 186 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 187 | 1655 | ▶ | if ( $type eq 'or' ) { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 188 | 1655 | my $res = 0; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 189 | 1655 | ▶ | map { $res ||= $_ } @res; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Condition100%3/3
$res ||= $_
MC/DC100%2/2
$res ||= $_
$res
$_
Truth table100%3/3
A ||= B
A= $resB= $_
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 190 | 1655 | return $res; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 191 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 192 | 0 | else { die "Unkown type $type"; } | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 193 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 194 | else { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 195 | 1655 | return checkConf( $conf->{$w}, $path, $type ); | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 196 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 197 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 198 | else { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 199 | 309 | return $conf->{$path}; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 200 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 201 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 202 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 203 | 454 | 1; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||