diff --git a/lemonldap-ng-common/lib/Lemonldap/NG/Common/Conf/Constants.pm b/lemonldap-ng-common/lib/Lemonldap/NG/Common/Conf/Constants.pm index 6f39b5d2a..18b91727e 100644 --- a/lemonldap-ng-common/lib/Lemonldap/NG/Common/Conf/Constants.pm +++ b/lemonldap-ng-common/lib/Lemonldap/NG/Common/Conf/Constants.pm @@ -23,7 +23,7 @@ use constant HANDLERSECTION => "handler"; use constant MANAGERSECTION => "manager"; use constant SESSIONSEXPLORERSECTION => "sessionsExplorer"; use constant APPLYSECTION => "apply"; -our $hashParameters = '(?:(?:g(?:r(?:antSessionRule|oup)|lobalStorageOption|oogleExportedVar)|l(?:o(?:calSessionStorageOption|goutService)|dapExportedVar)|ca(?:s(?:StorageOption|Attribute)|ptchaStorageOption)|(?:(?:d(?:emo|bi)|facebook|webID)E|e)xportedVar|p(?:ersistentStorageOption|ortalSkinRule)|re(?:moteGlobalStorageOption|loadUrl)|notificationStorageOption|CAS_proxiedService|macro)s|s(?:aml(?:S(?:PMetaDataNode|torageOptions)|IDPMetaDataNode)|essionDataToRemember|laveExportedVars)|o(?:idc(?:S(?:erviceMetaDataAuthnContext|torageOptions)|[OR]PMetaDataNode)|penIdExportedVars)|a(?:uthChoiceModules|pplicationList)|virtualHost)'; +our $hashParameters = qr/^(?:(?:g(?:r(?:antSessionRule|oup)|lobalStorageOption|oogleExportedVar)|l(?:o(?:calSessionStorageOption|goutService)|dapExportedVar)|ca(?:s(?:StorageOption|Attribute)|ptchaStorageOption)|(?:(?:d(?:emo|bi)|facebook|webID)E|e)xportedVar|p(?:ersistentStorageOption|ortalSkinRule)|re(?:moteGlobalStorageOption|loadUrl)|notificationStorageOption|CAS_proxiedService|macro)s|s(?:aml(?:S(?:PMetaDataNode|torageOptions)|IDPMetaDataNode)|essionDataToRemember|laveExportedVars)|o(?:idc(?:S(?:erviceMetaDataAuthnContext|torageOptions)|[OR]PMetaDataNode)|penIdExportedVars)|a(?:uthChoiceModules|pplicationList)|virtualHost)$/; our %EXPORT_TAGS = ( diff --git a/lemonldap-ng-common/lib/Lemonldap/NG/Common/Conf/Serializer.pm b/lemonldap-ng-common/lib/Lemonldap/NG/Common/Conf/Serializer.pm index b13131e4c..5b2e4e2dc 100644 --- a/lemonldap-ng-common/lib/Lemonldap/NG/Common/Conf/Serializer.pm +++ b/lemonldap-ng-common/lib/Lemonldap/NG/Common/Conf/Serializer.pm @@ -3,6 +3,7 @@ package Lemonldap::NG::Common::Conf::Serializer; use strict; use utf8; use Data::Dumper; +use Lemonldap::NG::Common::Conf::Constants; our $VERSION = '1.9.0'; @@ -106,57 +107,7 @@ sub unserialize { # Manage hashes - # Regexp::Assemble of: - # applicationList - # authChoiceModules - # captchaStorageOptions - # CAS_proxiedServices - # casAttributes - # casStorageOptions - # dbiExportedVars - # demoExportedVars - # exportedHeaders - # exportedVars - # facebookExportedVars - # globalStorageOptions - # googleExportedVars - # grantSessionRules - # groups - # ldapExportedVars - # localSessionStorageOptions - # locationRules - # logoutServices - # macros - # notificationStorageOptions - # oidcOPMetaDataExportedVars - # oidcOPMetaDataJSON - # oidcOPMetaDataJWKS - # oidcOPMetaDataOptions - # oidcRPMetaDataExportedVars - # oidcRPMetaDataOptions - # oidcServiceMetaDataAuthnContext - # openIdExportedVars - # persistentStorageOptions - # portalSkinRules - # post - # reloadUrls - # remoteGlobalStorageOptions - # samlIDPMetaDataExportedAttributes - # samlIDPMetaDataOptions - # samlIDPMetaDataXML - # samlSPMetaDataExportedAttributes - # samlSPMetaDataOptions - # samlSPMetaDataXML - # samlStorageOptions - # sessionDataToRemember - # slaveExportedVars - # vhostOptions - # webIDExportedVars - if ( $k =~ -/^(?:(?:l(?:o(?:ca(?:lSessionStorageOption|tionRule)|goutService)|dapExportedVar)|(?:(?:d(?:emo|bi)|facebook|webID)ExportedVa|exported(?:Heade|Va))r|g(?:r(?:antSessionRule|oup)|lobalStorageOption|oogleExportedVar)|ca(?:s(?:StorageOption|Attribute)|ptchaStorageOption)|re(?:moteGlobalStorageOption|loadUrl)|(?:notificationStorage|vhost)Option|CAS_proxiedService|macro)s|s(?:aml(?:S(?:PMetaData(?:(?:ExportedAttribute|Option)s|XML)|torageOptions)|IDPMetaData(?:(?:ExportedAttribute|Option)s|XML))|essionDataToRemember|laveExportedVars)|o(?:idc(?:OPMetaData(?:(?:ExportedVar|Option)s|J(?:SON|WKS))|RPMetaData(?:ExportedVar|Option)s|ServiceMetaDataAuthnContext)|penIdExportedVars)|p(?:ersistentStorageOptions|o(?:rtalSkinRules|st))|a(?:uthChoiceModules|pplicationList))$/ - and $v ||= {} - and not ref($v) ) - { + if ( $k =~ $hashParameters and $v ||= {} and not ref($v) ) { $conf->{$k} = {}; # Value should be a Data::Dumper, else this is an old format @@ -183,7 +134,8 @@ sub unserialize { eval $v; if ($@) { - $Lemonldap::NG::Common::Conf::msg .= " Error: cannot read configuration key $k: $@"; + $Lemonldap::NG::Common::Conf::msg .= + " Error: cannot read configuration key $k: $@"; } # Store value in configuration object diff --git a/lemonldap-ng-manager/lib/Lemonldap/NG/Manager/Build.pm b/lemonldap-ng-manager/lib/Lemonldap/NG/Manager/Build.pm index 9223cb195..d1be2cf16 100644 --- a/lemonldap-ng-manager/lib/Lemonldap/NG/Manager/Build.pm +++ b/lemonldap-ng-manager/lib/Lemonldap/NG/Manager/Build.pm @@ -222,7 +222,7 @@ $defaultAttr} foreach ( @simpleHashKeys, sort keys %cnodesRe ) { $ra->add($_); } - my $confConstants = "our \$hashParameters = '" . $ra->as_string . "';\n"; + my $confConstants = "our \$hashParameters = qr/^" . $ra->as_string . "\$/;\n"; open( F, ">", $self->confConstantsFile ) or die($!); print F <