Add Max2FDevices & Max2FDevicesNameLength attributes (#1386)

This commit is contained in:
Christophe Maudoux 2018-04-04 23:14:25 +02:00
parent 3006b75445
commit 2185f0ef27
4 changed files with 39 additions and 15 deletions

View File

@ -24,6 +24,8 @@ portalSkin = bootstrap
staticPrefix = /static staticPrefix = /static
languages = fr, en, vi, it, ar languages = fr, en, vi, it, ar
templateDir = __pwd__/lemonldap-ng-portal/site/templates templateDir = __pwd__/lemonldap-ng-portal/site/templates
max2FDevices = 10
max2FDevicesNameLength = 20
;totp2fActivation = 1 ;totp2fActivation = 1
;totp2fSelfRegistration = 1 ;totp2fSelfRegistration = 1

View File

@ -119,6 +119,8 @@ sub defaultValues {
'mailUrl' => 'http://auth.example.com/resetpwd', 'mailUrl' => 'http://auth.example.com/resetpwd',
'managerDn' => '', 'managerDn' => '',
'managerPassword' => '', 'managerPassword' => '',
'max2FDevices' => 10,
'max2FDevicesNameLength' => 20,
'multiValuesSeparator' => '; ', 'multiValuesSeparator' => '; ',
'notificationStorage' => 'File', 'notificationStorage' => 'File',
'notificationStorageOptions' => { 'notificationStorageOptions' => {

View File

@ -27,7 +27,7 @@ sub types {
BEGIN { BEGIN {
${^WARNING_BITS} = ${^WARNING_BITS} =
"\x54\x55\x55\x55\x15\x55\x55\x55\x55\x55\x51\x55\x55\x55\x55\x55\x55\x01"; "\x54\x55\x55\x55\x15\x55\x55\x55\x55\x55\x51\x55\x55\x55\x55\x55\x55\x05";
} }
eval "$s $val"; eval "$s $val";
my $err = join( my $err = join(
@ -662,7 +662,7 @@ sub attributes {
BEGIN { BEGIN {
${^WARNING_BITS} = ${^WARNING_BITS} =
"\x54\x55\x55\x55\x15\x55\x55\x55\x55\x55\x51\x55\x55\x55\x55\x55\x55\x01"; "\x54\x55\x55\x55\x15\x55\x55\x55\x55\x55\x51\x55\x55\x55\x55\x55\x55\x05";
} }
eval "$s $val"; eval "$s $val";
my $err = join( my $err = join(
@ -1026,7 +1026,7 @@ qr/^(?:\*\.)?(?:(?:(?:(?:[a-zA-Z0-9][-a-zA-Z0-9]*)?[a-zA-Z0-9])[.])*(?:[a-zA-Z][
BEGIN { BEGIN {
${^WARNING_BITS} = ${^WARNING_BITS} =
"\x54\x55\x55\x55\x15\x55\x55\x55\x55\x55\x51\x55\x55\x55\x55\x55\x55\x01"; "\x54\x55\x55\x55\x15\x55\x55\x55\x55\x55\x51\x55\x55\x55\x55\x55\x55\x05";
} }
eval $s; eval $s;
my $err = join( my $err = join(
@ -1111,7 +1111,7 @@ qr/^(?:\*\.)?(?:(?:(?:(?:[a-zA-Z0-9][-a-zA-Z0-9]*)?[a-zA-Z0-9])[.])*(?:[a-zA-Z][
BEGIN { BEGIN {
${^WARNING_BITS} = ${^WARNING_BITS} =
"\x54\x55\x55\x55\x15\x55\x55\x55\x55\x55\x51\x55\x55\x55\x55\x55\x55\x01"; "\x54\x55\x55\x55\x15\x55\x55\x55\x55\x55\x51\x55\x55\x55\x55\x55\x55\x05";
} }
eval "$s $val"; eval "$s $val";
my $err = join( my $err = join(
@ -1134,7 +1134,7 @@ qr/^(?:\*\.)?(?:(?:(?:(?:[a-zA-Z0-9][-a-zA-Z0-9]*)?[a-zA-Z0-9])[.])*(?:[a-zA-Z][
BEGIN { BEGIN {
${^WARNING_BITS} = ${^WARNING_BITS} =
"\x54\x55\x55\x55\x15\x55\x55\x55\x55\x55\x51\x55\x55\x55\x55\x55\x55\x01"; "\x54\x55\x55\x55\x15\x55\x55\x55\x55\x55\x51\x55\x55\x55\x55\x55\x55\x05";
} }
eval "$s $val"; eval "$s $val";
my $err = join( my $err = join(
@ -1489,7 +1489,7 @@ qr/^(?:\*\.)?(?:(?:(?:(?:[a-zA-Z0-9][-a-zA-Z0-9]*)?[a-zA-Z0-9])[.])*(?:[a-zA-Z][
BEGIN { BEGIN {
${^WARNING_BITS} = ${^WARNING_BITS} =
"\x54\x55\x55\x55\x15\x55\x55\x55\x55\x55\x51\x55\x55\x55\x55\x55\x55\x01"; "\x54\x55\x55\x55\x15\x55\x55\x55\x55\x55\x51\x55\x55\x55\x55\x55\x55\x05";
} }
eval $s; eval $s;
my $err = join( my $err = join(
@ -1526,7 +1526,7 @@ qr/^(?:\*\.)?(?:(?:(?:(?:[a-zA-Z0-9][-a-zA-Z0-9]*)?[a-zA-Z0-9])[.])*(?:[a-zA-Z][
BEGIN { BEGIN {
${^WARNING_BITS} = ${^WARNING_BITS} =
"\x54\x55\x55\x55\x15\x55\x55\x55\x55\x55\x51\x55\x55\x55\x55\x55\x55\x01"; "\x54\x55\x55\x55\x15\x55\x55\x55\x55\x55\x51\x55\x55\x55\x55\x55\x55\x05";
} }
eval "$s $val"; eval "$s $val";
my $err = join( my $err = join(
@ -1596,6 +1596,14 @@ qr/^(?:\*\.)?(?:(?:(?:(?:[a-zA-Z0-9][-a-zA-Z0-9]*)?[a-zA-Z0-9])[.])*(?:[a-zA-Z][
'test' => qr/^\S*$/, 'test' => qr/^\S*$/,
'type' => 'password' 'type' => 'password'
}, },
'max2FDevices' => {
'default' => 10,
'type' => 'int'
},
'max2FDevicesNameLength' => {
'default' => 20,
'type' => 'int'
},
'multiValuesSeparator' => { 'multiValuesSeparator' => {
'default' => '; ', 'default' => '; ',
'type' => 'authParamsText' 'type' => 'authParamsText'
@ -1877,7 +1885,7 @@ qr/^(?:\*\.)?(?:(?:(?:(?:[a-zA-Z0-9][-a-zA-Z0-9]*)?[a-zA-Z0-9])[.])*(?:[a-zA-Z][
BEGIN { BEGIN {
${^WARNING_BITS} = ${^WARNING_BITS} =
"\x54\x55\x55\x55\x15\x55\x55\x55\x55\x55\x51\x55\x55\x55\x55\x55\x55\x01"; "\x54\x55\x55\x55\x15\x55\x55\x55\x55\x55\x51\x55\x55\x55\x55\x55\x55\x05";
} }
eval "$s $val"; eval "$s $val";
my $err = join( my $err = join(
@ -2214,7 +2222,7 @@ qr/^(?:\*\.)?(?:(?:(?:(?:[a-zA-Z0-9][-a-zA-Z0-9]*)?[a-zA-Z0-9])[.])*(?:[a-zA-Z][
BEGIN { BEGIN {
${^WARNING_BITS} = ${^WARNING_BITS} =
"\x54\x55\x55\x55\x15\x55\x55\x55\x55\x55\x51\x55\x55\x55\x55\x55\x55\x01"; "\x54\x55\x55\x55\x15\x55\x55\x55\x55\x55\x51\x55\x55\x55\x55\x55\x55\x05";
} }
eval "$s $val"; eval "$s $val";
my $err = join( my $err = join(
@ -2917,7 +2925,7 @@ qr/(?:(?:https?):\/\/(?:(?:(?:(?:(?:(?:[a-zA-Z0-9][-a-zA-Z0-9]*)?[a-zA-Z0-9])[.]
BEGIN { BEGIN {
${^WARNING_BITS} = ${^WARNING_BITS} =
"\x54\x55\x55\x55\x15\x55\x55\x55\x55\x55\x51\x55\x55\x55\x55\x55\x55\x01"; "\x54\x55\x55\x55\x15\x55\x55\x55\x55\x55\x51\x55\x55\x55\x55\x55\x55\x05";
} }
eval "$s $val"; eval "$s $val";
my $err = join( my $err = join(
@ -2996,19 +3004,19 @@ qr/(?:(?:https?):\/\/(?:(?:(?:(?:(?:(?:[a-zA-Z0-9][-a-zA-Z0-9]*)?[a-zA-Z0-9])[.]
'default' => 0, 'default' => 0,
'select' => [ 'select' => [
{ {
'k' => '0', 'k' => 0,
'v' => 'unsecuredCookie' 'v' => 'unsecuredCookie'
}, },
{ {
'k' => '1', 'k' => 1,
'v' => 'securedCookie' 'v' => 'securedCookie'
}, },
{ {
'k' => '2', 'k' => 2,
'v' => 'doubleCookie' 'v' => 'doubleCookie'
}, },
{ {
'k' => '3', 'k' => 3,
'v' => 'doubleCookieForSingleSession' 'v' => 'doubleCookieForSingleSession'
} }
], ],

View File

@ -1055,6 +1055,18 @@ sub attributes {
documentation => 'Upgrade session activation', documentation => 'Upgrade session activation',
}, },
# 2F
max2FDevices => {
default => 10,
type => 'int',
documentation => 'Register session timeout',
},
max2FDevicesNameLength => {
default => 20,
type => 'int',
documentation => 'Register session timeout',
},
# U2F # U2F
u2fActivation => { u2fActivation => {
type => 'boolOrExpr', type => 'boolOrExpr',