Clean $authParameters constant

This commit is contained in:
Xavier Guimard 2016-03-18 17:56:59 +00:00
parent 32c0d51d4b
commit 396755a97c
2 changed files with 32 additions and 157 deletions

View File

@ -35,6 +35,9 @@ my $mainTree;
my @sessionTypes;
my @simpleHashKeys;
my $authParams;
my $issuerParams;
my $samlServiceParams;
my $oidcServiceParams;
my $attributes = Lemonldap::NG::Manager::Build::Attributes::attributes();
my $jsonEnc = JSON->new()->allow_nonref;
@ -190,9 +193,12 @@ EOF
print F "our \$${_}Keys = '$cnodesRe{$_}';\n";
}
$tmp = Dumper($authParams);
$tmp =~ s/VAR1/authParameters/s;
print F "\nour $tmp\n";
$tmp = "our \$authParameters = {\n";
while(my($k,$v) = each %$authParams) {
$tmp .= " $k => [qw(".join(' ',@$v).")],\n";
}
print F "\n$tmp};\n";
print F "\n1;\n";
close F;
@ -413,7 +419,6 @@ sub scanTree {
my @cn = $self->scanLeaf( $sn->{nodes} );
$authParams->{$sn->{title}} = \@cn;
}
print STDERR Dumper($authParams);
foreach my $sn ( @{ $jleaf->{"_$n"} } ) {
$sn->{show} = 'false';
}

View File

@ -30,158 +30,28 @@ our $samlSPMetaDataNodeKeys = 'samlSPMetaData(?:Options(?:N(?:ameID(?:SessionKey
our $virtualHostKeys = '(?:vhost(?:(?:Aliase|Http)s|Maintenance|Port)|(?:exportedHeader|locationRule)s|post)';
our $authParameters = {
'adParams' => [
'ADPwdMaxAge',
'ADPwdExpireWarning'
],
'apacheParams' => [
'apacheAuthnLevel'
],
'browseridParams' => [
'browserIdAuthnLevel',
'browserIdAutoLogin',
'browserIdVerificationURL',
'browserIdSiteName',
'browserIdSiteLogo',
'browserIdBackgroundColor'
],
'casParams' => [
'CAS_authnLevel',
'CAS_url',
'CAS_CAFile',
'CAS_renew',
'CAS_gateway',
'CAS_pgtFile',
'CAS_proxiedServices'
],
'choiceParams' => [
'authChoiceParam',
'authChoiceModules'
],
'dbiParams' => [
'dbiAuthnLevel',
'dbiExportedVars',
'dbiAuthChain',
'dbiAuthUser',
'dbiAuthPassword',
'dbiUserChain',
'dbiUserUser',
'dbiUserPassword',
'dbiAuthTable',
'dbiUserTable',
'dbiAuthLoginCol',
'dbiAuthPasswordCol',
'dbiPasswordMailCol',
'userPivot',
'dbiAuthPasswordHash'
],
'demoParams' => [
'demoExportedVars'
],
'facebookParams' => [
'facebookAuthnLevel',
'facebookExportedVars',
'facebookAppId',
'facebookAppSecret'
],
'googleParams' => [
'googleAuthnLevel',
'googleExportedVars'
],
'ldapParams' => [
'ldapAuthnLevel',
'ldapExportedVars',
'ldapServer',
'ldapPort',
'ldapBase',
'managerDn',
'managerPassword',
'ldapTimeout',
'ldapVersion',
'ldapRaw',
'LDAPFilter',
'AuthLDAPFilter',
'mailLDAPFilter',
'ldapSearchDeref',
'ldapGroupBase',
'ldapGroupObjectClass',
'ldapGroupAttributeName',
'ldapGroupAttributeNameUser',
'ldapGroupAttributeNameSearch',
'ldapGroupRecursive',
'ldapGroupAttributeNameGroup',
'ldapPpolicyControl',
'ldapSetPassword',
'ldapChangePasswordAsUser',
'ldapPwdEnc',
'ldapUsePasswordResetAttribute',
'ldapPasswordResetAttribute',
'ldapPasswordResetAttributeValue'
],
'multiParams' => [
'multiAuthStack',
'multiUserDBStack'
],
'nullParams' => [
'nullAuthnLevel'
],
'oidcParams' => [
'oidcAuthnLevel',
'oidcRPCallbackGetParam',
'oidcRPStateTimeout'
],
'openidParams' => [
'openIdAuthnLevel',
'openIdExportedVars',
'openIdSecret',
'openIdIDPList'
],
'proxyParams' => [
'soapAuthService',
'remoteCookieName',
'soapSessionService'
],
'radiusParams' => [
'radiusAuthnLevel',
'radiusSecret',
'radiusServer'
],
'remoteParams' => [
'remotePortal',
'remoteCookieName',
'remoteGlobalStorage',
'remoteGlobalStorageOptions'
],
'slaveParams' => [
'slaveAuthnLevel',
'slaveExportedVars',
'slaveUserHeader',
'slaveMasterIP',
'slaveHeaderName',
'slaveHeaderContent'
],
'sslParams' => [
'SSLAuthnLevel',
'SSLVar'
],
'twitterParams' => [
'twitterAuthnLevel',
'twitterKey',
'twitterSecret',
'twitterAppName'
],
'webiDParams' => [
'webIDAuthnLevel',
'webIDExportedVars',
'webIDWhitelist'
],
'yubikeyParams' => [
'yubikeyAuthnLevel',
'yubikeyClientID',
'yubikeySecretKey',
'yubikeyPublicIDSize'
]
};
apacheParams => [qw(apacheAuthnLevel)],
adParams => [qw(ADPwdMaxAge ADPwdExpireWarning)],
yubikeyParams => [qw(yubikeyAuthnLevel yubikeyClientID yubikeySecretKey yubikeyPublicIDSize)],
openidParams => [qw(openIdAuthnLevel openIdExportedVars openIdSecret openIdIDPList)],
dbiParams => [qw(dbiAuthnLevel dbiExportedVars dbiAuthChain dbiAuthUser dbiAuthPassword dbiUserChain dbiUserUser dbiUserPassword dbiAuthTable dbiUserTable dbiAuthLoginCol dbiAuthPasswordCol dbiPasswordMailCol userPivot dbiAuthPasswordHash)],
multiParams => [qw(multiAuthStack multiUserDBStack)],
choiceParams => [qw(authChoiceParam authChoiceModules)],
browseridParams => [qw(browserIdAuthnLevel browserIdAutoLogin browserIdVerificationURL browserIdSiteName browserIdSiteLogo browserIdBackgroundColor)],
radiusParams => [qw(radiusAuthnLevel radiusSecret radiusServer)],
proxyParams => [qw(soapAuthService remoteCookieName soapSessionService)],
twitterParams => [qw(twitterAuthnLevel twitterKey twitterSecret twitterAppName)],
webiDParams => [qw(webIDAuthnLevel webIDExportedVars webIDWhitelist)],
casParams => [qw(CAS_authnLevel CAS_url CAS_CAFile CAS_renew CAS_gateway CAS_pgtFile CAS_proxiedServices)],
demoParams => [qw(demoExportedVars)],
facebookParams => [qw(facebookAuthnLevel facebookExportedVars facebookAppId facebookAppSecret)],
nullParams => [qw(nullAuthnLevel)],
remoteParams => [qw(remotePortal remoteCookieName remoteGlobalStorage remoteGlobalStorageOptions)],
googleParams => [qw(googleAuthnLevel googleExportedVars)],
slaveParams => [qw(slaveAuthnLevel slaveExportedVars slaveUserHeader slaveMasterIP slaveHeaderName slaveHeaderContent)],
sslParams => [qw(SSLAuthnLevel SSLVar)],
oidcParams => [qw(oidcAuthnLevel oidcRPCallbackGetParam oidcRPStateTimeout)],
ldapParams => [qw(ldapAuthnLevel ldapExportedVars ldapServer ldapPort ldapBase managerDn managerPassword ldapTimeout ldapVersion ldapRaw LDAPFilter AuthLDAPFilter mailLDAPFilter ldapSearchDeref ldapGroupBase ldapGroupObjectClass ldapGroupAttributeName ldapGroupAttributeNameUser ldapGroupAttributeNameSearch ldapGroupRecursive ldapGroupAttributeNameGroup ldapPpolicyControl ldapSetPassword ldapChangePasswordAsUser ldapPwdEnc ldapUsePasswordResetAttribute ldapPasswordResetAttribute ldapPasswordResetAttributeValue)],
};
1;