Commit 9cb56173 authored by Clément OUDOT's avatar Clément OUDOT

Configure timeout for configuration reload (#1553)

parent ef5b4bcc
......@@ -193,6 +193,7 @@ sub defaultValues {
'registerDB' => 'Null',
'registerTimeout' => 0,
'registerUrl' => 'http://auth.example.com/register',
'reloadTimeout' => 5,
'remoteGlobalStorage' => 'Lemonldap::NG::Common::Apache::Session::SOAP',
'remoteGlobalStorageOptions' => {
'ns' =>
......
......@@ -8,17 +8,17 @@ sub types {
'array' => {
'test' => sub {
1;
}
}
},
'authParamsText' => {
'test' => sub {
1;
}
}
},
'blackWhiteList' => {
'test' => sub {
1;
}
}
},
'bool' => {
'msgFail' => '__notABoolean__',
......@@ -36,17 +36,17 @@ sub types {
split( /\n/, $@, 0 ) )
);
return $err ? ( 1, "__badExpression__: $err" ) : 1;
}
}
},
'catAndAppList' => {
'test' => sub {
1;
}
}
},
'file' => {
'test' => sub {
1;
}
}
},
'hostname' => {
'form' => 'text',
......@@ -80,48 +80,48 @@ qr/^(?:(?:(?:(?:(?:(?:[a-zA-Z0-9][-a-zA-Z0-9]*)?[a-zA-Z0-9])[.])*(?:[a-zA-Z][-a-
if $_ =~ /exportedvars$/i and defined $conf->{$_}{$val};
}
return 1, "__unknownAttrOrMacro__: $val";
}
}
},
'longtext' => {
'test' => sub {
1;
}
}
},
'menuApp' => {
'test' => sub {
1;
}
}
},
'menuCat' => {
'test' => sub {
1;
}
}
},
'oidcmetadatajson' => {
'test' => sub {
1;
}
}
},
'oidcmetadatajwks' => {
'test' => sub {
1;
}
}
},
'oidcOPMetaDataNode' => {
'test' => sub {
1;
}
}
},
'oidcRPMetaDataNode' => {
'test' => sub {
1;
}
}
},
'password' => {
'msgFail' => '__malformedValue__',
'test' => sub {
1;
}
}
},
'pcre' => {
'form' => 'text',
......@@ -132,7 +132,7 @@ qr/^(?:(?:(?:(?:(?:(?:[a-zA-Z0-9][-a-zA-Z0-9]*)?[a-zA-Z0-9])[.])*(?:[a-zA-Z][-a-
}
};
return $@ ? ( 0, "__badRegexp__: $@" ) : 1;
}
}
},
'PerlModule' => {
'form' => 'text',
......@@ -142,17 +142,17 @@ qr/^(?:(?:(?:(?:(?:(?:[a-zA-Z0-9][-a-zA-Z0-9]*)?[a-zA-Z0-9])[.])*(?:[a-zA-Z][-a-
'portalskin' => {
'test' => sub {
1;
}
}
},
'portalskinbackground' => {
'test' => sub {
1;
}
}
},
'post' => {
'test' => sub {
1;
}
}
},
'RSAPrivateKey' => {
'test' => sub {
......@@ -160,7 +160,7 @@ qr/^(?:(?:(?:(?:(?:(?:[a-zA-Z0-9][-a-zA-Z0-9]*)?[a-zA-Z0-9])[.])*(?:[a-zA-Z][-a-
m[^(?:(?:\-+\s*BEGIN\s+(?:RSA\s+)?PRIVATE\s+KEY\s*\-+\r?\n)?(?:Proc-Type:.*\r?\nDEK-Info:.*\r?\n[\r\n]*)?[a-zA-Z0-9/\+\r\n]+={0,2}(?:\r?\n\-+\s*END\s+(?:RSA\s+)PRIVATE\s+KEY\s*\-+)?[\r\n]*)?$]s
? 1
: ( 1, '__badPemEncoding__' );
}
}
},
'RSAPublicKey' => {
'test' => sub {
......@@ -168,7 +168,7 @@ m[^(?:(?:\-+\s*BEGIN\s+(?:RSA\s+)?PRIVATE\s+KEY\s*\-+\r?\n)?(?:Proc-Type:.*\r?\n
m[^(?:(?:\-+\s*BEGIN\s+PUBLIC\s+KEY\s*\-+\r?\n)?[a-zA-Z0-9/\+\r\n]+={0,2}(?:\r?\n\-+\s*END\s+PUBLIC\s+KEY\s*\-+)?[\r\n]*)?$]s
? 1
: ( 1, '__badPemEncoding__' );
}
}
},
'RSAPublicKeyOrCertificate' => {
'test' => sub {
......@@ -176,37 +176,37 @@ m[^(?:(?:\-+\s*BEGIN\s+PUBLIC\s+KEY\s*\-+\r?\n)?[a-zA-Z0-9/\+\r\n]+={0,2}(?:\r?\
m[^(?:(?:\-+\s*BEGIN\s+(?:PUBLIC\s+KEY|CERTIFICATE)\s*\-+\r?\n)?[a-zA-Z0-9/\+\r\n]+={0,2}(?:\r?\n\-+\s*END\s+(?:PUBLIC\s+KEY|CERTIFICATE)\s*\-+)?[\r\n]*)?$]s
? 1
: ( 1, '__badPemEncoding__' );
}
}
},
'rule' => {
'test' => sub {
1;
}
}
},
'samlAssertion' => {
'test' => sub {
1;
}
}
},
'samlAttribute' => {
'test' => sub {
1;
}
}
},
'samlIDPMetaDataNode' => {
'test' => sub {
1;
}
}
},
'samlService' => {
'test' => sub {
1;
}
}
},
'samlSPMetaDataNode' => {
'test' => sub {
1;
}
}
},
'select' => {
'test' => sub {
......@@ -216,19 +216,19 @@ m[^(?:(?:\-+\s*BEGIN\s+(?:PUBLIC\s+KEY|CERTIFICATE)\s*\-+\r?\n)?[a-zA-Z0-9/\+\r\
return $test
? 1
: ( 1, "Invalid value '$_[0]' for this select" );
}
}
},
'subContainer' => {
'keyTest' => qr/\w/,
'test' => sub {
1;
}
}
},
'text' => {
'msgFail' => '__malformedValue__',
'test' => sub {
1;
}
}
},
'trool' => {
'msgFail' => '__authorizedValues__: -1, 0, 1',
......@@ -1054,7 +1054,7 @@ qr/^(?:\*\.)?(?:(?:(?:(?:[a-zA-Z0-9][-a-zA-Z0-9]*)?[a-zA-Z0-9])[.])*(?:[a-zA-Z][
split( /\n/, $@, 0 ) )
);
return $err ? ( 1, "__badExpression__: $err" ) : 1;
}
}
},
'type' => 'keyTextContainer'
},
......@@ -1227,7 +1227,7 @@ qr/^(?:(?:(?:(?:[a-zA-Z0-9][-a-zA-Z0-9]*)?[a-zA-Z0-9])[.])*(?:[a-zA-Z][-a-zA-Z0-
and defined $conf->{$_}{$val};
}
return 1, "__unknownAttrOrMacro__: $val";
}
}
},
'type' => 'doubleHash'
},
......@@ -1510,7 +1510,7 @@ qr/^(?:\*\.)?(?:(?:(?:(?:[a-zA-Z0-9][-a-zA-Z0-9]*)?[a-zA-Z0-9])[.])*(?:[a-zA-Z][
split( /\n/, $@, 0 ) )
);
return $err ? ( 1, "__badExpression__: $err" ) : 1;
}
}
},
'type' => 'ruleContainer'
},
......@@ -2367,6 +2367,10 @@ qr/^(?:\*\.)?(?:(?:(?:(?:[a-zA-Z0-9][-a-zA-Z0-9]*)?[a-zA-Z0-9])[.])*(?:[a-zA-Z][
'default' => 'http://auth.example.com/register',
'type' => 'text'
},
'reloadTimeout' => {
'default' => 5,
'type' => 'int'
},
'reloadUrls' => {
'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])[.]?)|(?:[0-9]+[.][0-9]+[.][0-9]+[.][0-9]+))(?::\d+)?$/,
......
......@@ -366,6 +366,12 @@ sub attributes {
default => 'get',
documentation => 'HTTP method for redirect page form',
},
reloadTimeout => {
type => 'int',
default => 5,
documentation => 'Configuration reload timeout',
flags => 'm',
},
reloadUrls => {
type => 'keyTextContainer',
help => 'configlocation.html#configuration_reload',
......@@ -404,13 +410,13 @@ sub attributes {
default => 0,
documentation => 'Enable CheckState plugin',
},
checkStateSecret => {
checkStateSecret => {
type => 'text',
documentation => 'Secret token for CheckState plugin',
},
skipRenewConfirmation => {
type => 'bool',
default => 0,
type => 'bool',
default => 0,
documentation =>
'Avoid asking confirmation when an Issuer asks to renew auth',
},
......@@ -625,9 +631,10 @@ sub attributes {
documentation => 'Default value for Content-Security-Policy',
},
cspFormAction => {
type => 'text',
default => "'self'",
documentation => 'Form action destination for Content-Security-Policy',
type => 'text',
default => "'self'",
documentation =>
'Form action destination for Content-Security-Policy',
},
cspImg => {
type => 'text',
......
......@@ -544,7 +544,10 @@ sub tree {
}
]
},
'reloadUrls',
{
title => 'reloadParams',
nodes => [ 'reloadUrls', 'reloadTimeout', ]
},
{
title => 'plugins',
help => 'start.html#plugins',
......
......@@ -332,7 +332,7 @@ sub applyConf {
}
return {} unless (%reloadUrls);
$self->ua->timeout(3);
$self->ua->timeout( $newConf->{reloadTimeout} );
# Parse apply values
while ( my ( $host, $request ) = each %reloadUrls ) {
......
......@@ -635,7 +635,9 @@
"registerDoneSubject":"عنوان البريد الذي تم القيام به",
"registerTimeout":"مدة صلاحية طلب التسجيل",
"registerUrl":"Page URL",
"reloadUrls":"إعادة تحميل الإعدادات",
"reloadParams":"إعادة تحميل الإعدادات",
"reloadTimeout":"Reload timeout",
"reloadUrls":"Reload URLs",
"remoteCookieName":"اسم ملف تعريف الارتباط",
"remoteGlobalStorage":"وحدة الجلسات",
"remoteGlobalStorageOptions":"خيارات وحدة الجلسات",
......
......@@ -635,7 +635,9 @@
"registerDoneSubject":"Subject for done mail",
"registerTimeout":"Validity time of a register request",
"registerUrl":"Page URL",
"reloadUrls":"Configuration reload",
"reloadParams":"Configuration reload",
"reloadTimeout":"Reload timeout",
"reloadUrls":"Reload URLs",
"remoteCookieName":"Cookie name",
"remoteGlobalStorage":"Sessions module",
"remoteGlobalStorageOptions":"Sessions module options",
......
......@@ -635,7 +635,9 @@
"registerDoneSubject":"Sujet du mail de prise en compte",
"registerTimeout":"Durée de validité de la requête",
"registerUrl":"URL de la page",
"reloadUrls":"Mise à jour de la configuration",
"reloadParams":"Mise à jour de la configuration",
"reloadTimeout":"Délai de mise à jour",
"reloadUrls":"URLs de mise à jour",
"remoteCookieName":"Nom du cookie",
"remoteGlobalStorage":"Module des sessions",
"remoteGlobalStorageOptions":"Options du module des sessions",
......
......@@ -635,7 +635,9 @@
"registerDoneSubject":"Oggetto per la mail inviata",
"registerTimeout":"Tempo di validità di una richiesta di registrazione",
"registerUrl":"Page URL",
"reloadUrls":"Ricarica di configurazione",
"reloadParams":"Ricarica di configurazione",
"reloadTimeout":"Reload timeout",
"reloadUrls":"Reload URLs",
"remoteCookieName":"Nome del cookie",
"remoteGlobalStorage":"Modulo di sessioni",
"remoteGlobalStorageOptions":"Opzioni del modulo Sessioni",
......
......@@ -635,7 +635,9 @@
"registerDoneSubject":"Tiêu đề cho thư đã hoàn tất",
"registerTimeout":"Thời hạn hiệu lực của yêu cầu đăng ký",
"registerUrl":"Page URL",
"reloadUrls":"Tải lại cấu hình",
"reloadParams":"Tải lại cấu hình",
"reloadTimeout":"Reload timeout",
"reloadUrls":"Reload URLs",
"remoteCookieName":"Tên cookie",
"remoteGlobalStorage":"Mô-đun phiên",
"remoteGlobalStorageOptions":"Tùy chọn mô-đun phiên",
......
This source diff could not be displayed because it is too large. You can view the blob instead.
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment