Use new constant to manage hash keys
This commit is contained in:
parent
6a958599c2
commit
99158605d7
|
@ -23,7 +23,7 @@ use constant HANDLERSECTION => "handler";
|
||||||
use constant MANAGERSECTION => "manager";
|
use constant MANAGERSECTION => "manager";
|
||||||
use constant SESSIONSEXPLORERSECTION => "sessionsExplorer";
|
use constant SESSIONSEXPLORERSECTION => "sessionsExplorer";
|
||||||
use constant APPLYSECTION => "apply";
|
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 = (
|
our %EXPORT_TAGS = (
|
||||||
|
|
|
@ -3,6 +3,7 @@ package Lemonldap::NG::Common::Conf::Serializer;
|
||||||
use strict;
|
use strict;
|
||||||
use utf8;
|
use utf8;
|
||||||
use Data::Dumper;
|
use Data::Dumper;
|
||||||
|
use Lemonldap::NG::Common::Conf::Constants;
|
||||||
|
|
||||||
our $VERSION = '1.9.0';
|
our $VERSION = '1.9.0';
|
||||||
|
|
||||||
|
@ -106,57 +107,7 @@ sub unserialize {
|
||||||
|
|
||||||
# Manage hashes
|
# Manage hashes
|
||||||
|
|
||||||
# Regexp::Assemble of:
|
if ( $k =~ $hashParameters and $v ||= {} and not ref($v) ) {
|
||||||
# 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) )
|
|
||||||
{
|
|
||||||
$conf->{$k} = {};
|
$conf->{$k} = {};
|
||||||
|
|
||||||
# Value should be a Data::Dumper, else this is an old format
|
# Value should be a Data::Dumper, else this is an old format
|
||||||
|
@ -183,7 +134,8 @@ sub unserialize {
|
||||||
eval $v;
|
eval $v;
|
||||||
|
|
||||||
if ($@) {
|
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
|
# Store value in configuration object
|
||||||
|
|
|
@ -222,7 +222,7 @@ $defaultAttr}
|
||||||
foreach ( @simpleHashKeys, sort keys %cnodesRe ) {
|
foreach ( @simpleHashKeys, sort keys %cnodesRe ) {
|
||||||
$ra->add($_);
|
$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($!);
|
open( F, ">", $self->confConstantsFile ) or die($!);
|
||||||
print F <<EOF;
|
print F <<EOF;
|
||||||
# This file is generated by $module. Don't modify it by hand
|
# This file is generated by $module. Don't modify it by hand
|
||||||
|
|
Loading…
Reference in New Issue
Block a user