Perl critic

This commit is contained in:
Christophe Maudoux 2021-02-01 22:30:37 +01:00
parent d21747cea1
commit 635e75c1b6
26 changed files with 129 additions and 120 deletions

View File

@ -1,6 +1,5 @@
LemonLDAP::NG Core team: LemonLDAP::NG Core team:
* Maxime BESSON * Maxime BESSON
* David COUTADEUR
* Xavier GUIMARD * Xavier GUIMARD
* Christophe MAUDOUX * Christophe MAUDOUX
* Clément OUDOT * Clément OUDOT
@ -10,9 +9,10 @@ Past and present contributors:
* Casimir ANTUNES * Casimir ANTUNES
* Sébastien BAHLOUL * Sébastien BAHLOUL
* Oliver BOIREAU * Oliver BOIREAU
* Jean-Thomas CHECCO
* Sandro CAZZANIGA * Sandro CAZZANIGA
* Jean-Thomas CHECCO
* Thomas CHEMINEAU * Thomas CHEMINEAU
* David COUTADEUR
* François-Xavier DELTOMBE * François-Xavier DELTOMBE
* Sebastien DIAZ * Sebastien DIAZ
* Soisik FROGIER * Soisik FROGIER

View File

@ -4,14 +4,14 @@ use strict;
use Mouse; use Mouse;
use Lemonldap::NG::Portal::Main::Constants qw(PE_ERROR PE_OK); use Lemonldap::NG::Portal::Main::Constants qw(PE_ERROR PE_OK);
our $VERSION = '2.0.0'; our $VERSION = '2.0.12';
extends 'Lemonldap::NG::Portal::Main::Auth'; extends 'Lemonldap::NG::Portal::Main::Auth';
# INITIALIZATION # INITIALIZATION
sub init { sub init {
1; return 1;
} }
# RUNNING METHODS # RUNNING METHODS
@ -25,22 +25,22 @@ sub extractFormInfo {
# This is needed for Kerberos authentication # This is needed for Kerberos authentication
$req->{user} =~ s/^(.*)@.*$/$1/g; $req->{user} =~ s/^(.*)@.*$/$1/g;
PE_OK; return PE_OK;
} }
sub authenticate { sub authenticate {
PE_OK; return PE_OK;
} }
sub setAuthSessionInfo { sub setAuthSessionInfo {
my ( $self, $req ) = @_; my ( $self, $req ) = @_;
$req->{sessionInfo}->{authenticationLevel} = $req->{sessionInfo}->{authenticationLevel} =
$self->conf->{apacheAuthnLevel}; $self->conf->{apacheAuthnLevel};
PE_OK; return PE_OK;
} }
sub authLogout { sub authLogout {
PE_OK; return PE_OK;
} }
sub getDisplayType { sub getDisplayType {

View File

@ -12,7 +12,7 @@ use Lemonldap::NG::Portal::Main::Constants qw(
PE_SENDRESPONSE PE_SENDRESPONSE
); );
our $VERSION = '2.0.6'; our $VERSION = '2.0.12';
extends 'Lemonldap::NG::Portal::Main::Auth', 'Lemonldap::NG::Portal::Lib::CAS'; extends 'Lemonldap::NG::Portal::Main::Auth', 'Lemonldap::NG::Portal::Lib::CAS';
@ -72,6 +72,7 @@ sub init {
or $a->{val} cmp $b->{val} or $a->{val} cmp $b->{val}
} @list; } @list;
$self->srvList( \@list ); $self->srvList( \@list );
return 1; return 1;
} }
@ -247,15 +248,16 @@ sub extractFormInfo {
} }
sub authenticate { sub authenticate {
PE_OK; return PE_OK;
} }
# Set authenticationLevel. # Set authenticationLevel.
sub setAuthSessionInfo { sub setAuthSessionInfo {
my ( $self, $req ) = @_; my ( $self, $req ) = @_;
$req->{sessionInfo}->{authenticationLevel} = $self->conf->{casAuthnLevel}; $req->{sessionInfo}->{authenticationLevel} = $self->conf->{casAuthnLevel};
$req->{sessionInfo}->{_casSrv} = $req->data->{_casSrvCurrent}; $req->{sessionInfo}->{_casSrv}
PE_OK; = $req->data->{_casSrvCurrent};
return PE_OK;
} }
sub authLogout { sub authLogout {
@ -271,7 +273,7 @@ sub authLogout {
# Register CAS logout URL in logoutServices # Register CAS logout URL in logoutServices
$req->data->{logoutServices}->{CASserver} = $logout_url; $req->data->{logoutServices}->{CASserver} = $logout_url;
PE_OK; return PE_OK;
} }
sub getDisplayType { sub getDisplayType {

View File

@ -6,7 +6,7 @@ use Lemonldap::NG::Common::Combination::Parser;
use Lemonldap::NG::Portal::Main::Constants qw(PE_OK PE_ERROR PE_FIRSTACCESS); use Lemonldap::NG::Portal::Main::Constants qw(PE_OK PE_ERROR PE_FIRSTACCESS);
use Scalar::Util 'weaken'; use Scalar::Util 'weaken';
our $VERSION = '2.0.8'; our $VERSION = '2.0.12';
# TODO: See Lib::Wrapper # TODO: See Lib::Wrapper
extends 'Lemonldap::NG::Portal::Main::Auth'; extends 'Lemonldap::NG::Portal::Main::Auth';
@ -153,7 +153,7 @@ sub authLogout {
} }
sub authFinish { sub authFinish {
PE_OK; return PE_OK;
} }
sub authForce { sub authForce {

View File

@ -4,7 +4,7 @@ use strict;
use Mouse; use Mouse;
use Lemonldap::NG::Portal::Main::Constants qw(PE_OK PE_BADCREDENTIALS); use Lemonldap::NG::Portal::Main::Constants qw(PE_OK PE_BADCREDENTIALS);
our $VERSION = '2.0.0'; our $VERSION = '2.0.12';
extends 'Lemonldap::NG::Portal::Auth::_WebForm', extends 'Lemonldap::NG::Portal::Auth::_WebForm',
'Lemonldap::NG::Portal::Lib::DBI'; 'Lemonldap::NG::Portal::Lib::DBI';
@ -43,7 +43,7 @@ sub authenticate {
} }
sub authLogout { sub authLogout {
PE_OK; return PE_OK;
} }
1; 1;

View File

@ -11,7 +11,7 @@ use Lemonldap::NG::Portal::Main::Constants qw(PE_OK PE_BADCREDENTIALS);
extends qw(Lemonldap::NG::Portal::Auth::_WebForm); extends qw(Lemonldap::NG::Portal::Auth::_WebForm);
our $VERSION = '2.0.9'; our $VERSION = '2.0.12';
# INITIALIZATION # INITIALIZATION
@ -38,11 +38,11 @@ sub authenticate {
return PE_BADCREDENTIALS; return PE_BADCREDENTIALS;
} }
PE_OK; return PE_OK;
} }
sub authLogout { sub authLogout {
PE_OK; return PE_OK;
} }
1; 1;

View File

@ -7,7 +7,7 @@ use Lemonldap::NG::Common::FormEncode;
use Lemonldap::NG::Portal::Main::Constants qw(PE_OK PE_ERROR PE_BADCREDENTIALS); use Lemonldap::NG::Portal::Main::Constants qw(PE_OK PE_ERROR PE_BADCREDENTIALS);
use utf8; use utf8;
our $VERSION = '2.0.3'; our $VERSION = '2.0.12';
extends 'Lemonldap::NG::Portal::Main::Auth'; extends 'Lemonldap::NG::Portal::Main::Auth';
@ -129,26 +129,27 @@ sub extractFormInfo {
$self->logger->debug( "Redirect user to " . $req->{urldc} ); $self->logger->debug( "Redirect user to " . $req->{urldc} );
$req->continue(1); $req->continue(1);
$req->steps( [] ); $req->steps( [] );
PE_OK;
return PE_OK;
} }
sub authenticate { sub authenticate {
PE_OK; return PE_OK;
} }
sub setAuthSessionInfo { sub setAuthSessionInfo {
my ( $self, $req ) = @_; my ( $self, $req ) = @_;
$req->{sessionInfo}->{authenticationLevel} = $req->{sessionInfo}->{authenticationLevel} =
$self->conf->{facebookAuthnLevel}; $self->conf->{facebookAuthnLevel};
PE_OK; return PE_OK;
} }
sub authFinish { sub authFinish {
PE_OK; return PE_OK;
} }
sub authLogout { sub authLogout {
PE_OK; return PE_OK;
} }
sub getDisplayType { sub getDisplayType {
@ -170,6 +171,7 @@ sub fb {
); );
}; };
$self->logger->error($@) if ($@); $self->logger->error($@) if ($@);
return $fb; return $fb;
} }

View File

@ -12,7 +12,7 @@ use Lemonldap::NG::Portal::Main::Constants qw(
PE_OK PE_OK
); );
our $VERSION = '2.0.3'; our $VERSION = '2.0.12';
extends 'Lemonldap::NG::Portal::Auth::_WebForm'; extends 'Lemonldap::NG::Portal::Auth::_WebForm';
@ -137,18 +137,18 @@ sub extractFormInfo {
} }
sub authenticate { sub authenticate {
PE_OK; return PE_OK;
} }
sub setAuthSessionInfo { sub setAuthSessionInfo {
my ( $self, $req ) = @_; my ( $self, $req ) = @_;
$req->sessionInfo->{gpgMail} = $req->data->{gpgMail}; $req->sessionInfo->{gpgMail} = $req->data->{gpgMail};
$req->sessionInfo->{authenticationLevel} = $self->conf->{gpgAuthnLevel}; $req->sessionInfo->{authenticationLevel} = $self->conf->{gpgAuthnLevel};
PE_OK; return PE_OK;
} }
sub authLogout { sub authLogout {
PE_OK; return PE_OK;
} }
sub getDisplayType { sub getDisplayType {

View File

@ -8,7 +8,7 @@ use Lemonldap::NG::Common::FormEncode;
use Lemonldap::NG::Common::UserAgent; use Lemonldap::NG::Common::UserAgent;
use Lemonldap::NG::Portal::Main::Constants qw(PE_OK PE_ERROR PE_REDIRECT); use Lemonldap::NG::Portal::Main::Constants qw(PE_OK PE_ERROR PE_REDIRECT);
our $VERSION = '2.0.9'; our $VERSION = '2.0.12';
extends 'Lemonldap::NG::Portal::Main::Auth'; extends 'Lemonldap::NG::Portal::Main::Auth';
@ -296,19 +296,19 @@ sub setAuthSessionInfo {
$req->data->{githubData}->{$_}; $req->data->{githubData}->{$_};
} }
PE_OK; return PE_OK;
} }
sub authenticate { sub authenticate {
PE_OK; return PE_OK;
} }
sub authFinish { sub authFinish {
PE_OK; return PE_OK;
} }
sub authLogout { sub authLogout {
PE_OK; return PE_OK;
} }
sub authForce { sub authForce {

View File

@ -12,7 +12,7 @@ use Lemonldap::NG::Portal::Main::Constants qw(
PE_SENDRESPONSE PE_SENDRESPONSE
); );
our $VERSION = '2.0.9'; our $VERSION = '2.0.12';
extends 'Lemonldap::NG::Portal::Main::Auth'; extends 'Lemonldap::NG::Portal::Main::Auth';
@ -216,18 +216,18 @@ sub _checkDomains {
} }
sub authenticate { sub authenticate {
PE_OK; return PE_OK;
} }
sub authLogout { sub authLogout {
PE_OK; return PE_OK;
} }
sub setAuthSessionInfo { sub setAuthSessionInfo {
my ( $self, $req ) = @_; my ( $self, $req ) = @_;
$req->{sessionInfo}->{authenticationLevel} = $self->conf->{krbAuthnLevel}; $req->{sessionInfo}->{authenticationLevel} = $self->conf->{krbAuthnLevel};
$req->{sessionInfo}->{_krbUser} = $req->data->{_krbUser}; $req->{sessionInfo}->{_krbUser} = $req->data->{_krbUser};
PE_OK; return PE_OK;
} }
sub getDisplayType { sub getDisplayType {

View File

@ -8,7 +8,7 @@ use Lemonldap::NG::Common::FormEncode;
use Lemonldap::NG::Common::UserAgent; use Lemonldap::NG::Common::UserAgent;
use Lemonldap::NG::Portal::Main::Constants qw(PE_OK PE_ERROR PE_REDIRECT); use Lemonldap::NG::Portal::Main::Constants qw(PE_OK PE_ERROR PE_REDIRECT);
our $VERSION = '2.0.6'; our $VERSION = '2.0.12';
extends 'Lemonldap::NG::Portal::Main::Auth'; extends 'Lemonldap::NG::Portal::Main::Auth';
@ -261,19 +261,19 @@ sub setAuthSessionInfo {
$req->data->{linkedInData}->{$_}; $req->data->{linkedInData}->{$_};
} }
PE_OK; return PE_OK;
} }
sub authenticate { sub authenticate {
PE_OK; return PE_OK;
} }
sub authFinish { sub authFinish {
PE_OK; return PE_OK;
} }
sub authLogout { sub authLogout {
PE_OK; return PE_OK;
} }
sub authForce { sub authForce {

View File

@ -4,14 +4,14 @@ use strict;
use Mouse; use Mouse;
use Lemonldap::NG::Portal::Main::Constants; use Lemonldap::NG::Portal::Main::Constants;
our $VERSION = '2.0.0'; our $VERSION = '2.0.12';
extends 'Lemonldap::NG::Portal::Main::Auth'; extends 'Lemonldap::NG::Portal::Main::Auth';
# INITIALIZATION # INITIALIZATION
sub init { sub init {
1; return 1;
} }
# RUNNING METHODS # RUNNING METHODS
@ -19,22 +19,22 @@ sub init {
sub extractFormInfo { sub extractFormInfo {
my ( $self, $req ) = @_; my ( $self, $req ) = @_;
$req->user('anonymous'); $req->user('anonymous');
PE_OK; return PE_OK;
} }
sub authenticate { sub authenticate {
PE_OK; return PE_OK;
} }
sub setAuthSessionInfo { sub setAuthSessionInfo {
my ( $self, $req ) = @_; my ( $self, $req ) = @_;
$req->{sessionInfo}->{'_user'} = 'anonymous'; $req->{sessionInfo}->{'_user'} = 'anonymous';
$req->{sessionInfo}->{authenticationLevel} = $self->conf->{nullAuthnLevel}; $req->{sessionInfo}->{authenticationLevel} = $self->conf->{nullAuthnLevel};
PE_OK; return PE_OK;
} }
sub authLogout { sub authLogout {
PE_OK; return PE_OK;
} }
sub getDisplayType { sub getDisplayType {

View File

@ -15,7 +15,7 @@ use Lemonldap::NG::Portal::Main::Constants qw(
PE_REDIRECT PE_REDIRECT
); );
our $VERSION = '2.0.3'; our $VERSION = '2.0.12';
extends 'Lemonldap::NG::Portal::Main::Auth'; extends 'Lemonldap::NG::Portal::Main::Auth';
@ -191,18 +191,18 @@ qq'Unknown "OpenID Simple Registration Extension" field name: $k'
} }
sub authenticate { sub authenticate {
PE_OK; return PE_OK;
} }
sub setAuthSessionInfo { sub setAuthSessionInfo {
my ( $self, $req ) = @_; my ( $self, $req ) = @_;
$req->{sessionInfo}->{authenticationLevel} = $req->{sessionInfo}->{authenticationLevel} =
$self->conf->{openIdAuthnLevel}; $self->conf->{openIdAuthnLevel};
PE_OK; return PE_OK;
} }
sub authLogout { sub authLogout {
PE_OK; return PE_OK;
} }
sub getDisplayType { sub getDisplayType {

View File

@ -5,15 +5,17 @@ use Mouse;
use MIME::Base64 qw/encode_base64 decode_base64/; use MIME::Base64 qw/encode_base64 decode_base64/;
use Lemonldap::NG::Common::JWT qw(getJWTPayload); use Lemonldap::NG::Common::JWT qw(getJWTPayload);
use Lemonldap::NG::Portal::Main::Constants qw( use Lemonldap::NG::Portal::Main::Constants qw(
PE_OK
PE_ERROR PE_ERROR
PE_IDPCHOICE PE_IDPCHOICE
PE_OK
); );
our $VERSION = '2.0.7'; our $VERSION = '2.0.12';
extends 'Lemonldap::NG::Portal::Main::Auth', extends qw(
'Lemonldap::NG::Portal::Lib::OpenIDConnect'; Lemonldap::NG::Portal::Main::Auth
Lemonldap::NG::Portal::Lib::OpenIDConnect
);
# INTERFACE # INTERFACE
@ -276,7 +278,7 @@ sub extractFormInfo {
} }
sub authenticate { sub authenticate {
PE_OK; return PE_OK;
} }
sub setAuthSessionInfo { sub setAuthSessionInfo {
@ -300,7 +302,7 @@ sub setAuthSessionInfo {
$self->logger->debug("ID Token will not be stored in session"); $self->logger->debug("ID Token will not be stored in session");
} }
PE_OK; return PE_OK;
} }
sub authLogout { sub authLogout {
@ -327,7 +329,7 @@ sub authLogout {
else { else {
$self->logger->debug("No end session endpoint found for $op"); $self->logger->debug("No end session endpoint found for $op");
} }
PE_OK; return PE_OK;
} }
sub getDisplayType { sub getDisplayType {

View File

@ -11,7 +11,7 @@ use Lemonldap::NG::Portal::Main::Constants qw(
extends qw(Lemonldap::NG::Portal::Auth::_WebForm); extends qw(Lemonldap::NG::Portal::Auth::_WebForm);
our $VERSION = '2.0.3'; our $VERSION = '2.0.12';
# INITIALIZATION # INITIALIZATION
@ -71,17 +71,17 @@ sub authenticate {
} }
} }
$self->userLogger->notice("Good PAM authentication for $req->{user}"); $self->userLogger->notice("Good PAM authentication for $req->{user}");
PE_OK; return PE_OK;
} }
sub setAuthSessionInfo { sub setAuthSessionInfo {
my ( $self, $req ) = @_; my ( $self, $req ) = @_;
$req->sessionInfo->{authenticationLevel} = $self->conf->{pamAuthnLevel}; $req->sessionInfo->{authenticationLevel} = $self->conf->{pamAuthnLevel};
PE_OK; return PE_OK;
} }
sub authLogout { sub authLogout {
PE_OK; return PE_OK;
} }
1; 1;

View File

@ -4,7 +4,7 @@ use strict;
use Mouse; use Mouse;
use Lemonldap::NG::Portal::Main::Constants qw(PE_OK); use Lemonldap::NG::Portal::Main::Constants qw(PE_OK);
our $VERSION = '2.0.3'; our $VERSION = '2.0.12';
extends 'Lemonldap::NG::Portal::Auth::_WebForm'; extends 'Lemonldap::NG::Portal::Auth::_WebForm';
@ -29,7 +29,7 @@ sub init {
sub setAuthSessionInfo { sub setAuthSessionInfo {
my ( $self, $req ) = @_; my ( $self, $req ) = @_;
$req->{sessionInfo}->{authenticationLevel} = $self->conf->{proxyAuthnLevel}; $req->{sessionInfo}->{authenticationLevel} = $self->conf->{proxyAuthnLevel};
PE_OK; return PE_OK;
} }
sub getDisplayType { sub getDisplayType {

View File

@ -3,15 +3,17 @@ package Lemonldap::NG::Portal::Auth::REST;
use strict; use strict;
use Mouse; use Mouse;
use Lemonldap::NG::Portal::Main::Constants qw( use Lemonldap::NG::Portal::Main::Constants qw(
PE_OK
PE_ERROR PE_ERROR
PE_BADCREDENTIALS PE_BADCREDENTIALS
PE_OK
); );
our $VERSION = '2.0.6'; our $VERSION = '2.0.12';
extends 'Lemonldap::NG::Portal::Auth::_WebForm', extends qw(
'Lemonldap::NG::Portal::Lib::REST'; Lemonldap::NG::Portal::Auth::_WebForm
Lemonldap::NG::Portal::Lib::REST
);
# INITIALIZATION # INITIALIZATION
@ -66,7 +68,7 @@ sub setAuthSessionInfo {
} }
sub authLogout { sub authLogout {
PE_OK; return PE_OK;
} }
1; 1;

View File

@ -11,7 +11,7 @@ use Lemonldap::NG::Portal::Main::Constants qw(
extends qw(Lemonldap::NG::Portal::Auth::_WebForm); extends qw(Lemonldap::NG::Portal::Auth::_WebForm);
our $VERSION = '2.0.0'; our $VERSION = '2.0.12';
# PROPERTIES # PROPERTIES
@ -64,7 +64,7 @@ sub authenticate {
} }
sub authLogout { sub authLogout {
PE_OK; return PE_OK;
} }
1; 1;

View File

@ -4,7 +4,7 @@ use strict;
use Mouse; use Mouse;
use Lemonldap::NG::Portal::Main::Constants qw(PE_OK); use Lemonldap::NG::Portal::Main::Constants qw(PE_OK);
our $VERSION = '2.0.0'; our $VERSION = '2.0.12';
extends 'Lemonldap::NG::Portal::Main::Auth', extends 'Lemonldap::NG::Portal::Main::Auth',
'Lemonldap::NG::Portal::Lib::Remote'; 'Lemonldap::NG::Portal::Lib::Remote';
@ -18,11 +18,11 @@ sub extractFormInfo {
$req->{user} = $req->{user} =
$req->data->{rSessionInfo}->{ $self->conf->{remoteUserField} || 'uid' }; $req->data->{rSessionInfo}->{ $self->conf->{remoteUserField} || 'uid' };
$req->data->{password} = $req->data->{rSessionInfo}->{'_password'}; $req->data->{password} = $req->data->{rSessionInfo}->{'_password'};
PE_OK; return PE_OK;
} }
sub authenticate { sub authenticate {
PE_OK; return PE_OK;
} }
sub setAuthSessionInfo { sub setAuthSessionInfo {
@ -33,11 +33,11 @@ sub setAuthSessionInfo {
$req->{sessionInfo}->{'_password'} = $req->data->{'password'}; $req->{sessionInfo}->{'_password'} = $req->data->{'password'};
$req->{sessionInfo}->{authenticationLevel} = $req->{sessionInfo}->{authenticationLevel} =
$req->data->{rSessionInfo}->{authenticationLevel}; $req->data->{rSessionInfo}->{authenticationLevel};
PE_OK; return PE_OK;
} }
sub authLogout { sub authLogout {
PE_OK; return PE_OK;
} }
sub getDisplayType { sub getDisplayType {

View File

@ -6,11 +6,11 @@ use Mouse;
use Lemonldap::NG::Portal::Lib::SAML; use Lemonldap::NG::Portal::Lib::SAML;
use Lemonldap::NG::Common::FormEncode; use Lemonldap::NG::Common::FormEncode;
use Lemonldap::NG::Portal::Main::Constants qw( use Lemonldap::NG::Portal::Main::Constants qw(
PE_OK
PE_CONFIRM PE_CONFIRM
PE_IDPCHOICE PE_IDPCHOICE
PE_LOGOUT_OK PE_LOGOUT_OK
PE_REDIRECT PE_REDIRECT
PE_OK
PE_SAML_ART_ERROR PE_SAML_ART_ERROR
PE_SAML_CONDITIONS_ERROR PE_SAML_CONDITIONS_ERROR
PE_SAML_DESTINATION_ERROR PE_SAML_DESTINATION_ERROR
@ -1141,7 +1141,7 @@ sub extractFormInfo {
} }
sub authenticate { sub authenticate {
PE_OK; return PE_OK;
} }
sub setAuthSessionInfo { sub setAuthSessionInfo {
@ -1256,7 +1256,7 @@ sub setAuthSessionInfo {
$req->data->{_lassoLogin} = $login; $req->data->{_lassoLogin} = $login;
push @{ $req->steps }, sub { $self->authFinish(@_) }; push @{ $req->steps }, sub { $self->authFinish(@_) };
PE_OK; return PE_OK;
} }
# Inserted in $req->steps by authenticate() # Inserted in $req->steps by authenticate()
@ -1456,7 +1456,7 @@ sub handleAuthRequests {
if ( $req->uri =~ $self->sloRe ) { if ( $req->uri =~ $self->sloRe ) {
return $self->extractFormInfo($req); return $self->extractFormInfo($req);
} }
PE_OK; return PE_OK;
} }
# TODO: authForce # TODO: authForce

View File

@ -3,13 +3,13 @@ package Lemonldap::NG::Portal::Auth::SSL;
use strict; use strict;
use Mouse; use Mouse;
use Lemonldap::NG::Portal::Main::Constants qw( use Lemonldap::NG::Portal::Main::Constants qw(
PE_BADCERTIFICATE
PE_CERTIFICATEREQUIRED PE_CERTIFICATEREQUIRED
PE_BADCERTIFICATE
PE_FIRSTACCESS PE_FIRSTACCESS
PE_OK PE_OK
); );
our $VERSION = '2.0.8'; our $VERSION = '2.0.12';
extends 'Lemonldap::NG::Portal::Main::Auth'; extends 'Lemonldap::NG::Portal::Main::Auth';
@ -89,13 +89,13 @@ sub extractFormInfo {
} }
sub authenticate { sub authenticate {
PE_OK; return PE_OK;
} }
sub setAuthSessionInfo { sub setAuthSessionInfo {
my ( $self, $req ) = @_; my ( $self, $req ) = @_;
$req->sessionInfo->{authenticationLevel} = $self->conf->{SSLAuthnLevel}; $req->sessionInfo->{authenticationLevel} = $self->conf->{SSLAuthnLevel};
PE_OK; return PE_OK;
} }
sub getDisplayType { sub getDisplayType {
@ -104,7 +104,7 @@ sub getDisplayType {
} }
sub authLogout { sub authLogout {
PE_OK; return PE_OK;
} }
1; 1;

View File

@ -10,7 +10,7 @@ use Lemonldap::NG::Portal::Main::Constants qw(
PE_USERNOTFOUND PE_USERNOTFOUND
); );
our $VERSION = '2.0.10'; our $VERSION = '2.0.12';
extends qw( extends qw(
Lemonldap::NG::Portal::Main::Auth Lemonldap::NG::Portal::Main::Auth
@ -42,18 +42,18 @@ sub extractFormInfo {
"No header " . $self->conf->{slaveUserHeader} . " found" ); "No header " . $self->conf->{slaveUserHeader} . " found" );
return PE_USERNOTFOUND; return PE_USERNOTFOUND;
} }
PE_OK; return PE_OK;
} }
sub authenticate { sub authenticate {
my ( $self, $req ) = @_; my ( $self, $req ) = @_;
PE_OK; return PE_OK;
} }
sub setAuthSessionInfo { sub setAuthSessionInfo {
my ( $self, $req ) = @_; my ( $self, $req ) = @_;
$req->{sessionInfo}->{authenticationLevel} = $self->conf->{slaveAuthnLevel}; $req->{sessionInfo}->{authenticationLevel} = $self->conf->{slaveAuthnLevel};
PE_OK; return PE_OK;
} }
sub getDisplayType { sub getDisplayType {
@ -63,7 +63,7 @@ sub getDisplayType {
sub authLogout { sub authLogout {
my ( $self, $req ) = @_; my ( $self, $req ) = @_;
PE_OK; return PE_OK;
} }
1; 1;

View File

@ -8,7 +8,7 @@ use Lemonldap::NG::Portal::Main::Constants qw(PE_OK PE_ERROR);
extends 'Lemonldap::NG::Portal::Main::Auth'; extends 'Lemonldap::NG::Portal::Main::Auth';
our $VERSION = '2.0.0'; our $VERSION = '2.0.12';
# INITIALIZATION # INITIALIZATION
@ -216,7 +216,7 @@ sub extractFormInfo {
expires => 'Wed, 21 Oct 2015 00:00:00 GMT' expires => 'Wed, 21 Oct 2015 00:00:00 GMT'
) )
); );
PE_OK; return PE_OK;
} }
sub setAuthSessionInfo { sub setAuthSessionInfo {
@ -228,15 +228,15 @@ sub setAuthSessionInfo {
$req->{sessionInfo}->{_twitterScreenName} = $req->{sessionInfo}->{_twitterScreenName} =
$req->data->{_twitterScreenName}; $req->data->{_twitterScreenName};
PE_OK; return PE_OK;
} }
sub authenticate { sub authenticate {
PE_OK; return PE_OK;
} }
sub authLogout { sub authLogout {
PE_OK; return PE_OK;
} }
sub getDisplayType { sub getDisplayType {

View File

@ -5,14 +5,15 @@ use Mouse;
use Regexp::Assemble; use Regexp::Assemble;
use Web::ID; use Web::ID;
use Lemonldap::NG::Portal::Main::Constants qw( use Lemonldap::NG::Portal::Main::Constants qw(
PE_OK
PE_BADPARTNER
PE_BADCERTIFICATE PE_BADCERTIFICATE
PE_BADCREDENTIALS PE_BADCREDENTIALS
PE_BADPARTNER
PE_CERTIFICATEREQUIRED PE_CERTIFICATEREQUIRED
PE_OK
); );
our $VERSION = '2.0.0'; our $VERSION = '2.0.12';
extends 'Lemonldap::NG::Portal::Main::Auth'; extends 'Lemonldap::NG::Portal::Main::Auth';
@ -83,13 +84,13 @@ sub extractFormInfo {
} }
sub authenticate { sub authenticate {
PE_OK; return PE_OK;
} }
sub setAuthSessionInfo { sub setAuthSessionInfo {
my ( $self, $req ) = @_; my ( $self, $req ) = @_;
$req->{sessionInfo}->{authenticationLevel} = $self->conf->{webIDAuthnLevel}; $req->{sessionInfo}->{authenticationLevel} = $self->conf->{webIDAuthnLevel};
PE_OK; return PE_OK;
} }
sub getDisplayType { sub getDisplayType {

View File

@ -9,7 +9,7 @@ use Lemonldap::NG::Portal::Main::Constants qw(
PE_BADCREDENTIALS PE_BADCREDENTIALS
); );
our $VERSION = '2.0.11'; our $VERSION = '2.0.12';
extends qw( extends qw(
Lemonldap::NG::Portal::Main::Plugin Lemonldap::NG::Portal::Main::Plugin
@ -166,13 +166,8 @@ sub check {
# Check token # Check token
if ( $self->ottRule->( $req, {} ) ) { if ( $self->ottRule->( $req, {} ) ) {
my $token = $req->param('token'); my $token;
unless ($token) { if ( $token = $req->param('token') ) {
$self->userLogger->warn('CheckUser called without token');
$msg = PE_NOTOKEN;
$token = $self->ott->createToken();
}
else {
unless ( $self->ott->getToken($token) ) { unless ( $self->ott->getToken($token) ) {
$self->userLogger->warn( $self->userLogger->warn(
'CheckUser called with an expired/bad token'); 'CheckUser called with an expired/bad token');
@ -180,6 +175,11 @@ sub check {
$token = $self->ott->createToken(); $token = $self->ott->createToken();
} }
} }
else {
$self->userLogger->warn('CheckUser called without token');
$msg = PE_NOTOKEN;
$token = $self->ott->createToken();
}
my $params = { my $params = {
PORTAL => $self->conf->{portal}, PORTAL => $self->conf->{portal},

View File

@ -8,7 +8,7 @@ use Lemonldap::NG::Portal::Main::Constants qw(
PE_DECRYPTVALUE_SERVICE_NOT_ALLOWED PE_DECRYPTVALUE_SERVICE_NOT_ALLOWED
); );
our $VERSION = '2.0.11'; our $VERSION = '2.0.12';
extends qw( extends qw(
Lemonldap::NG::Portal::Main::Plugin Lemonldap::NG::Portal::Main::Plugin
@ -90,20 +90,20 @@ sub run {
# Check token # Check token
if ( $self->ottRule->( $req, {} ) ) { if ( $self->ottRule->( $req, {} ) ) {
my $token = $req->param('token'); my $token;
unless ($token) { if ( $token = $req->param('token') ) {
$self->userLogger->warn('decryptValue try without token');
$msg = PE_NOTOKEN;
$token = $self->ott->createToken();
}
else {
unless ( $self->ott->getToken($token) ) { unless ( $self->ott->getToken($token) ) {
$self->userLogger->warn( $self->userLogger->warn(
'decryptValue try with expired/bad token'); 'DecryptValue called with an expired/bad token');
$msg = PE_TOKENEXPIRED; $msg = PE_TOKENEXPIRED;
$token = $self->ott->createToken(); $token = $self->ott->createToken();
} }
} }
else {
$self->userLogger->warn('DecryptValue called without token');
$msg = PE_NOTOKEN;
$token = $self->ott->createToken();
}
my $params = { my $params = {
PORTAL => $self->conf->{portal}, PORTAL => $self->conf->{portal},