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 @sessionTypes;
my @simpleHashKeys; my @simpleHashKeys;
my $authParams; my $authParams;
my $issuerParams;
my $samlServiceParams;
my $oidcServiceParams;
my $attributes = Lemonldap::NG::Manager::Build::Attributes::attributes(); my $attributes = Lemonldap::NG::Manager::Build::Attributes::attributes();
my $jsonEnc = JSON->new()->allow_nonref; my $jsonEnc = JSON->new()->allow_nonref;
@ -190,9 +193,12 @@ EOF
print F "our \$${_}Keys = '$cnodesRe{$_}';\n"; print F "our \$${_}Keys = '$cnodesRe{$_}';\n";
} }
$tmp = Dumper($authParams); $tmp = "our \$authParameters = {\n";
$tmp =~ s/VAR1/authParameters/s; while(my($k,$v) = each %$authParams) {
print F "\nour $tmp\n"; $tmp .= " $k => [qw(".join(' ',@$v).")],\n";
}
print F "\n$tmp};\n";
print F "\n1;\n"; print F "\n1;\n";
close F; close F;
@ -413,7 +419,6 @@ sub scanTree {
my @cn = $self->scanLeaf( $sn->{nodes} ); my @cn = $self->scanLeaf( $sn->{nodes} );
$authParams->{$sn->{title}} = \@cn; $authParams->{$sn->{title}} = \@cn;
} }
print STDERR Dumper($authParams);
foreach my $sn ( @{ $jleaf->{"_$n"} } ) { foreach my $sn ( @{ $jleaf->{"_$n"} } ) {
$sn->{show} = 'false'; $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 $virtualHostKeys = '(?:vhost(?:(?:Aliase|Http)s|Maintenance|Port)|(?:exportedHeader|locationRule)s|post)';
our $authParameters = { our $authParameters = {
'adParams' => [ apacheParams => [qw(apacheAuthnLevel)],
'ADPwdMaxAge', adParams => [qw(ADPwdMaxAge ADPwdExpireWarning)],
'ADPwdExpireWarning' yubikeyParams => [qw(yubikeyAuthnLevel yubikeyClientID yubikeySecretKey yubikeyPublicIDSize)],
], openidParams => [qw(openIdAuthnLevel openIdExportedVars openIdSecret openIdIDPList)],
'apacheParams' => [ dbiParams => [qw(dbiAuthnLevel dbiExportedVars dbiAuthChain dbiAuthUser dbiAuthPassword dbiUserChain dbiUserUser dbiUserPassword dbiAuthTable dbiUserTable dbiAuthLoginCol dbiAuthPasswordCol dbiPasswordMailCol userPivot dbiAuthPasswordHash)],
'apacheAuthnLevel' multiParams => [qw(multiAuthStack multiUserDBStack)],
], choiceParams => [qw(authChoiceParam authChoiceModules)],
'browseridParams' => [ browseridParams => [qw(browserIdAuthnLevel browserIdAutoLogin browserIdVerificationURL browserIdSiteName browserIdSiteLogo browserIdBackgroundColor)],
'browserIdAuthnLevel', radiusParams => [qw(radiusAuthnLevel radiusSecret radiusServer)],
'browserIdAutoLogin', proxyParams => [qw(soapAuthService remoteCookieName soapSessionService)],
'browserIdVerificationURL', twitterParams => [qw(twitterAuthnLevel twitterKey twitterSecret twitterAppName)],
'browserIdSiteName', webiDParams => [qw(webIDAuthnLevel webIDExportedVars webIDWhitelist)],
'browserIdSiteLogo', casParams => [qw(CAS_authnLevel CAS_url CAS_CAFile CAS_renew CAS_gateway CAS_pgtFile CAS_proxiedServices)],
'browserIdBackgroundColor' demoParams => [qw(demoExportedVars)],
], facebookParams => [qw(facebookAuthnLevel facebookExportedVars facebookAppId facebookAppSecret)],
'casParams' => [ nullParams => [qw(nullAuthnLevel)],
'CAS_authnLevel', remoteParams => [qw(remotePortal remoteCookieName remoteGlobalStorage remoteGlobalStorageOptions)],
'CAS_url', googleParams => [qw(googleAuthnLevel googleExportedVars)],
'CAS_CAFile', slaveParams => [qw(slaveAuthnLevel slaveExportedVars slaveUserHeader slaveMasterIP slaveHeaderName slaveHeaderContent)],
'CAS_renew', sslParams => [qw(SSLAuthnLevel SSLVar)],
'CAS_gateway', oidcParams => [qw(oidcAuthnLevel oidcRPCallbackGetParam oidcRPStateTimeout)],
'CAS_pgtFile', 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)],
'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'
]
};
1; 1;