Add issuerDBGet parameters (#1025)

This commit is contained in:
Xavier Guimard 2016-06-03 11:34:14 +00:00
parent 98139efb1e
commit e370416bc1
8 changed files with 154 additions and 8 deletions

View File

@ -71,6 +71,10 @@ sub defaultValues {
'issuerDBCASActivation' => 0,
'issuerDBCASPath' => '^/cas/',
'issuerDBCASRule' => 1,
'issuerDBGetActivation' => 0,
'issuerDBGetParameters' => {},
'issuerDBGetPath' => '^/get/',
'issuerDBGetRule' => 1,
'issuerDBOpenIDActivation' => 0,
'issuerDBOpenIDConnectActivation' => 0,
'issuerDBOpenIDConnectPath' => '^/oauth2/',

View File

@ -969,6 +969,52 @@ qr/^(?:(?:(?:(?:[a-zA-Z0-9][-a-zA-Z0-9]*)?[a-zA-Z0-9])[.])*(?:[a-zA-Z][-a-zA-Z0-
'default' => 1,
'type' => 'boolOrExpr'
},
'issuerDBGetActivation' => {
'default' => 0,
'type' => 'bool'
},
'issuerDBGetParameters' => {
'default' => {},
'keyMsgFail' => '__badHostname__',
'keyTest' =>
qr/^(?:(?:(?:(?:[a-zA-Z0-9][-a-zA-Z0-9]*)?[a-zA-Z0-9])[.])*(?:[a-zA-Z][-a-zA-Z0-9]*[a-zA-Z0-9]|[a-zA-Z])[.]?)$/,
'test' => {
'keyMsgFail' => '__badKeyName__',
'keyTest' => qr/^(?=[^\-])[\w\-]+(?<=[^-])$/,
'test' => sub {
my ( $val, $conf ) = @_;
my $s = $val;
my (@cf) = (
'encode_base64', 'checkLogonHours',
'date', 'checkDate',
'basic', 'unicode2iso',
'iso2unicode', 'groupMatch',
'encrypt'
);
push @cf, defined $conf->{'customFunctions'}
? map( {
my $f = $_;
$f =~ s/\w+:://g;
$f, $_;
} split( /\s+/, $conf->{'customFunctions'}, 0 ) )
: ();
foreach my $f (@cf) {
$s = "sub $f {1} $s";
}
eval $s;
return $@ ? ( 1, "__badExpression__: $@" ) : 1;
}
},
'type' => 'doubleHash'
},
'issuerDBGetPath' => {
'default' => '^/get/',
'type' => 'text'
},
'issuerDBGetRule' => {
'default' => 1,
'type' => 'boolOrExpr'
},
'issuerDBOpenIDActivation' => {
'default' => 0,
'type' => 'bool'

View File

@ -639,8 +639,8 @@ sub attributes {
documentation => 'Captcha size',
},
#captcha_data => {
#captcha_output => {
#captcha_data
#captcha_output
captchaStorage => {
type => 'PerlModule',
default => 'Apache::Session::File',
@ -758,6 +758,50 @@ sub attributes {
documentation => 'OpenID Connect server rule',
},
# GET issuer
issuerDBGetActivation => {
type => 'bool',
default => '0',
documentation => 'Get issuer activation',
},
issuerDBGetPath => {
type => 'text',
default => '^/get/',
documentation => 'Get issuer request path',
},
issuerDBGetRule => {
type => 'boolOrExpr',
default => 1,
documentation => 'Get issuer rule',
},
issuerDBGetParameters => {
type => 'doubleHash',
default => {},
keyTest => qr/^$Regexp::Common::URI::RFC2396::hostname$/,
keyMsgFail => '__badHostname__',
test => {
keyTest => qr/^(?=[^\-])[\w\-]+(?<=[^-])$/,
keyMsgFail => '__badKeyName__',
test => sub {
my ( $val, $conf ) = @_;
my $s = $val;
my @cf =
qw(encode_base64 checkLogonHours date checkDate basic unicode2iso iso2unicode groupMatch encrypt);
push @cf,
defined $conf->{customFunctions}
? map { my $f = $_; $f =~ s/\w+:://g; ( $f, $_ ) }
split( /\s+/, $conf->{customFunctions} )
: ();
foreach my $f (@cf) {
$s = "sub $f {1} $s";
}
eval $s;
return $@ ? ( 1, "__badExpression__: $@" ) : (1);
},
},
documentation => 'List of virtualHosts with their get parameters',
},
# Password
mailOnPasswordChange => {
default => 0,
@ -2141,9 +2185,12 @@ m{^(?:ldapi://[^/]*/?|\w[\w\-\.]*(?::\d{1,5})?|ldap(?:s|\+tls)?://\w[\w\-\.]*(?:
documentation => 'Browser ID authentication level',
},
browserIdAutoLogin => { type => 'bool', default => 0 },
browserIdVerificationURL => { type => 'text', default => 'https://verifier.login.persona.org/verify', },
browserIdSiteName => { type => 'text', default => 'LemonLDAP::NG', },
browserIdSiteLogo => { type => 'text', },
browserIdVerificationURL => {
type => 'text',
default => 'https://verifier.login.persona.org/verify',
},
browserIdSiteName => { type => 'text', default => 'LemonLDAP::NG', },
browserIdSiteLogo => { type => 'text', },
browserIdBackgroundColor => { type => 'text', default => '#000', },
# OpenID Connect auth params

View File

@ -428,7 +428,16 @@ sub tree {
'issuerDBOpenIDConnectPath',
'issuerDBOpenIDConnectRule',
]
}
},
{
title => 'issuerDBGet',
nodes => [
'issuerDBGetActivation',
'issuerDBGetPath',
'issuerDBGetRule',
'issuerDBGetParameters'
]
},
]
},
{

View File

@ -55,6 +55,7 @@ our $authParameters = {
};
our $issuerParameters = {
issuerDBCAS => [qw(issuerDBCASActivation issuerDBCASPath issuerDBCASRule casAttr casAttributes casAccessControlPolicy casStorage casStorageOptions)],
issuerDBGet => [qw(issuerDBGetActivation issuerDBGetPath issuerDBGetRule issuerDBGetParameters)],
issuerDBOpenID => [qw(issuerDBOpenIDActivation issuerDBOpenIDPath issuerDBOpenIDRule openIdIssuerSecret openIdAttr openIdSPList openIdSreg_fullname openIdSreg_nickname openIdSreg_language openIdSreg_postcode openIdSreg_timezone openIdSreg_country openIdSreg_gender openIdSreg_email openIdSreg_dob)],
issuerDBOpenIDConnect => [qw(issuerDBOpenIDConnectActivation issuerDBOpenIDConnectPath issuerDBOpenIDConnectRule)],
issuerDBSAML => [qw(issuerDBSAMLActivation issuerDBSAMLPath issuerDBSAMLRule)],

View File

@ -0,0 +1,39 @@
<!--
Special container to show hash in hash
-->
<div class="panel panel-default">
<div class="panel-heading">
<h3 class="panel-title">{{translateTitle(currentNode)}}</h3>
</div>
<div class="panel-body" ng-repeat="(n,h) in currentNode.nodes">
<div class="input-group">
<span class="input-group-addon" trspan="hostname"></span>
<input type="text" class="form-control"/>
</div>
<table class="table table-striped">
<thead>
<tr><th width="40%" trspan="keys"></th><th width="40%" trspan="values"></th><th></th></tr>
</thead>
<tbody>
<tr ng-repeat="(k,v) in h">
<td><input class="form-control" ng-model="k"/></td>
<td><input class="form-control" ng-model="v"/></td>
<td><span class="link text-success glyphicon glyphicon-plus-sign" ng-click="h.push({'new':'new'})"/></td>
<td>
<span class="link text-danger glyphicon glyphicon-minus-sign" ng-click="delete h[k]"/>
<span ng-if="$last" class="link text-success glyphicon glyphicon-plus-sign" ng-click="h.push({'new':'new'})"/>
</td>
</tr>
</tbody>
</table>
</div>
</div>
<script type="text/menu">
[{
'title': 'newHost',
'action': function(cn,scope){
cn.push({"newHost":{"new":"value"}});
},
'icon': 'plus-sign'
}]
</script>

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long