Commit ede8f56e authored by Xavier Guimard's avatar Xavier Guimard

Tidy

parent c19d68ce
......@@ -13,4 +13,4 @@ describe('Lemonldap::NG', function() {
expect(browser.getCurrentUrl()).toMatch(new RegExp('^http://auth.example.com(:' + process.env.TESTWEBSERVERPORT + ')?/\\?url=aHR0cDovL3Rlc3QxLmV4YW1wbGUuY29tOjE5ODc2Lw=='));
});
});
});
});
\ No newline at end of file
......@@ -41,4 +41,4 @@ describe('Lemonldap::NG Manager', function() {
expect(element(by.id('t-ldapParams')).isDisplayed()).toBeTruthy();
});
});
});
});
\ No newline at end of file
......@@ -672,7 +672,8 @@ sub getKey {
unless ($key) {
return $self->metadatas($req);
}
$self->userLogger->info( 'User ' . $self->userId($req) . " asks for key $key" );
$self->userLogger->info(
'User ' . $self->userId($req) . " asks for key $key" );
my $value = $self->getConfKey( $req, $key );
return $self->sendError( $req, undef, 400 ) if ( $req->error );
......
......@@ -7,8 +7,9 @@ sub run {
my $uri = $class->unparsed_uri;
my $cn = $class->tsv->{cookieName};
my ( $id, $session );
if( $uri =~ s/[\?&;]${cn}cda=(\w+)$//oi ) {
if ( $id = $class->fetchId and $session = $class->retrieveSession($id) ) {
if ( $uri =~ s/[\?&;]${cn}cda=(\w+)$//oi ) {
if ( $id = $class->fetchId and $session = $class->retrieveSession($id) )
{
$class->logger->info(
'CDA asked for an already available session, skipping');
}
......
......@@ -31,7 +31,7 @@ has ua => ( is => 'rw' );
sub addRoutes {
my ( $self, $conf ) = @_;
$self->ua(Lemonldap::NG::Common::UserAgent->new($conf));
$self->ua( Lemonldap::NG::Common::UserAgent->new($conf) );
# HTML template
$self->addRoute( 'manager.html', undef, ['GET'] )
......
......@@ -111,7 +111,8 @@ sub extractFormInfo {
# Store pgtId and pgtIou
unless ( $self->cas->storePGT( $pgtIou, $pgtId ) ) {
$self->userLogger->error( "CAS: error " . &AuthCAS::get_errors() );
$self->userLogger->error(
"CAS: error " . &AuthCAS::get_errors() );
}
else {
$self->logger->debug(
......
......@@ -96,7 +96,8 @@ sub extractFormInfo {
# 1.2 Bad responses
if ( my $error_code = $req->param('error_code') ) {
my $error_message = $req->param('error_message');
$self->userLogger->error("Facebook error code $error_code: $error_message");
$self->userLogger->error(
"Facebook error code $error_code: $error_message");
return PE_ERROR;
}
......
......@@ -110,7 +110,8 @@ sub extractFormInfo {
}
unless ( $self->captcha->validateCaptcha( $token, $code ) ) {
$self->captcha->setCaptcha($req);
$self->userLogger->warn("Captcha failed: wrong or expired code");
$self->userLogger->warn(
"Captcha failed: wrong or expired code");
return PE_CAPTCHAERROR;
}
$self->logger->debug("Captcha code verified");
......
......@@ -227,7 +227,8 @@ sub userBind {
return PE_OK;
}
}
$self->{portal}->userLogger->warn("Bad password for $self->{portal}->{user}");
$self->{portal}
->userLogger->warn("Bad password for $self->{portal}->{user}");
return PE_BADCREDENTIALS;
}
......@@ -514,7 +515,8 @@ sub userModifyPassword {
if ( defined $resp ) {
my $pp_error = $resp->pp_error;
if ( defined $pp_error ) {
$self->{portal}->logger->error("Password policy error $pp_error");
$self->{portal}
->logger->error("Password policy error $pp_error");
return [
PE_PP_PASSWORD_EXPIRED,
PE_PP_ACCOUNT_LOCKED,
......
......@@ -44,7 +44,7 @@ has ua => (
builder => sub {
# TODO : LWP options to use a proxy for example
my $ua = Lemonldap::NG::Common::UserAgent->new($_[0]->{conf});
my $ua = Lemonldap::NG::Common::UserAgent->new( $_[0]->{conf} );
$ua->env_proxy();
return $ua;
}
......@@ -646,7 +646,8 @@ sub getOpenIDConnectSession {
if ( $oidcSession->error ) {
if ($id) {
$self->userLogger->warn("OpenIDConnect session $id isn't yet available");
$self->userLogger->warn(
"OpenIDConnect session $id isn't yet available");
}
else {
$self->logger->error("Unable to create new OpenIDConnect session");
......
......@@ -31,7 +31,7 @@ sub run {
: ""
)
);
unless($req->info) {
unless ( $req->info ) {
$req->info('<p trspan="noHistory"></p>');
}
return PE_INFO;
......
......@@ -209,7 +209,8 @@ sub getAttributes {
my @tmp = ();
unless ($session) {
$self->userLogger->notice("SOAP attributes request: session $id not found");
$self->userLogger->notice(
"SOAP attributes request: session $id not found");
push @tmp, SOAP::Data->name( error => 1 )->type('int');
}
else {
......
......@@ -86,7 +86,7 @@ sub verify {
return $self->fail($req);
}
my $oldReq;
unless ( $oldReq = $self->ott->getToken($token) ) ) {
unless ( $oldReq = $self->ott->getToken($token) ) {
$self->userLogger->info('Token expired');
$req->error(PE_TOKENEXPIRED);
return $self->fail($req);
......@@ -145,7 +145,8 @@ sub loadUser {
{
$self->crypter->{keyHandle} = $self->decode_base64url($kh);
$self->crypter->{publicKey} = $self->decode_base64url($uk);
unless ( $self->crypter->setKeyHandle and $self->crypter->setPublicKey )
unless ($self->crypter->setKeyHandle
and $self->crypter->setPublicKey )
{
$self->logger->error(
'U2F error: ' . Crypt::U2F::Server::u2fclib_getError() );
......
......@@ -122,7 +122,7 @@ sub MIME::Lite::send {
$mailSend = 2;
ok(
$mail->body_as_string =~
m#Your login is.+?<b>(\w+)</b>.*?Your password is.+?<b>(.*?)</b>#s,
m#Your login is.+?<b>(\w+)</b>.*?Your password is.+?<b>(.*?)</b>#s,
'Get login/pwd'
);
( $user, $pwd ) = ( $1, $2 );
......
......@@ -114,7 +114,7 @@ sub MIME::Lite::send {
$mailSend = 2;
ok(
$mail->body_as_string =~
m#Your login is.+?<b>(\w+)</b>.*?Your password is.+?<b>(.*?)</b>#s,
m#Your login is.+?<b>(\w+)</b>.*?Your password is.+?<b>(.*?)</b>#s,
'Get login/pwd'
);
( $user, $pwd ) = ( $1, $2 );
......
......@@ -101,7 +101,7 @@ sub MIME::Lite::send {
$mailSend = 2;
ok(
$mail->body_as_string =~
m#Your login is.+?<b>(\w+)</b>.*?Your password is.+?<b>(.*?)</b>#s,
m#Your login is.+?<b>(\w+)</b>.*?Your password is.+?<b>(.*?)</b>#s,
'Get login/pwd'
);
( $user, $pwd ) = ( $1, $2 );
......
......@@ -116,7 +116,8 @@ sub MIME::Lite::send {
}
else {
$mailSend = 2;
ok( $mail->body_as_string =~ /Your password was changed/, ' Password was changed' );
ok( $mail->body_as_string =~ /Your password was changed/,
' Password was changed' );
count(1);
}
pass('----- Mail sent -----');
......
......@@ -98,7 +98,8 @@ sub MIME::Lite::send {
}
else {
$mailSend = 2;
ok( $mail->body_as_string =~ /Your password was changed/, ' Password was changed' );
ok( $mail->body_as_string =~ /Your password was changed/,
' Password was changed' );
( $user, $pwd ) = ( $1, $2 );
count(1);
}
......
......@@ -96,7 +96,8 @@ sub MIME::Lite::send {
}
else {
$mailSend = 2;
ok( $mail->body_as_string =~ /Your password was changed/, ' Password was changed' );
ok( $mail->body_as_string =~ /Your password was changed/,
' Password was changed' );
( $user, $pwd ) = ( $1, $2 );
count(1);
}
......
......@@ -11,8 +11,8 @@ my $res;
my $client = LLNG::Manager::Test->new(
{
ini => {
authentication => 'Demo',
userdb => 'Same',
authentication => 'Demo',
userdb => 'Same',
grantSessionRule => {
no => '$uid ne "dwho"',
}
......@@ -34,8 +34,8 @@ expectReject($res);
$client = LLNG::Manager::Test->new(
{
ini => {
authentication => 'Demo',
userdb => 'Same',
authentication => 'Demo',
userdb => 'Same',
grantSessionRule => {
yes => '$uid eq "dwho"',
}
......
......@@ -43,11 +43,11 @@ count(1);
expectOK($res);
my $id2 = expectCookie($res);
ok($res=$client->_get('/',cookie=>"lemonldap=$id2"),'Use id 2');
ok( $res = $client->_get( '/', cookie => "lemonldap=$id2" ), 'Use id 2' );
count(1);
expectOK($res);
ok($res=$client->_get('/',cookie=>"lemonldap=$id1"),'Use id 1');
ok( $res = $client->_get( '/', cookie => "lemonldap=$id1" ), 'Use id 1' );
count(1);
expectReject($res);
......
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