Commit 2f3f1bd9 authored by Xavier Guimard's avatar Xavier Guimard

Merge branch 'v2.0'

parents bd94c557 974007ec
Pipeline #5042 passed with stages
in 11 minutes and 16 seconds
......@@ -183,7 +183,7 @@ staticPrefix = __PORTALSTATICDIR__
templateDir = __PORTALTEMPLATESDIR__
; languages: available languages for portal interface
languages = en, fr, vi, it, ar
languages = en, fr, vi, it, ar, de, fi
; II - Optional parameters (overwrite configuration)
......@@ -354,7 +354,7 @@ staticPrefix = __MANAGERSTATICDIR__
templateDir = __MANAGERTEMPLATESDIR__
; languages: available languages for manager interface
languages = fr, en, vi, ar
languages = fr, en, it, vi, ar
; Manager modules enabled
; Set here the list of modules you want to see in manager interface
......
......@@ -53,6 +53,14 @@ sub logLevelInit {
my $logger = $class->localConfig->{logger} ||= $class->defaultLogger;
eval "require $logger";
die $@ if ($@);
unless (
$class->localConfig->{logLevel} =~ /^(debug|info|notice|warn|error)$/ )
{
print STDERR 'Bad logLevel value \''
. $class->localConfig->{logLevel}
. "', switching to 'info'\n";
$class->localConfig->{logLevel} = 'info';
}
$class->logger( $logger->new( $class->localConfig ) );
$class->logger->debug("Logger $logger loaded");
$logger = $class->localConfig->{userLogger} || $logger;
......
......@@ -847,7 +847,7 @@
"yubikey2fNonce":"Nonce",
"yubikey2fPublicIDSize":"حجم الجزء العام لي OTP آي دي",
"yubikey2fSecretKey":"مفتاح سرأل API",
"yubikey2fSelfRegistration":"Self registration",
"yubikey2fSelfRegistration":"التسجيل الذاتي",
"yubikey2fUrl":"خدمة أل يو أر ل",
"yubikey2fUserCanRemoveKey":"Authorize user to remove Yubikey",
"zeroConfExplanations":"لا يحتوي الخادم على إعدادات. استخدام قالب لحفظ الأول",
......
......@@ -150,10 +150,10 @@
"cfgVersion":"配置信息",
"checkXSS":"Check XSS attacks",
"clickHereToForce":"Click here to force",
"checkState":"Activation",
"checkState":"激活",
"checkStateSecret":"Shared secret",
"checkUsers":"SSO profile Check",
"checkUser":"Activation",
"checkUser":"激活",
"checkUserIdRule":"Identities use rule",
"checkUserHiddenAttributes":"Hidden attributes",
"checkUserDisplayPersistentInfo":"Display persistent session",
......@@ -388,7 +388,7 @@
"localSessionStorageOptions":"Cache module options",
"locationRules":"Access rule",
"loginHistory":"登陆记录",
"loginHistoryEnabled":"Activation",
"loginHistoryEnabled":"激活",
"logo":"Logo",
"logout":"注销登录",
"logoutServices":"Logout forward",
......@@ -397,7 +397,7 @@
"lwpSslOpts":"SSL options for server requests",
"macros":"Macros",
"mail2f":"Mail second factor",
"mail2fActivation":"Activation",
"mail2fActivation":"激活",
"mail2fCodeRegex":"Code regex",
"mail2fTimeout":"Code timeout",
"mail2fSubject":"Mail subject",
......@@ -458,7 +458,7 @@
"notABoolean":"Not a boolean",
"notAnInteger":"Not an integer",
"notAValidPerlExpression":"Not a valid Perl expression",
"notification":"Activation",
"notification":"激活",
"notifications":"Notifications",
"notificationServer":"Notification server",
"notificationCreated":"Notification has been created",
......@@ -679,7 +679,7 @@
"restore":"Restore",
"restoreConf":"Restore configuration",
"rest2f":"REST second factor",
"rest2fActivation":"Activation",
"rest2fActivation":"激活",
"rest2fAuthnLevel":"认证等级",
"rest2fInitArgs":"Init Arguments",
"rest2fInitUrl":"Init URL",
......@@ -763,7 +763,7 @@
"timeoutActivityInterval":"Sessions update interval",
"tokenUseGlobalStorage":"Use global storage",
"totp":"TOTP",
"totp2fActivation":"Activation",
"totp2fActivation":"激活",
"totp2fAuthnLevel":"TOTP authentication level",
"totp2fDigits":"Number of digits",
"totp2fDisplayExistingSecret":"Display existing secret",
......@@ -783,7 +783,7 @@
"twitterUserField":"Field containing user identifier",
"type":"Type",
"u2f":"U2F",
"u2fActivation":"Activation",
"u2fActivation":"激活",
"u2fAuthnLevel":"U2F authentication level",
"u2fUserCanRemoveKey":"Authorize user to remove U2F key",
"u2fSelfRegistration":"Self registration",
......@@ -808,7 +808,7 @@
"useRedirectOnForbidden":"Redirect on forbidden",
"useSafeJail":"Use Safe jail",
"utotp2f":"TOTP-or-U2F",
"utotp2fActivation":"Activation",
"utotp2fActivation":"激活",
"utotp2fAuthnLevel":"认证等级",
"value":"Value",
"values":"Values",
......@@ -838,10 +838,10 @@
"waitOrF5":"Wait for redirection or press F5",
"whatToTrace":"REMOTE_USER",
"whiteList":"White list",
"wsdlServer":"WSDL server",
"wsdlServer":"WSDL 服务器",
"XMLcontent":"XML content",
"yubikey2f":"Yubikey",
"yubikey2fActivation":"Activation",
"yubikey2fActivation":"激活",
"yubikey2fAuthnLevel":"认证等级",
"yubikey2fClientID":"API client ID",
"yubikey2fNonce":"Nonce",
......@@ -855,7 +855,7 @@
"saml":"SAML",
"samlAttribute":"SAML attribute",
"samlDiscoveryProtocol":"Discovery Protocol",
"samlDiscoveryProtocolActivation":"Activation",
"samlDiscoveryProtocolActivation":"激活",
"samlDiscoveryProtocolIsPassive":"Is Passive",
"samlDiscoveryProtocolPolicy":"Policy",
"samlDiscoveryProtocolURL":"EndPoint URL",
......@@ -979,7 +979,7 @@
"samlAuthnContextMapTLSClient":"TLS client",
"samlAuthnContextMapKerberos":"Kerberos",
"samlCommonDomainCookie":"Common Domain Cookie",
"samlCommonDomainCookieActivation":"Activation",
"samlCommonDomainCookieActivation":"激活",
"samlCommonDomainCookieDomain":"Common domain",
"samlCommonDomainCookieReader":"Reader URL",
"samlCommonDomainCookieWriter":"Writer URL",
......
This diff is collapsed.
{
"accountCreated":"Tunnus on luotu, väliaikainen salasana on lähetetty sähköpostiisi.",
"autoMail":"Tämä sähköpostiviesti lähetetään automaattisesti",
"click2Register":"Klikkaa tästä vahvistaaksesi käyttäjätunnuksesi rekisteröinnin",
"click2Reset":"Klikkaa tästä nollataksesi salasanasi",
"hello":"Hei",
"mail2fSubject":"[LemonLDAP::NG] Your login code",
"mailConfirmSubject":"[LemonLDAP::NG] Salasanan nollauksen vahvistus",
"mailSubject":"[LemonLDAP::NG] Uusi salasanasi",
"newPwdIs":"Uusi salasanasi on",
"pwdChanged":"Salasanasi on vaihdettu.",
"pwdIs":"Sinun salasanasi on",
"registerConfirmSubject":"[LemonLDAP::NG] Tunnuksen rekisteröinnin vahvistus",
"registerDoneSubject":"[LemonLDAP::NG] Uusi käyttäjätunnuksesi",
"requestIssuedFromIP":"The request was issued from IP",
"yourLoginCodeIs":"Your login code is",
"yourLoginIs":"Your login is"
}
\ No newline at end of file
use lib 'inc';
use Test::More; # skip_all => 'CAS is in rebuild';
use strict;
use IO::String;
use LWP::UserAgent;
use LWP::Protocol::PSGI;
use MIME::Base64;
BEGIN {
require 't/test-lib.pm';
}
my $debug = 'error';
my ( $issuer, $sp, $res );
my %handlerOR = ( issuer => [], sp => [] );
# Redefine LWP methods for tests
LWP::Protocol::PSGI->register(
sub {
my $req = Plack::Request->new(@_);
ok( $req->uri =~ m#http://auth.((?:id|s)p).com([^\?]*)(?:\?(.*))?$#,
'SOAP request' );
my $host = $1;
my $url = $2;
my $query = $3;
my $res;
my $client = ( $host eq 'idp' ? $issuer : $sp );
if ( $req->method eq 'POST' ) {
my $s = $req->content;
ok(
$res = $client->_post(
$url, IO::String->new($s),
length => length($s),
query => $query,
type => 'application/xml',
),
"Execute POST request to $url"
);
}
else {
ok(
$res = $client->_get(
$url,
type => 'application/xml',
query => $query,
),
"Execute request to $url"
);
}
expectOK($res);
ok( getHeader( $res, 'Content-Type' ) =~ m#xml#, 'Content is XML' )
or explain( $res->[1], 'Content-Type => application/xml' );
count(3);
return $res;
}
);
ok( $issuer = issuer(), 'Issuer portal' );
$handlerOR{issuer} = \@Lemonldap::NG::Handler::Main::_onReload;
count(1);
switch ('sp');
&Lemonldap::NG::Handler::Main::cfgNum( 0, 0 );
ok( $sp = sp(), 'SP portal' );
count(1);
$handlerOR{sp} = \@Lemonldap::NG::Handler::Main::_onReload;
# Simple SP access
ok(
$res = $sp->_get(
'/', accept => 'text/html',
),
'Unauth SP request'
);
count(1);
# No cancel button found
ok(
$res->[2]->[0] !~
qr%<a href="http://auth.sp.com\?cancel=1" class="btn btn-primary" role="button">%,
'Cancel button NOT found'
) or print STDERR Dumper( $res->[2]->[0] );
count(1);
# Query IdP
switch ('issuer');
ok(
$res = $issuer->_get(
'/cas/login',
query => 'service=http://auth.sp.com/',
accept => 'text/html'
),
'Query CAS server'
);
count(1);
expectOK($res);
my $pdata = 'lemonldappdata=' . expectCookie( $res, 'lemonldappdata' );
clean_sessions();
done_testing( count() );
sub switch {
my $type = shift;
@Lemonldap::NG::Handler::Main::_onReload = @{
$handlerOR{$type};
};
}
sub issuer {
return LLNG::Manager::Test->new( {
ini => {
logLevel => $debug,
templatesDir => 'site/htdocs/static',
domain => 'idp.com',
portal => 'http://auth.idp.com',
authentication => 'Demo',
userDB => 'Same',
issuerDBCASActivation => 1,
issuerDBCASRule => '$uid eq "french"',
casAttr => 'uid',
casAccessControlPolicy => 'error',
multiValuesSeparator => ';',
casAppMetaDataExportedVars => {
sp => {
cn => 'cn',
mail => 'mail',
uid => 'uid',
}
},
casAppMetaDataOptions => {
sp => {
casAppMetaDataOptionsService => 'http://auth.sp.com',
},
sp2 => {
casAppMetaDataOptionsService => 'http://auth.sp2.com',
},
},
}
}
);
}
sub sp {
return LLNG::Manager::Test->new( {
ini => {
logLevel => $debug,
domain => 'sp.com',
portal => 'http://auth.sp.com',
authentication => 'CAS',
userDB => 'CAS',
restSessionServer => 1,
issuerDBCASActivation => 0,
multiValuesSeparator => ';',
exportedVars => {
cn => 'cn',
},
casSrvMetaDataExportedVars => {
idp => {
cn => 'cn',
mail => 'mail',
uid => 'uid',
},
idp2 => {
cn => 'cn',
mail => 'mail',
uid => 'uid',
}
},
casSrvMetaDataOptions => {
idp => {
casSrvMetaDataOptionsUrl => 'http://auth.idp.com/cas',
casSrvMetaDataOptionsGateway => 0,
},
idp2 => {
casSrvMetaDataOptionsUrl => 'http://auth.idp.com/cas',
casSrvMetaDataOptionsGateway => 0,
}
},
},
}
);
}
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