From 93b491e061365720164798f01134671411d1a888 Mon Sep 17 00:00:00 2001 From: Xavier Guimard Date: Wed, 6 Sep 2017 13:18:08 +0000 Subject: [PATCH] Avoid plugin route conflict (partial fix for #1290) --- .../lib/Lemonldap/NG/Common/PSGI/Router.pm | 5 +++ .../lib/Lemonldap/NG/Manager/Attributes.pm | 40 +++++++++---------- 2 files changed, 25 insertions(+), 20 deletions(-) diff --git a/lemonldap-ng-common/lib/Lemonldap/NG/Common/PSGI/Router.pm b/lemonldap-ng-common/lib/Lemonldap/NG/Common/PSGI/Router.pm index 95de7612a..069af0af2 100644 --- a/lemonldap-ng-common/lib/Lemonldap/NG/Common/PSGI/Router.pm +++ b/lemonldap-ng-common/lib/Lemonldap/NG/Common/PSGI/Router.pm @@ -30,6 +30,11 @@ sub addRoute { sub genRoute { my ( $self, $routes, $word, $dest, $transform ) = @_; + unless ( ref $routes eq 'HASH' ) { + $self->logger->error( + 'Conflict detected between 2 extensions, aborting 1 route'); + return; + } if ( ref $word eq 'ARRAY' ) { foreach my $w (@$word) { $self->genRoute( $routes, $w, $dest, $transform ); diff --git a/lemonldap-ng-manager/lib/Lemonldap/NG/Manager/Attributes.pm b/lemonldap-ng-manager/lib/Lemonldap/NG/Manager/Attributes.pm index 0894dde37..dc9c3d25e 100644 --- a/lemonldap-ng-manager/lib/Lemonldap/NG/Manager/Attributes.pm +++ b/lemonldap-ng-manager/lib/Lemonldap/NG/Manager/Attributes.pm @@ -27,7 +27,7 @@ sub types { BEGIN { ${^WARNING_BITS} = -"\x54\x55\x55\x55\x15\x55\x55\x55\x55\x55\x51\x55\x55\x55\x55\x55\x55\x05"; +"\x54\x55\x55\x55\x15\x55\x55\x55\x55\x55\x51\x55\x55\x55\x55\x55\x55\x01"; } eval "$s $val"; my $err = join( @@ -659,7 +659,7 @@ sub attributes { BEGIN { ${^WARNING_BITS} = -"\x54\x55\x55\x55\x15\x55\x55\x55\x55\x55\x51\x55\x55\x55\x55\x55\x55\x05"; +"\x54\x55\x55\x55\x15\x55\x55\x55\x55\x55\x51\x55\x55\x55\x55\x55\x55\x01"; } eval "$s $val"; my $err = join( @@ -1024,7 +1024,7 @@ qr/^(?:(?:(?:(?:[a-zA-Z0-9][-a-zA-Z0-9]*)?[a-zA-Z0-9])[.])*(?:[a-zA-Z][-a-zA-Z0- BEGIN { ${^WARNING_BITS} = -"\x54\x55\x55\x55\x15\x55\x55\x55\x55\x55\x51\x55\x55\x55\x55\x55\x55\x05"; +"\x54\x55\x55\x55\x15\x55\x55\x55\x55\x55\x51\x55\x55\x55\x55\x55\x55\x01"; } eval $s; my $err = join( @@ -1106,7 +1106,7 @@ qr/^(?:(?:(?:(?:[a-zA-Z0-9][-a-zA-Z0-9]*)?[a-zA-Z0-9])[.])*(?:[a-zA-Z][-a-zA-Z0- BEGIN { ${^WARNING_BITS} = -"\x54\x55\x55\x55\x15\x55\x55\x55\x55\x55\x51\x55\x55\x55\x55\x55\x55\x05"; +"\x54\x55\x55\x55\x15\x55\x55\x55\x55\x55\x51\x55\x55\x55\x55\x55\x55\x01"; } eval "$s $val"; my $err = join( @@ -1129,7 +1129,7 @@ qr/^(?:(?:(?:(?:[a-zA-Z0-9][-a-zA-Z0-9]*)?[a-zA-Z0-9])[.])*(?:[a-zA-Z][-a-zA-Z0- BEGIN { ${^WARNING_BITS} = -"\x54\x55\x55\x55\x15\x55\x55\x55\x55\x55\x51\x55\x55\x55\x55\x55\x55\x05"; +"\x54\x55\x55\x55\x15\x55\x55\x55\x55\x55\x51\x55\x55\x55\x55\x55\x55\x01"; } eval "$s $val"; my $err = join( @@ -1184,7 +1184,7 @@ qr/^(?:(?:(?:(?:[a-zA-Z0-9][-a-zA-Z0-9]*)?[a-zA-Z0-9])[.])*(?:[a-zA-Z][-a-zA-Z0- 'type' => 'boolOrExpr' }, 'issuerDBGetActivation' => { - 'default' => 0, + 'default' => '0', 'type' => 'bool' }, 'issuerDBGetParameters' => { @@ -1222,7 +1222,7 @@ qr/^(?:(?:(?:(?:[a-zA-Z0-9][-a-zA-Z0-9]*)?[a-zA-Z0-9])[.])*(?:[a-zA-Z][-a-zA-Z0- 'type' => 'bool' }, 'issuerDBOpenIDConnectActivation' => { - 'default' => 0, + 'default' => '0', 'type' => 'bool' }, 'issuerDBOpenIDConnectPath' => { @@ -1474,7 +1474,7 @@ qr/^(?:(?:(?:(?:[a-zA-Z0-9][-a-zA-Z0-9]*)?[a-zA-Z0-9])[.])*(?:[a-zA-Z][-a-zA-Z0- BEGIN { ${^WARNING_BITS} = -"\x54\x55\x55\x55\x15\x55\x55\x55\x55\x55\x51\x55\x55\x55\x55\x55\x55\x05"; +"\x54\x55\x55\x55\x15\x55\x55\x55\x55\x55\x51\x55\x55\x55\x55\x55\x55\x01"; } eval $s; my $err = join( @@ -1511,7 +1511,7 @@ qr/^(?:(?:(?:(?:[a-zA-Z0-9][-a-zA-Z0-9]*)?[a-zA-Z0-9])[.])*(?:[a-zA-Z][-a-zA-Z0- BEGIN { ${^WARNING_BITS} = -"\x54\x55\x55\x55\x15\x55\x55\x55\x55\x55\x51\x55\x55\x55\x55\x55\x55\x05"; +"\x54\x55\x55\x55\x15\x55\x55\x55\x55\x55\x51\x55\x55\x55\x55\x55\x55\x01"; } eval "$s $val"; my $err = join( @@ -1862,7 +1862,7 @@ qr/^(?:(?:(?:(?:[a-zA-Z0-9][-a-zA-Z0-9]*)?[a-zA-Z0-9])[.])*(?:[a-zA-Z][-a-zA-Z0- BEGIN { ${^WARNING_BITS} = -"\x54\x55\x55\x55\x15\x55\x55\x55\x55\x55\x51\x55\x55\x55\x55\x55\x55\x05"; +"\x54\x55\x55\x55\x15\x55\x55\x55\x55\x55\x51\x55\x55\x55\x55\x55\x55\x01"; } eval "$s $val"; my $err = join( @@ -1882,19 +1882,19 @@ qr/^(?:(?:(?:(?:[a-zA-Z0-9][-a-zA-Z0-9]*)?[a-zA-Z0-9])[.])*(?:[a-zA-Z][-a-zA-Z0- 'type' => 'int' }, 'oidcServiceAllowAuthorizationCodeFlow' => { - 'default' => 1, + 'default' => '1', 'type' => 'bool' }, 'oidcServiceAllowDynamicRegistration' => { - 'default' => 0, + 'default' => '0', 'type' => 'bool' }, 'oidcServiceAllowHybridFlow' => { - 'default' => 0, + 'default' => '0', 'type' => 'bool' }, 'oidcServiceAllowImplicitFlow' => { - 'default' => 0, + 'default' => '0', 'type' => 'bool' }, 'oidcServiceKeyIdSig' => { @@ -2195,7 +2195,7 @@ qr/^(?:(?:(?:(?:[a-zA-Z0-9][-a-zA-Z0-9]*)?[a-zA-Z0-9])[.])*(?:[a-zA-Z][-a-zA-Z0- BEGIN { ${^WARNING_BITS} = -"\x54\x55\x55\x55\x15\x55\x55\x55\x55\x55\x51\x55\x55\x55\x55\x55\x55\x05"; +"\x54\x55\x55\x55\x15\x55\x55\x55\x55\x55\x51\x55\x55\x55\x55\x55\x55\x01"; } eval "$s $val"; my $err = join( @@ -2865,7 +2865,7 @@ qr/(?:(?:https?):\/\/(?:(?:(?:(?:(?:(?:[a-zA-Z0-9][-a-zA-Z0-9]*)?[a-zA-Z0-9])[.] BEGIN { ${^WARNING_BITS} = -"\x54\x55\x55\x55\x15\x55\x55\x55\x55\x55\x51\x55\x55\x55\x55\x55\x55\x05"; +"\x54\x55\x55\x55\x15\x55\x55\x55\x55\x55\x51\x55\x55\x55\x55\x55\x55\x01"; } eval "$s $val"; my $err = join( @@ -2944,19 +2944,19 @@ qr/(?:(?:https?):\/\/(?:(?:(?:(?:(?:(?:[a-zA-Z0-9][-a-zA-Z0-9]*)?[a-zA-Z0-9])[.] 'default' => 0, 'select' => [ { - 'k' => 0, + 'k' => '0', 'v' => 'unsecuredCookie' }, { - 'k' => 1, + 'k' => '1', 'v' => 'securedCookie' }, { - 'k' => 2, + 'k' => '2', 'v' => 'doubleCookie' }, { - 'k' => 3, + 'k' => '3', 'v' => 'doubleCookieForSingleSession' } ],