From 7f7d06864677b77c8d6f52a9fc8962fba67c1e28 Mon Sep 17 00:00:00 2001 From: Xavier Guimard Date: Tue, 5 Jun 2018 23:13:18 +0200 Subject: [PATCH] Don't reload portal if conf is already loaded --- .../lib/Lemonldap/NG/Handler/Main/Reload.pm | 21 ++++++++++--------- .../Lemonldap/NG/Portal/Plugins/SOAPServer.pm | 5 ++++- lemonldap-ng-portal/t/24-AuthKerberos.t | 1 + lemonldap-ng-portal/t/29-AuthSSL.t | 1 + ...AML-Artifact-with-SOAP-SLO-IdP-initiated.t | 1 + ...h-and-issuer-SAML-Artifact-with-SOAP-SLO.t | 1 + ...-Auth-and-issuer-SAML-POST-IdP-initiated.t | 1 + .../t/30-Auth-and-issuer-SAML-POST.t | 1 + ...h-and-issuer-SAML-Redirect-IdP-initiated.t | 1 + .../t/30-Auth-and-issuer-SAML-Redirect.t | 1 + .../t/30-SAML-ReAuth-with-choice.t | 1 + lemonldap-ng-portal/t/30-SAML-ReAuth.t | 1 + lemonldap-ng-portal/t/30-SAML-SP-rule.t | 1 + .../t/31-Auth-and-issuer-CAS-declared-app.t | 1 + .../t/31-Auth-and-issuer-CAS-default.t | 1 + .../t/31-Auth-and-issuer-CAS-proxied.t | 1 + .../t/31-Auth-and-issuer-CAS-with-choice.t | 1 + ...issuer-OIDC-authorization_code-OP-logout.t | 1 + ...-OIDC-authorization_code-with-authchoice.t | 1 + ...-Auth-and-issuer-OIDC-authorization_code.t | 1 + .../t/32-Auth-and-issuer-OIDC-hybrid.t | 1 + .../t/32-Auth-and-issuer-OIDC-implicit.t | 1 + lemonldap-ng-portal/t/32-OIDC-RP-rule.t | 1 + .../t/33-Auth-and-issuer-OpenID2.t | 1 + .../t/34-Auth-Proxy-and-REST-Server.t | 1 + .../t/34-Auth-Proxy-and-SOAP-Server.t | 1 + .../t/35-REST-config-backend.t | 1 + .../t/35-REST-sessions-with-REST-server.t | 1 + .../t/35-SOAP-config-backend.t | 1 + .../t/35-SOAP-sessions-with-SOAP-server.t | 1 + .../t/36-Combination-with-token.t | 1 + lemonldap-ng-portal/t/36-Combination.t | 1 + .../t/37-Logout-from-OIDC-RP-to-SAML-SP.t | 2 ++ .../t/37-OIDC-RP-to-SAML-IdP-GET.t | 2 ++ .../t/37-OIDC-RP-to-SAML-IdP-POST.t | 2 ++ .../t/37-SAML-SP-GET-to-OIDC-OP.t | 2 ++ .../t/37-SAML-SP-POST-to-OIDC-OP.t | 2 ++ lemonldap-ng-portal/t/61-GrantSession.t | 1 + 38 files changed, 56 insertions(+), 11 deletions(-) diff --git a/lemonldap-ng-handler/lib/Lemonldap/NG/Handler/Main/Reload.pm b/lemonldap-ng-handler/lib/Lemonldap/NG/Handler/Main/Reload.pm index 09e9ebbf4..aa4ec7113 100644 --- a/lemonldap-ng-handler/lib/Lemonldap/NG/Handler/Main/Reload.pm +++ b/lemonldap-ng-handler/lib/Lemonldap/NG/Handler/Main/Reload.pm @@ -62,19 +62,20 @@ sub checkConf { return 0; } $class->configReload($conf); - } - $class->logger->debug("$class: configuration is up to date"); - foreach (@_onReload) { - my ( $obj, $sub ) = @$_; - if ($obj) { - $class->logger->debug( 'Launching ' . ref($obj) . "->$sub(conf)" ); - unless ( $obj->$sub($conf) ) { - $class->logger->error( "Underlying object can't load conf (" - . ref($obj) - . "->$sub)" ); + foreach (@_onReload) { + my ( $obj, $sub ) = @$_; + if ($obj) { + $class->logger->debug( + 'Launching ' . ref($obj) . "->$sub(conf)" ); + unless ( $obj->$sub($conf) ) { + $class->logger->error( "Underlying object can't load conf (" + . ref($obj) + . "->$sub)" ); + } } } } + $class->logger->debug("$class: configuration is up to date"); return 1; } diff --git a/lemonldap-ng-portal/lib/Lemonldap/NG/Portal/Plugins/SOAPServer.pm b/lemonldap-ng-portal/lib/Lemonldap/NG/Portal/Plugins/SOAPServer.pm index 738e6ca3e..6a908f6d2 100644 --- a/lemonldap-ng-portal/lib/Lemonldap/NG/Portal/Plugins/SOAPServer.pm +++ b/lemonldap-ng-portal/lib/Lemonldap/NG/Portal/Plugins/SOAPServer.pm @@ -241,7 +241,10 @@ sub getAttributes { attributes => _buildSoapHash( $session->data, ( - $session->{_session_kind} eq 'SSO' + ( + $session->{_session_kind} + and $session->{_session_kind} eq 'SSO' + ) ? ( @{ $self->exportedAttr } ) : () ) diff --git a/lemonldap-ng-portal/t/24-AuthKerberos.t b/lemonldap-ng-portal/t/24-AuthKerberos.t index f993813ab..08a0c9131 100644 --- a/lemonldap-ng-portal/t/24-AuthKerberos.t +++ b/lemonldap-ng-portal/t/24-AuthKerberos.t @@ -31,6 +31,7 @@ SKIP: { ok( getHeader( $res, 'WWW-Authenticate' ) eq 'Negotiate', 'Get negotiate header' ) or explain( $res->[1], 'WWW-Authenticate => Negotiate' ); + &Lemonldap::NG::Handler::Main::cfgNum( 0, 0 ); $client = LLNG::Manager::Test->new( { ini => { diff --git a/lemonldap-ng-portal/t/29-AuthSSL.t b/lemonldap-ng-portal/t/29-AuthSSL.t index dd928ae28..c7a13e96f 100644 --- a/lemonldap-ng-portal/t/29-AuthSSL.t +++ b/lemonldap-ng-portal/t/29-AuthSSL.t @@ -27,6 +27,7 @@ expectOK($res); expectCookie($res); count(1); +&Lemonldap::NG::Handler::Main::cfgNum( 0, 0 ); $client = LLNG::Manager::Test->new( { ini => { diff --git a/lemonldap-ng-portal/t/30-Auth-and-issuer-SAML-Artifact-with-SOAP-SLO-IdP-initiated.t b/lemonldap-ng-portal/t/30-Auth-and-issuer-SAML-Artifact-with-SOAP-SLO-IdP-initiated.t index f95469686..28220304c 100644 --- a/lemonldap-ng-portal/t/30-Auth-and-issuer-SAML-Artifact-with-SOAP-SLO-IdP-initiated.t +++ b/lemonldap-ng-portal/t/30-Auth-and-issuer-SAML-Artifact-with-SOAP-SLO-IdP-initiated.t @@ -52,6 +52,7 @@ SKIP: { ok( $issuer = issuer(), 'Issuer portal' ); $handlerOR{issuer} = \@Lemonldap::NG::Handler::Main::_onReload; switch ('sp'); + &Lemonldap::NG::Handler::Main::cfgNum(0,0); ok( $sp = sp(), 'SP portal' ); $handlerOR{sp} = \@Lemonldap::NG::Handler::Main::_onReload; diff --git a/lemonldap-ng-portal/t/30-Auth-and-issuer-SAML-Artifact-with-SOAP-SLO.t b/lemonldap-ng-portal/t/30-Auth-and-issuer-SAML-Artifact-with-SOAP-SLO.t index e922af640..b9cfb1d5c 100644 --- a/lemonldap-ng-portal/t/30-Auth-and-issuer-SAML-Artifact-with-SOAP-SLO.t +++ b/lemonldap-ng-portal/t/30-Auth-and-issuer-SAML-Artifact-with-SOAP-SLO.t @@ -51,6 +51,7 @@ SKIP: { ok( $issuer = issuer(), 'Issuer portal' ); $handlerOR{issuer} = \@Lemonldap::NG::Handler::Main::_onReload; switch ('sp'); + &Lemonldap::NG::Handler::Main::cfgNum(0,0); ok( $sp = sp(), 'SP portal' ); $handlerOR{sp} = \@Lemonldap::NG::Handler::Main::_onReload; diff --git a/lemonldap-ng-portal/t/30-Auth-and-issuer-SAML-POST-IdP-initiated.t b/lemonldap-ng-portal/t/30-Auth-and-issuer-SAML-POST-IdP-initiated.t index adf44ca1e..8c577c7e1 100644 --- a/lemonldap-ng-portal/t/30-Auth-and-issuer-SAML-POST-IdP-initiated.t +++ b/lemonldap-ng-portal/t/30-Auth-and-issuer-SAML-POST-IdP-initiated.t @@ -35,6 +35,7 @@ SKIP: { ok( $issuer = issuer(), 'Issuer portal' ); $handlerOR{issuer} = \@Lemonldap::NG::Handler::Main::_onReload; switch ('sp'); + &Lemonldap::NG::Handler::Main::cfgNum(0,0); ok( $sp = sp(), 'SP portal' ); $handlerOR{sp} = \@Lemonldap::NG::Handler::Main::_onReload; diff --git a/lemonldap-ng-portal/t/30-Auth-and-issuer-SAML-POST.t b/lemonldap-ng-portal/t/30-Auth-and-issuer-SAML-POST.t index ba0af74cf..0d54ed81f 100644 --- a/lemonldap-ng-portal/t/30-Auth-and-issuer-SAML-POST.t +++ b/lemonldap-ng-portal/t/30-Auth-and-issuer-SAML-POST.t @@ -35,6 +35,7 @@ SKIP: { ok( $issuer = issuer(), 'Issuer portal' ); $handlerOR{issuer} = \@Lemonldap::NG::Handler::Main::_onReload; switch ('sp'); + &Lemonldap::NG::Handler::Main::cfgNum(0,0); ok( $sp = sp(), 'SP portal' ); $handlerOR{sp} = \@Lemonldap::NG::Handler::Main::_onReload; diff --git a/lemonldap-ng-portal/t/30-Auth-and-issuer-SAML-Redirect-IdP-initiated.t b/lemonldap-ng-portal/t/30-Auth-and-issuer-SAML-Redirect-IdP-initiated.t index 638f7a7d2..239b7bf8a 100644 --- a/lemonldap-ng-portal/t/30-Auth-and-issuer-SAML-Redirect-IdP-initiated.t +++ b/lemonldap-ng-portal/t/30-Auth-and-issuer-SAML-Redirect-IdP-initiated.t @@ -35,6 +35,7 @@ SKIP: { ok( $issuer = issuer(), 'Issuer portal' ); $handlerOR{issuer} = \@Lemonldap::NG::Handler::Main::_onReload; switch ('sp'); + &Lemonldap::NG::Handler::Main::cfgNum(0,0); ok( $sp = sp(), 'SP portal' ); $handlerOR{sp} = \@Lemonldap::NG::Handler::Main::_onReload; diff --git a/lemonldap-ng-portal/t/30-Auth-and-issuer-SAML-Redirect.t b/lemonldap-ng-portal/t/30-Auth-and-issuer-SAML-Redirect.t index a2f033343..0cdd45ba5 100644 --- a/lemonldap-ng-portal/t/30-Auth-and-issuer-SAML-Redirect.t +++ b/lemonldap-ng-portal/t/30-Auth-and-issuer-SAML-Redirect.t @@ -35,6 +35,7 @@ SKIP: { ok( $issuer = issuer(), 'Issuer portal' ); $handlerOR{issuer} = \@Lemonldap::NG::Handler::Main::_onReload; switch ('sp'); + &Lemonldap::NG::Handler::Main::cfgNum(0,0); ok( $sp = sp(), 'SP portal' ); $handlerOR{sp} = \@Lemonldap::NG::Handler::Main::_onReload; diff --git a/lemonldap-ng-portal/t/30-SAML-ReAuth-with-choice.t b/lemonldap-ng-portal/t/30-SAML-ReAuth-with-choice.t index 0e1a81518..433dbf711 100644 --- a/lemonldap-ng-portal/t/30-SAML-ReAuth-with-choice.t +++ b/lemonldap-ng-portal/t/30-SAML-ReAuth-with-choice.t @@ -47,6 +47,7 @@ SKIP: { ok( $issuer = issuer(), 'Issuer portal' ); $handlerOR{issuer} = \@Lemonldap::NG::Handler::Main::_onReload; switch ('sp'); + &Lemonldap::NG::Handler::Main::cfgNum(0,0); ok( $sp = sp(), 'SP portal' ); $handlerOR{sp} = \@Lemonldap::NG::Handler::Main::_onReload; diff --git a/lemonldap-ng-portal/t/30-SAML-ReAuth.t b/lemonldap-ng-portal/t/30-SAML-ReAuth.t index 65da39434..d8c8e5c77 100644 --- a/lemonldap-ng-portal/t/30-SAML-ReAuth.t +++ b/lemonldap-ng-portal/t/30-SAML-ReAuth.t @@ -35,6 +35,7 @@ SKIP: { ok( $issuer = issuer(), 'Issuer portal' ); $handlerOR{issuer} = \@Lemonldap::NG::Handler::Main::_onReload; switch ('sp'); + &Lemonldap::NG::Handler::Main::cfgNum(0,0); ok( $sp = sp(), 'SP portal' ); $handlerOR{sp} = \@Lemonldap::NG::Handler::Main::_onReload; diff --git a/lemonldap-ng-portal/t/30-SAML-SP-rule.t b/lemonldap-ng-portal/t/30-SAML-SP-rule.t index 64f0ae169..a17e3d2c4 100644 --- a/lemonldap-ng-portal/t/30-SAML-SP-rule.t +++ b/lemonldap-ng-portal/t/30-SAML-SP-rule.t @@ -35,6 +35,7 @@ SKIP: { ok( $issuer = issuer(), 'Issuer portal' ); $handlerOR{issuer} = \@Lemonldap::NG::Handler::Main::_onReload; switch ('sp'); + &Lemonldap::NG::Handler::Main::cfgNum(0,0); ok( $sp = sp(), 'SP portal' ); $handlerOR{sp} = \@Lemonldap::NG::Handler::Main::_onReload; diff --git a/lemonldap-ng-portal/t/31-Auth-and-issuer-CAS-declared-app.t b/lemonldap-ng-portal/t/31-Auth-and-issuer-CAS-declared-app.t index 2d369720a..68ef8f6aa 100644 --- a/lemonldap-ng-portal/t/31-Auth-and-issuer-CAS-declared-app.t +++ b/lemonldap-ng-portal/t/31-Auth-and-issuer-CAS-declared-app.t @@ -58,6 +58,7 @@ ok( $issuer = issuer(), 'Issuer portal' ); $handlerOR{issuer} = \@Lemonldap::NG::Handler::Main::_onReload; count(1); switch ('sp'); +&Lemonldap::NG::Handler::Main::cfgNum( 0, 0 ); ok( $sp = sp(), 'SP portal' ); count(1); diff --git a/lemonldap-ng-portal/t/31-Auth-and-issuer-CAS-default.t b/lemonldap-ng-portal/t/31-Auth-and-issuer-CAS-default.t index b9a58862d..505b17914 100644 --- a/lemonldap-ng-portal/t/31-Auth-and-issuer-CAS-default.t +++ b/lemonldap-ng-portal/t/31-Auth-and-issuer-CAS-default.t @@ -58,6 +58,7 @@ ok( $issuer = issuer(), 'Issuer portal' ); $handlerOR{issuer} = \@Lemonldap::NG::Handler::Main::_onReload; count(1); switch ('sp'); +&Lemonldap::NG::Handler::Main::cfgNum(0,0); ok( $sp = sp(), 'SP portal' ); count(1); diff --git a/lemonldap-ng-portal/t/31-Auth-and-issuer-CAS-proxied.t b/lemonldap-ng-portal/t/31-Auth-and-issuer-CAS-proxied.t index 33df0457e..9c3991b7f 100644 --- a/lemonldap-ng-portal/t/31-Auth-and-issuer-CAS-proxied.t +++ b/lemonldap-ng-portal/t/31-Auth-and-issuer-CAS-proxied.t @@ -56,6 +56,7 @@ ok( $issuer = issuer(), 'Issuer portal' ); $handlerOR{issuer} = \@Lemonldap::NG::Handler::Main::_onReload; count(1); switch ('sp'); +&Lemonldap::NG::Handler::Main::cfgNum(0,0); ok( $sp = sp(), 'SP portal' ); count(1); diff --git a/lemonldap-ng-portal/t/31-Auth-and-issuer-CAS-with-choice.t b/lemonldap-ng-portal/t/31-Auth-and-issuer-CAS-with-choice.t index c6f4c3387..81dafc6fe 100644 --- a/lemonldap-ng-portal/t/31-Auth-and-issuer-CAS-with-choice.t +++ b/lemonldap-ng-portal/t/31-Auth-and-issuer-CAS-with-choice.t @@ -75,6 +75,7 @@ SKIP: { ok( $issuer = issuer(), 'Issuer portal' ); $handlerOR{issuer} = \@Lemonldap::NG::Handler::Main::_onReload; switch ('sp'); + &Lemonldap::NG::Handler::Main::cfgNum(0,0); # Build CAS app ok( $sp = sp(), 'SP portal' ); diff --git a/lemonldap-ng-portal/t/32-Auth-and-issuer-OIDC-authorization_code-OP-logout.t b/lemonldap-ng-portal/t/32-Auth-and-issuer-OIDC-authorization_code-OP-logout.t index 686f4be7e..fb7f0c386 100644 --- a/lemonldap-ng-portal/t/32-Auth-and-issuer-OIDC-authorization_code-OP-logout.t +++ b/lemonldap-ng-portal/t/32-Auth-and-issuer-OIDC-authorization_code-OP-logout.t @@ -80,6 +80,7 @@ my $metadata = $res->[2]->[0]; count(3); switch ('rp'); +&Lemonldap::NG::Handler::Main::cfgNum( 0, 0 ); ok( $rp = rp( $jwks, $metadata ), 'RP portal' ); count(1); diff --git a/lemonldap-ng-portal/t/32-Auth-and-issuer-OIDC-authorization_code-with-authchoice.t b/lemonldap-ng-portal/t/32-Auth-and-issuer-OIDC-authorization_code-with-authchoice.t index b3279dae7..829fe177c 100644 --- a/lemonldap-ng-portal/t/32-Auth-and-issuer-OIDC-authorization_code-with-authchoice.t +++ b/lemonldap-ng-portal/t/32-Auth-and-issuer-OIDC-authorization_code-with-authchoice.t @@ -92,6 +92,7 @@ SKIP: { my $metadata = $res->[2]->[0]; switch ('rp'); + &Lemonldap::NG::Handler::Main::cfgNum( 0, 0 ); ok( $rp = rp( $jwks, $metadata ), 'RP portal' ); # Query RP for auth diff --git a/lemonldap-ng-portal/t/32-Auth-and-issuer-OIDC-authorization_code.t b/lemonldap-ng-portal/t/32-Auth-and-issuer-OIDC-authorization_code.t index b554a8781..31890d9fc 100644 --- a/lemonldap-ng-portal/t/32-Auth-and-issuer-OIDC-authorization_code.t +++ b/lemonldap-ng-portal/t/32-Auth-and-issuer-OIDC-authorization_code.t @@ -87,6 +87,7 @@ my $metadata = $res->[2]->[0]; count(3); switch ('rp'); +&Lemonldap::NG::Handler::Main::cfgNum( 0, 0 ); ok( $rp = rp( $jwks, $metadata ), 'RP portal' ); count(1); diff --git a/lemonldap-ng-portal/t/32-Auth-and-issuer-OIDC-hybrid.t b/lemonldap-ng-portal/t/32-Auth-and-issuer-OIDC-hybrid.t index ee66b4d22..bbe45c7c5 100644 --- a/lemonldap-ng-portal/t/32-Auth-and-issuer-OIDC-hybrid.t +++ b/lemonldap-ng-portal/t/32-Auth-and-issuer-OIDC-hybrid.t @@ -80,6 +80,7 @@ my $metadata = $res->[2]->[0]; count(3); switch ('rp'); +&Lemonldap::NG::Handler::Main::cfgNum( 0, 0 ); ok( $rp = rp( $jwks, $metadata ), 'RP portal' ); count(1); diff --git a/lemonldap-ng-portal/t/32-Auth-and-issuer-OIDC-implicit.t b/lemonldap-ng-portal/t/32-Auth-and-issuer-OIDC-implicit.t index da745c192..1dcab76dd 100644 --- a/lemonldap-ng-portal/t/32-Auth-and-issuer-OIDC-implicit.t +++ b/lemonldap-ng-portal/t/32-Auth-and-issuer-OIDC-implicit.t @@ -80,6 +80,7 @@ my $metadata = $res->[2]->[0]; count(3); switch ('rp'); +&Lemonldap::NG::Handler::Main::cfgNum( 0, 0 ); ok( $rp = rp( $jwks, $metadata ), 'RP portal' ); count(1); diff --git a/lemonldap-ng-portal/t/32-OIDC-RP-rule.t b/lemonldap-ng-portal/t/32-OIDC-RP-rule.t index dad06059d..4663689dd 100644 --- a/lemonldap-ng-portal/t/32-OIDC-RP-rule.t +++ b/lemonldap-ng-portal/t/32-OIDC-RP-rule.t @@ -80,6 +80,7 @@ my $metadata = $res->[2]->[0]; count(3); switch ('rp'); +&Lemonldap::NG::Handler::Main::cfgNum( 0, 0 ); ok( $rp = rp( $jwks, $metadata ), 'RP portal' ); count(1); diff --git a/lemonldap-ng-portal/t/33-Auth-and-issuer-OpenID2.t b/lemonldap-ng-portal/t/33-Auth-and-issuer-OpenID2.t index 3a09605a2..71ab621fc 100644 --- a/lemonldap-ng-portal/t/33-Auth-and-issuer-OpenID2.t +++ b/lemonldap-ng-portal/t/33-Auth-and-issuer-OpenID2.t @@ -52,6 +52,7 @@ SKIP: { ok( $issuer = issuer(), 'Issuer portal' ); $handlerOR{issuer} = \@Lemonldap::NG::Handler::Main::_onReload; switch ('sp'); + &Lemonldap::NG::Handler::Main::cfgNum(0,0); ok( $sp = sp(), 'SP portal' ); $handlerOR{sp} = \@Lemonldap::NG::Handler::Main::_onReload; diff --git a/lemonldap-ng-portal/t/34-Auth-Proxy-and-REST-Server.t b/lemonldap-ng-portal/t/34-Auth-Proxy-and-REST-Server.t index 9f380c5f7..b46344229 100644 --- a/lemonldap-ng-portal/t/34-Auth-Proxy-and-REST-Server.t +++ b/lemonldap-ng-portal/t/34-Auth-Proxy-and-REST-Server.t @@ -64,6 +64,7 @@ LWP::Protocol::PSGI->register( ok( $issuer = issuer(), 'Issuer portal' ); $handlerOR{issuer} = \@Lemonldap::NG::Handler::Main::_onReload; switch ('sp'); +&Lemonldap::NG::Handler::Main::cfgNum(0,0); ok( $sp = sp(), 'SP portal' ); $handlerOR{sp} = \@Lemonldap::NG::Handler::Main::_onReload; diff --git a/lemonldap-ng-portal/t/34-Auth-Proxy-and-SOAP-Server.t b/lemonldap-ng-portal/t/34-Auth-Proxy-and-SOAP-Server.t index 987407c30..4f5dfad0f 100644 --- a/lemonldap-ng-portal/t/34-Auth-Proxy-and-SOAP-Server.t +++ b/lemonldap-ng-portal/t/34-Auth-Proxy-and-SOAP-Server.t @@ -57,6 +57,7 @@ SKIP: { ok( $issuer = issuer(), 'Issuer portal' ); $handlerOR{issuer} = \@Lemonldap::NG::Handler::Main::_onReload; switch ('sp'); + &Lemonldap::NG::Handler::Main::cfgNum(0,0); ok( $sp = sp(), 'SP portal' ); $handlerOR{sp} = \@Lemonldap::NG::Handler::Main::_onReload; diff --git a/lemonldap-ng-portal/t/35-REST-config-backend.t b/lemonldap-ng-portal/t/35-REST-config-backend.t index 5a69b25f7..a32fa5b94 100644 --- a/lemonldap-ng-portal/t/35-REST-config-backend.t +++ b/lemonldap-ng-portal/t/35-REST-config-backend.t @@ -71,6 +71,7 @@ count(1); expectOK($res); switch ('sp'); +&Lemonldap::NG::Handler::Main::cfgNum(0,0); ok( $sp = sp(), 'SP portal' ); $handlerOR{sp} = \@Lemonldap::NG::Handler::Main::_onReload; diff --git a/lemonldap-ng-portal/t/35-REST-sessions-with-REST-server.t b/lemonldap-ng-portal/t/35-REST-sessions-with-REST-server.t index d46230509..fcc574871 100644 --- a/lemonldap-ng-portal/t/35-REST-sessions-with-REST-server.t +++ b/lemonldap-ng-portal/t/35-REST-sessions-with-REST-server.t @@ -65,6 +65,7 @@ LWP::Protocol::PSGI->register( ok( $issuer = issuer(), 'Issuer portal' ); $handlerOR{issuer} = \@Lemonldap::NG::Handler::Main::_onReload; switch ('sp'); +&Lemonldap::NG::Handler::Main::cfgNum(0,0); ok( $sp = sp(), 'SP portal' ); $handlerOR{sp} = \@Lemonldap::NG::Handler::Main::_onReload; diff --git a/lemonldap-ng-portal/t/35-SOAP-config-backend.t b/lemonldap-ng-portal/t/35-SOAP-config-backend.t index 396f23dad..ce6b56ff5 100644 --- a/lemonldap-ng-portal/t/35-SOAP-config-backend.t +++ b/lemonldap-ng-portal/t/35-SOAP-config-backend.t @@ -68,6 +68,7 @@ SKIP: { # Test SP access switch ('sp'); + &Lemonldap::NG::Handler::Main::cfgNum(0,0); ok( $sp = sp(), 'SP portal' ); $handlerOR{sp} = \@Lemonldap::NG::Handler::Main::_onReload; diff --git a/lemonldap-ng-portal/t/35-SOAP-sessions-with-SOAP-server.t b/lemonldap-ng-portal/t/35-SOAP-sessions-with-SOAP-server.t index 2ed411f1b..a78773020 100644 --- a/lemonldap-ng-portal/t/35-SOAP-sessions-with-SOAP-server.t +++ b/lemonldap-ng-portal/t/35-SOAP-sessions-with-SOAP-server.t @@ -55,6 +55,7 @@ SKIP: { ok( $issuer = issuer(), 'Issuer portal' ); $handlerOR{issuer} = \@Lemonldap::NG::Handler::Main::_onReload; switch ('sp'); + &Lemonldap::NG::Handler::Main::cfgNum(0,0); ok( $sp = sp(), 'SP portal' ); $handlerOR{sp} = \@Lemonldap::NG::Handler::Main::_onReload; diff --git a/lemonldap-ng-portal/t/36-Combination-with-token.t b/lemonldap-ng-portal/t/36-Combination-with-token.t index 7ef2fd32a..d129b5344 100644 --- a/lemonldap-ng-portal/t/36-Combination-with-token.t +++ b/lemonldap-ng-portal/t/36-Combination-with-token.t @@ -67,6 +67,7 @@ sub try { sub iniCmb { my $expr = shift; + &Lemonldap::NG::Handler::Main::cfgNum( 0, 0 ); if ( my $res = LLNG::Manager::Test->new( { diff --git a/lemonldap-ng-portal/t/36-Combination.t b/lemonldap-ng-portal/t/36-Combination.t index 8d0878ef1..f1dab1303 100644 --- a/lemonldap-ng-portal/t/36-Combination.t +++ b/lemonldap-ng-portal/t/36-Combination.t @@ -62,6 +62,7 @@ sub try { sub iniCmb { my $expr = shift; + &Lemonldap::NG::Handler::Main::cfgNum( 0, 0 ); if ( my $res = LLNG::Manager::Test->new( { diff --git a/lemonldap-ng-portal/t/37-Logout-from-OIDC-RP-to-SAML-SP.t b/lemonldap-ng-portal/t/37-Logout-from-OIDC-RP-to-SAML-SP.t index 37318b0eb..222713178 100644 --- a/lemonldap-ng-portal/t/37-Logout-from-OIDC-RP-to-SAML-SP.t +++ b/lemonldap-ng-portal/t/37-Logout-from-OIDC-RP-to-SAML-SP.t @@ -91,10 +91,12 @@ SKIP: { my $metadata = $res->[2]->[0]; switch ('sp'); + &Lemonldap::NG::Handler::Main::cfgNum( 0, 0 ); ok( $sp = sp(), 'SP portal' ); $handlerOR{sp} = \@Lemonldap::NG::Handler::Main::_onReload; switch ('rp'); + &Lemonldap::NG::Handler::Main::cfgNum(0,0); ok( $rp = rp( $jwks, $metadata ), 'RP portal' ); $handlerOR{rp} = \@Lemonldap::NG::Handler::Main::_onReload; diff --git a/lemonldap-ng-portal/t/37-OIDC-RP-to-SAML-IdP-GET.t b/lemonldap-ng-portal/t/37-OIDC-RP-to-SAML-IdP-GET.t index 7ecc96b76..215ad4a96 100644 --- a/lemonldap-ng-portal/t/37-OIDC-RP-to-SAML-IdP-GET.t +++ b/lemonldap-ng-portal/t/37-OIDC-RP-to-SAML-IdP-GET.t @@ -78,6 +78,7 @@ SKIP: { $handlerOR{idp} = \@Lemonldap::NG::Handler::Main::_onReload; switch ('sp'); + &Lemonldap::NG::Handler::Main::cfgNum(0,0); ok( $sp = sp(), 'Proxy portal' ); $handlerOR{sp} = \@Lemonldap::NG::Handler::Main::_onReload; @@ -96,6 +97,7 @@ SKIP: { my $metadata = $res->[2]->[0]; switch ('rp'); + &Lemonldap::NG::Handler::Main::cfgNum( 0, 0 ); ok( $rp = rp( $jwks, $metadata ), 'RP portal' ); $handlerOR{rp} = \@Lemonldap::NG::Handler::Main::_onReload; diff --git a/lemonldap-ng-portal/t/37-OIDC-RP-to-SAML-IdP-POST.t b/lemonldap-ng-portal/t/37-OIDC-RP-to-SAML-IdP-POST.t index 1832a07e0..9e7adaea9 100644 --- a/lemonldap-ng-portal/t/37-OIDC-RP-to-SAML-IdP-POST.t +++ b/lemonldap-ng-portal/t/37-OIDC-RP-to-SAML-IdP-POST.t @@ -78,6 +78,7 @@ SKIP: { $handlerOR{idp} = \@Lemonldap::NG::Handler::Main::_onReload; switch ('sp'); + &Lemonldap::NG::Handler::Main::cfgNum(0,0); ok( $sp = sp(), 'Proxy portal' ); $handlerOR{sp} = \@Lemonldap::NG::Handler::Main::_onReload; @@ -96,6 +97,7 @@ SKIP: { my $metadata = $res->[2]->[0]; switch ('rp'); + &Lemonldap::NG::Handler::Main::cfgNum( 0, 0 ); ok( $rp = rp( $jwks, $metadata ), 'RP portal' ); $handlerOR{rp} = \@Lemonldap::NG::Handler::Main::_onReload; diff --git a/lemonldap-ng-portal/t/37-SAML-SP-GET-to-OIDC-OP.t b/lemonldap-ng-portal/t/37-SAML-SP-GET-to-OIDC-OP.t index 3fb5024b5..2c5c51c81 100644 --- a/lemonldap-ng-portal/t/37-SAML-SP-GET-to-OIDC-OP.t +++ b/lemonldap-ng-portal/t/37-SAML-SP-GET-to-OIDC-OP.t @@ -91,10 +91,12 @@ SKIP: { my $metadata = $res->[2]->[0]; switch ('sp'); + &Lemonldap::NG::Handler::Main::cfgNum( 0, 0 ); ok( $sp = sp(), 'SP portal' ); $handlerOR{sp} = \@Lemonldap::NG::Handler::Main::_onReload; switch ('proxy'); + &Lemonldap::NG::Handler::Main::cfgNum(0,0); ok( $proxy = proxy( $jwks, $metadata ), 'Proxy portal' ); $handlerOR{proxy} = \@Lemonldap::NG::Handler::Main::_onReload; diff --git a/lemonldap-ng-portal/t/37-SAML-SP-POST-to-OIDC-OP.t b/lemonldap-ng-portal/t/37-SAML-SP-POST-to-OIDC-OP.t index abea7f93c..f55a6784d 100644 --- a/lemonldap-ng-portal/t/37-SAML-SP-POST-to-OIDC-OP.t +++ b/lemonldap-ng-portal/t/37-SAML-SP-POST-to-OIDC-OP.t @@ -91,10 +91,12 @@ SKIP: { my $metadata = $res->[2]->[0]; switch ('sp'); + &Lemonldap::NG::Handler::Main::cfgNum( 0, 0 ); ok( $sp = sp(), 'SP portal' ); $handlerOR{sp} = \@Lemonldap::NG::Handler::Main::_onReload; switch ('proxy'); + &Lemonldap::NG::Handler::Main::cfgNum(0,0); ok( $proxy = proxy( $jwks, $metadata ), 'Proxy portal' ); $handlerOR{proxy} = \@Lemonldap::NG::Handler::Main::_onReload; diff --git a/lemonldap-ng-portal/t/61-GrantSession.t b/lemonldap-ng-portal/t/61-GrantSession.t index b2a4378bd..19401fad1 100644 --- a/lemonldap-ng-portal/t/61-GrantSession.t +++ b/lemonldap-ng-portal/t/61-GrantSession.t @@ -31,6 +31,7 @@ ok( count(1); expectReject($res); +&Lemonldap::NG::Handler::Main::cfgNum( 0, 0 ); $client = LLNG::Manager::Test->new( { ini => {