Don't reload portal if conf is already loaded

This commit is contained in:
Xavier Guimard 2018-06-05 23:13:18 +02:00
parent 1669a6d482
commit 7f7d068646
38 changed files with 56 additions and 11 deletions

View File

@ -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;
}

View File

@ -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 } )
: ()
)

View File

@ -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 => {

View File

@ -27,6 +27,7 @@ expectOK($res);
expectCookie($res);
count(1);
&Lemonldap::NG::Handler::Main::cfgNum( 0, 0 );
$client = LLNG::Manager::Test->new(
{
ini => {

View File

@ -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;

View File

@ -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;

View File

@ -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;

View File

@ -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;

View File

@ -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;

View File

@ -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;

View File

@ -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;

View File

@ -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;

View File

@ -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;

View File

@ -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);

View File

@ -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);

View File

@ -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);

View File

@ -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' );

View File

@ -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);

View File

@ -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

View File

@ -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);

View File

@ -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);

View File

@ -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);

View File

@ -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);

View File

@ -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;

View File

@ -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;

View File

@ -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;

View File

@ -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;

View File

@ -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;

View File

@ -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;

View File

@ -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;

View File

@ -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(
{

View File

@ -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(
{

View File

@ -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;

View File

@ -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;

View File

@ -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;

View File

@ -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;

View File

@ -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;

View File

@ -31,6 +31,7 @@ ok(
count(1);
expectReject($res);
&Lemonldap::NG::Handler::Main::cfgNum( 0, 0 );
$client = LLNG::Manager::Test->new(
{
ini => {