make tidy
This commit is contained in:
parent
84e137b8c9
commit
62d5c7836c
|
@ -47,8 +47,7 @@ sub deleteNotification {
|
|||
# Check input parameters
|
||||
unless ( $uid and $myref ) {
|
||||
$self->userLogger->error(
|
||||
'REST service "delete notification" called without all parameters'
|
||||
);
|
||||
'REST service "delete notification" called without all parameters');
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
|
|
@ -89,9 +89,7 @@ sub print {
|
|||
sub addToHtmlHead {
|
||||
my $self = shift;
|
||||
$self->logger->error(
|
||||
'Features like form replay or logout_app can only be used with Apache'
|
||||
),
|
||||
;
|
||||
'Features like form replay or logout_app can only be used with Apache');
|
||||
}
|
||||
|
||||
sub cgiName {
|
||||
|
|
|
@ -76,9 +76,10 @@ sub del2F {
|
|||
or return $self->sendError( $req, 'Bad mode', 400 );
|
||||
|
||||
my $params = $req->parameters();
|
||||
my $type = $params->{type} or return $self->sendError( $req, 'Missing "type" parameter', 400 );
|
||||
my $epoch = $params->{epoch} or return $self->sendError( $req, 'Missing "epoch" parameter', 400 );
|
||||
|
||||
my $type = $params->{type}
|
||||
or return $self->sendError( $req, 'Missing "type" parameter', 400 );
|
||||
my $epoch = $params->{epoch}
|
||||
or return $self->sendError( $req, 'Missing "epoch" parameter', 400 );
|
||||
|
||||
if ( $type =~ /\b(?:U2F|TOTP|UBK)\b/ ) {
|
||||
$self->logger->debug(
|
||||
|
@ -242,10 +243,13 @@ sub sfa {
|
|||
$self->logger->debug(
|
||||
"Removing sessions unless a $_ device is registered");
|
||||
}
|
||||
|
||||
#else {
|
||||
# (
|
||||
#return $self->sendError( $req, "Bad or Missing " . $_ . "Check parameter",
|
||||
#400 ) );
|
||||
# return $self->sendError(
|
||||
# $req, "Bad or Missing " . $_ . "Check parameter", 400
|
||||
# )
|
||||
# );
|
||||
#}
|
||||
}
|
||||
|
||||
|
|
|
@ -48,6 +48,7 @@ my $res;
|
|||
## Sessions creation
|
||||
# SSO session
|
||||
$ids[0] = newSession( 'dwho', '127.10.0.1', 'SSO', $sfaDevices );
|
||||
|
||||
# Peristent sesssions
|
||||
$ids[1] = newSession( 'msmith', '127.10.0.1', 'Persistent', $sfaDevices );
|
||||
$sfaDevices = [
|
||||
|
@ -115,14 +116,13 @@ $sfaDevices = [
|
|||
];
|
||||
$ids[5] = newSession( 'tof', '127.10.0.1', 'Persistent', $sfaDevices );
|
||||
|
||||
|
||||
|
||||
## Verify sessions creation
|
||||
# Single SSO session access
|
||||
$res = &client->jsonResponse("/sessions/global/$ids[0]");
|
||||
ok( ( $res->{uid} and $res->{uid} eq 'dwho' ), 'UID found' );
|
||||
ok( ( $res->{ipAddr} and $res->{ipAddr} eq '127.10.0.1' ), 'IP found' );
|
||||
count(2);
|
||||
|
||||
# Single Persistent sessions access
|
||||
for ( my $i = 1 ; $i < 6 ; $i++ ) {
|
||||
$res = &client->jsonResponse("/sessions/persistent/$ids[$i]");
|
||||
|
@ -138,11 +138,19 @@ count(5);
|
|||
|
||||
## Single Persistent sfa access
|
||||
$res = &client->jsonResponse("/sfa/persistent/$ids[3]");
|
||||
ok( ( $res->{uid} and $res->{uid} eq 'dwho' ), 'UID found' ) or print STDERR Dumper($res);
|
||||
ok( ( $res->{ipAddr} and $res->{ipAddr} eq '127.10.0.1' ), 'IP found' ) or print STDERR Dumper($res);
|
||||
ok( ( $res->{_2fDevices} and $res->{_2fDevices} =~ /"type":\s*"U2F"/s ), 'U2F found' ) or print STDERR Dumper($res);
|
||||
ok( ( $res->{_2fDevices} and $res->{_2fDevices} =~ /"type":\s*"TOTP"/s ), 'TOTP found' ) or print STDERR Dumper($res);
|
||||
ok( ( $res->{_2fDevices} and $res->{_2fDevices} =~ /"type":\s*"UBK"/s ), 'UBK found' ) or print STDERR Dumper($res);
|
||||
ok( ( $res->{uid} and $res->{uid} eq 'dwho' ), 'UID found' )
|
||||
or print STDERR Dumper($res);
|
||||
ok( ( $res->{ipAddr} and $res->{ipAddr} eq '127.10.0.1' ), 'IP found' )
|
||||
or print STDERR Dumper($res);
|
||||
ok( ( $res->{_2fDevices} and $res->{_2fDevices} =~ /"type":\s*"U2F"/s ),
|
||||
'U2F found' )
|
||||
or print STDERR Dumper($res);
|
||||
ok( ( $res->{_2fDevices} and $res->{_2fDevices} =~ /"type":\s*"TOTP"/s ),
|
||||
'TOTP found' )
|
||||
or print STDERR Dumper($res);
|
||||
ok( ( $res->{_2fDevices} and $res->{_2fDevices} =~ /"type":\s*"UBK"/s ),
|
||||
'UBK found' )
|
||||
or print STDERR Dumper($res);
|
||||
count(5);
|
||||
|
||||
## "All" query
|
||||
|
|
|
@ -34,7 +34,8 @@ sub init {
|
|||
if ( $self->conf->{totp2fSelfRegistration}
|
||||
and $self->conf->{totp2fActivation} eq '1' )
|
||||
{
|
||||
$self->conf->{totp2fActivation} = '$_2fDevices && $_2fDevices =~ /"type":\s*"TOTP"/s';
|
||||
$self->conf->{totp2fActivation} =
|
||||
'$_2fDevices && $_2fDevices =~ /"type":\s*"TOTP"/s';
|
||||
}
|
||||
return $self->SUPER::init();
|
||||
}
|
||||
|
|
|
@ -37,7 +37,8 @@ sub init {
|
|||
if ( $self->conf->{u2fSelfRegistration}
|
||||
and $self->conf->{u2fActivation} eq '1' )
|
||||
{
|
||||
$self->conf->{u2fActivation} = '$_2fDevices && $_2fDevices =~ /"type":\s*"U2F"/s';
|
||||
$self->conf->{u2fActivation} =
|
||||
'$_2fDevices && $_2fDevices =~ /"type":\s*"U2F"/s';
|
||||
}
|
||||
return 0
|
||||
unless ( $self->Lemonldap::NG::Portal::Main::SecondFactor::init()
|
||||
|
|
|
@ -778,7 +778,7 @@ sub run {
|
|||
if ( $method == $self->getHttpMethod("post")
|
||||
|| $method == $self->getHttpMethod("artifact-post") )
|
||||
{
|
||||
$artifact_method = $self->getHttpMethod("artifact-post")
|
||||
$artifact_method = $self->getHttpMethod("artifact-post");
|
||||
|
||||
}
|
||||
else {
|
||||
|
|
|
@ -160,8 +160,7 @@ sub getNotifBack {
|
|||
$self->p->updatePersistentSession( $req,
|
||||
{ "notification_$reference" => time() } );
|
||||
$self->logger->debug(
|
||||
"Notification $reference registered in persistent session"
|
||||
);
|
||||
"Notification $reference registered in persistent session");
|
||||
}
|
||||
|
||||
# Notifications accepted for this file, delete it unless it's a wildcard
|
||||
|
|
|
@ -219,8 +219,7 @@ sub getNotifBack {
|
|||
$self->p->updatePersistentSession( $req,
|
||||
{ "notification_$reference" => time() } );
|
||||
$self->logger->debug(
|
||||
"Notification $reference registered in persistent session"
|
||||
);
|
||||
"Notification $reference registered in persistent session");
|
||||
}
|
||||
|
||||
# Notifications accepted for this file, delete it unless it's a wildcard
|
||||
|
|
|
@ -550,7 +550,8 @@ sub mkOidcConsent {
|
|||
$consents->{$rp}->{epoch} = $_->{epoch};
|
||||
$consents->{$rp}->{scope} = $_->{scope};
|
||||
$consents->{$rp}->{displayName} =
|
||||
$self->conf->{oidcRPMetaDataOptions}->{$rp}->{oidcRPMetaDataOptionsDisplayName};
|
||||
$self->conf->{oidcRPMetaDataOptions}->{$rp}
|
||||
->{oidcRPMetaDataOptionsDisplayName};
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -10,8 +10,10 @@ sub new {
|
|||
|
||||
eval $self->{p}->loadModule( $self->{conf}->{customRegister} );
|
||||
($@)
|
||||
? return $self->{p}->loadModule( $self->{conf}->{customRegister )
|
||||
: die 'Unable to load register module ' . $self->{conf}->{customRegister};
|
||||
? return $self->{p}->loadModule(
|
||||
$self->{conf}->{ customRegister )
|
||||
: die 'Unable to load register module '
|
||||
. $self->{conf}->{customRegister};
|
||||
}
|
||||
|
||||
1;
|
||||
|
|
|
@ -292,6 +292,7 @@ ok(
|
|||
);
|
||||
count(1);
|
||||
$idpId = expectCookie($res);
|
||||
|
||||
#expectRedirection( $res, qr#^http://auth.rp.com/# );
|
||||
|
||||
#print STDERR Dumper($res);
|
||||
|
|
|
@ -50,8 +50,7 @@ ok(
|
|||
$res = $client->_post(
|
||||
'/',
|
||||
IO::String->new(
|
||||
'user=dwho&password=dwho&url=aHR0cDovL3Rlc3QxLmV4YW1wbGUuY29tLw=='
|
||||
),
|
||||
'user=dwho&password=dwho&url=aHR0cDovL3Rlc3QxLmV4YW1wbGUuY29tLw=='),
|
||||
accept => 'text/html',
|
||||
length => 64,
|
||||
),
|
||||
|
|
|
@ -118,8 +118,7 @@ SKIP: {
|
|||
|
||||
# Generate TOTP with an external application to validate LLNG TOTP formula
|
||||
my $oath = Authen::OATH->new( digits => 8 );
|
||||
ok( $code = $oath->totp( $key ),
|
||||
'Ext. App Code' );
|
||||
ok( $code = $oath->totp($key), 'Ext. App Code' );
|
||||
ok( $code == $totp, 'Both TOTP match' )
|
||||
or explain( [ $code, $totp ], 'LLNG and Ext. App TOTP mismatch' );
|
||||
|
||||
|
|
|
@ -296,8 +296,7 @@ has ini => (
|
|||
$ini->{$k} //= $defaultIni->{$k};
|
||||
}
|
||||
$self->{ini} = $ini;
|
||||
main::ok( $self->{p} = $self->class->new(),
|
||||
'Portal object' );
|
||||
main::ok( $self->{p} = $self->class->new(), 'Portal object' );
|
||||
main::ok( $self->{p}->init($ini), 'Init' );
|
||||
main::ok( $self->{app} = $self->{p}->run(), 'Portal app' );
|
||||
main::count(3);
|
||||
|
|
Loading…
Reference in New Issue
Block a user