Avoid plugin route conflict (partial fix for #1290)

This commit is contained in:
Xavier Guimard 2017-09-06 13:18:08 +00:00
parent d788674e22
commit 93b491e061
2 changed files with 25 additions and 20 deletions

View File

@ -30,6 +30,11 @@ sub addRoute {
sub genRoute { sub genRoute {
my ( $self, $routes, $word, $dest, $transform ) = @_; 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' ) { if ( ref $word eq 'ARRAY' ) {
foreach my $w (@$word) { foreach my $w (@$word) {
$self->genRoute( $routes, $w, $dest, $transform ); $self->genRoute( $routes, $w, $dest, $transform );

View File

@ -27,7 +27,7 @@ sub types {
BEGIN { BEGIN {
${^WARNING_BITS} = ${^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"; eval "$s $val";
my $err = join( my $err = join(
@ -659,7 +659,7 @@ sub attributes {
BEGIN { BEGIN {
${^WARNING_BITS} = ${^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"; eval "$s $val";
my $err = join( 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 { BEGIN {
${^WARNING_BITS} = ${^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; eval $s;
my $err = join( 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 { BEGIN {
${^WARNING_BITS} = ${^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"; eval "$s $val";
my $err = join( 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 { BEGIN {
${^WARNING_BITS} = ${^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"; eval "$s $val";
my $err = join( 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' 'type' => 'boolOrExpr'
}, },
'issuerDBGetActivation' => { 'issuerDBGetActivation' => {
'default' => 0, 'default' => '0',
'type' => 'bool' 'type' => 'bool'
}, },
'issuerDBGetParameters' => { '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' 'type' => 'bool'
}, },
'issuerDBOpenIDConnectActivation' => { 'issuerDBOpenIDConnectActivation' => {
'default' => 0, 'default' => '0',
'type' => 'bool' 'type' => 'bool'
}, },
'issuerDBOpenIDConnectPath' => { '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 { BEGIN {
${^WARNING_BITS} = ${^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; eval $s;
my $err = join( 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 { BEGIN {
${^WARNING_BITS} = ${^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"; eval "$s $val";
my $err = join( 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 { BEGIN {
${^WARNING_BITS} = ${^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"; eval "$s $val";
my $err = join( 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' 'type' => 'int'
}, },
'oidcServiceAllowAuthorizationCodeFlow' => { 'oidcServiceAllowAuthorizationCodeFlow' => {
'default' => 1, 'default' => '1',
'type' => 'bool' 'type' => 'bool'
}, },
'oidcServiceAllowDynamicRegistration' => { 'oidcServiceAllowDynamicRegistration' => {
'default' => 0, 'default' => '0',
'type' => 'bool' 'type' => 'bool'
}, },
'oidcServiceAllowHybridFlow' => { 'oidcServiceAllowHybridFlow' => {
'default' => 0, 'default' => '0',
'type' => 'bool' 'type' => 'bool'
}, },
'oidcServiceAllowImplicitFlow' => { 'oidcServiceAllowImplicitFlow' => {
'default' => 0, 'default' => '0',
'type' => 'bool' 'type' => 'bool'
}, },
'oidcServiceKeyIdSig' => { '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 { BEGIN {
${^WARNING_BITS} = ${^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"; eval "$s $val";
my $err = join( my $err = join(
@ -2865,7 +2865,7 @@ qr/(?:(?:https?):\/\/(?:(?:(?:(?:(?:(?:[a-zA-Z0-9][-a-zA-Z0-9]*)?[a-zA-Z0-9])[.]
BEGIN { BEGIN {
${^WARNING_BITS} = ${^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"; eval "$s $val";
my $err = join( my $err = join(
@ -2944,19 +2944,19 @@ qr/(?:(?:https?):\/\/(?:(?:(?:(?:(?:(?:[a-zA-Z0-9][-a-zA-Z0-9]*)?[a-zA-Z0-9])[.]
'default' => 0, 'default' => 0,
'select' => [ 'select' => [
{ {
'k' => 0, 'k' => '0',
'v' => 'unsecuredCookie' 'v' => 'unsecuredCookie'
}, },
{ {
'k' => 1, 'k' => '1',
'v' => 'securedCookie' 'v' => 'securedCookie'
}, },
{ {
'k' => 2, 'k' => '2',
'v' => 'doubleCookie' 'v' => 'doubleCookie'
}, },
{ {
'k' => 3, 'k' => '3',
'v' => 'doubleCookieForSingleSession' 'v' => 'doubleCookieForSingleSession'
} }
], ],