Perl critic

2620-ppolicy-binding
Christophe Maudoux 4 years ago
parent bcfb075f63
commit c0db322ef0
  1. 10
      lemonldap-ng-portal/lib/Lemonldap/NG/Portal/Lib/Captcha.pm
  2. 4
      lemonldap-ng-portal/lib/Lemonldap/NG/Portal/Lib/Notifications/JSON.pm
  3. 4
      lemonldap-ng-portal/lib/Lemonldap/NG/Portal/Lib/Notifications/XML.pm
  4. 4
      lemonldap-ng-portal/lib/Lemonldap/NG/Portal/Lib/OneTimeToken.pm
  5. 11
      lemonldap-ng-portal/lib/Lemonldap/NG/Portal/Lib/RESTProxy.pm
  6. 12
      lemonldap-ng-portal/lib/Lemonldap/NG/Portal/Lib/SOAPProxy.pm
  7. 4
      lemonldap-ng-portal/lib/Lemonldap/NG/Portal/Lib/_tokenRule.pm
  8. 5
      lemonldap-ng-portal/lib/Lemonldap/NG/Portal/Register/Demo.pm
  9. 7
      lemonldap-ng-portal/lib/Lemonldap/NG/Portal/UserDB/CAS.pm
  10. 4
      lemonldap-ng-portal/lib/Lemonldap/NG/Portal/UserDB/Demo.pm
  11. 11
      lemonldap-ng-portal/lib/Lemonldap/NG/Portal/UserDB/Facebook.pm
  12. 8
      lemonldap-ng-portal/lib/Lemonldap/NG/Portal/UserDB/LDAP.pm
  13. 12
      lemonldap-ng-portal/lib/Lemonldap/NG/Portal/UserDB/Null.pm
  14. 20
      lemonldap-ng-portal/lib/Lemonldap/NG/Portal/UserDB/OpenID.pm
  15. 14
      lemonldap-ng-portal/lib/Lemonldap/NG/Portal/UserDB/OpenIDConnect.pm
  16. 4
      lemonldap-ng-portal/lib/Lemonldap/NG/Portal/UserDB/Proxy.pm
  17. 16
      lemonldap-ng-portal/lib/Lemonldap/NG/Portal/UserDB/Remote.pm
  18. 16
      lemonldap-ng-portal/lib/Lemonldap/NG/Portal/UserDB/SAML.pm
  19. 12
      lemonldap-ng-portal/lib/Lemonldap/NG/Portal/UserDB/Slave.pm
  20. 15
      lemonldap-ng-portal/lib/Lemonldap/NG/Portal/UserDB/WebID.pm

@ -1,11 +1,11 @@
package Lemonldap::NG::Portal::Lib::Captcha;
use strict;
use GD::SecurityImage use_magick => 1;
use Mouse;
use MIME::Base64;
use GD::SecurityImage use_magick => 1;
our $VERSION = '2.0.1';
our $VERSION = '2.0.12';
extends 'Lemonldap::NG::Common::Module';
@ -60,7 +60,9 @@ has ott => (
}
);
sub init { 1 }
sub init {
return 1;
}
# Returns secret + a HTML image src content
sub getCaptcha {
@ -76,7 +78,7 @@ sub getCaptcha {
$image->random;
$image->create( 'normal', 'default', $self->fgColor, $self->bgColor );
my ( $imageData, $mimeType, $rdm ) = $image->out( force => 'png' );
my $img = 'data:image/png;base64,' . encode_base64( $imageData, '' );
my $img = 'data:image/png;base64,' . encode_base64( $imageData, '' );
my $token = $self->ott->createToken( { captcha => $rdm } );
return ( $token, $img );
}

@ -5,7 +5,7 @@ use Mouse;
use JSON qw(from_json);
use POSIX qw(strftime);
our $VERSION = '2.0.9';
our $VERSION = '2.0.12';
no warnings 'redefine';
@ -21,7 +21,7 @@ has notifObject => ( is => 'rw' );
# INITIALIZATION
sub init {
1;
return 1;
}
# Search for notifications and if any, returns HTML fragment.

@ -6,7 +6,7 @@ use XML::LibXML;
use XML::LibXSLT;
use POSIX qw(strftime);
our $VERSION = '2.0.9';
our $VERSION = '2.0.12';
# Lemonldap::NG::Portal::Main::Plugin provides addAuthRoute() and
# addUnauthRoute() methods in addition of Lemonldap::NG::Common::Module.
@ -52,7 +52,7 @@ has server => ( is => 'rw' );
# INITIALIZATION
sub init {
1;
return 1;
}
# Search for notifications and if any, returns HTML fragment.

@ -42,7 +42,9 @@ has cache => (
},
);
sub init { 1 }
sub init {
return 1;
}
sub createToken {
my ( $self, $infos ) = @_;

@ -7,7 +7,7 @@ use Lemonldap::NG::Common::UserAgent;
use Lemonldap::NG::Portal::Main::Constants qw(PE_OK PE_ERROR PE_BADCREDENTIALS);
use Lemonldap::NG::Common::FormEncode;
our $VERSION = '2.0.11';
our $VERSION = '2.0.12';
has ua => ( is => 'rw' );
@ -61,13 +61,14 @@ sub getUser {
$self->logger->debug( 'Store remote cookies in session ('
. $req->sessionInfo->{_proxyCookies}
. ')' );
PE_OK;
return PE_OK;
}
sub findUser {
# Nothing to do here
PE_OK;
return PE_OK;
}
sub setSessionInfo {
@ -96,7 +97,8 @@ sub setSessionInfo {
$req->{sessionInfo}->{$_} ||= $res->{$_} unless (/^_/);
}
$req->data->{_setSessionInfoDone}++;
PE_OK;
return PE_OK;
}
sub authLogout {
@ -111,6 +113,7 @@ sub authLogout {
]
);
my $resp = $self->ua->request($q);
return PE_OK;
}

@ -5,7 +5,7 @@ use Mouse;
use SOAP::Lite;
use Lemonldap::NG::Portal::Main::Constants qw(PE_OK PE_ERROR PE_BADCREDENTIALS);
our $VERSION = '2.0.11';
our $VERSION = '2.0.12';
# INITIALIZATION
@ -61,13 +61,14 @@ sub getUser {
return PE_ERROR;
}
$req->data->{_proxyQueryDone}++;
PE_OK;
return PE_OK;
}
sub findUser {
# Nothing to do here
PE_OK;
return PE_OK;
}
sub setSessionInfo {
@ -90,11 +91,12 @@ sub setSessionInfo {
unless (/^_/);
}
$req->data->{_setSessionInfoDone}++;
PE_OK;
return PE_OK;
}
sub authLogout {
PE_OK;
return PE_OK;
}
1;

@ -21,6 +21,8 @@ has ottRule => (
}
);
sub init { 1 }
sub init {
return 1;
}
1;

@ -9,10 +9,10 @@ use Lemonldap::NG::Portal::Main::Constants qw(
extends 'Lemonldap::NG::Portal::Register::Base';
our $VERSION = '2.0.10';
our $VERSION = '2.0.12';
sub init {
1;
return 1;
}
# Compute a login from register infos
@ -44,6 +44,7 @@ sub createUser {
. $req->data->{registerInfo}->{lastname},
mail => $req->data->{registerInfo}->{login} . '@badwolf.org',
};
return PE_OK;
}

@ -7,7 +7,7 @@ use Lemonldap::NG::Portal::Main::Constants qw(
PE_OK
);
our $VERSION = '2.0.11';
our $VERSION = '2.0.12';
extends 'Lemonldap::NG::Common::Module';
@ -46,12 +46,13 @@ sub setSessionInfo {
foreach ( keys %ev ) {
$req->{sessionInfo}->{$_} = $req->data->{casAttrs}->{$_};
}
PE_OK;
return PE_OK;
}
# Does nothing
sub setGroups {
PE_OK;
return PE_OK;
}
1;

@ -15,7 +15,7 @@ use Lemonldap::NG::Portal::Main::Constants qw(
extends 'Lemonldap::NG::Common::Module';
our $VERSION = '2.0.11';
our $VERSION = '2.0.12';
# Sample accounts from Doctor Who characters
our %demoAccounts = (
@ -45,7 +45,7 @@ our %demoGroups = (
# INITIALIZATION
sub init {
1;
return 1;
}
# RUNNING METHODS

@ -6,7 +6,7 @@ use Lemonldap::NG::Portal::Main::Constants qw(PE_OK PE_MISSINGREQATTR);
extends 'Lemonldap::NG::Common::Module';
our $VERSION = '2.0.11';
our $VERSION = '2.0.12';
has vars => (
is => 'rw',
@ -30,13 +30,13 @@ sub init {
sub getUser {
# All is done by Auth::Facebook
PE_OK;
return PE_OK;
}
sub findUser {
# Nothing to do here
PE_OK;
return PE_OK;
}
sub setSessionInfo {
@ -56,11 +56,12 @@ sub setSessionInfo {
return PE_MISSINGREQATTR;
}
}
PE_OK;
return PE_OK;
}
sub setGroups {
PE_OK;
return PE_OK;
}
1;

@ -7,7 +7,7 @@ use Lemonldap::NG::Portal::Main::Constants qw(PE_OK);
extends 'Lemonldap::NG::Portal::Lib::LDAP';
our $VERSION = '2.0.6';
our $VERSION = '2.0.12';
has ldapGroupAttributeNameSearch => (
is => 'rw',
@ -50,7 +50,8 @@ sub setSessionInfo {
$req->sessionInfo->{$k} = $value;
}
PE_OK;
return PE_OK;
}
# Load all groups in $groups.
@ -100,7 +101,8 @@ sub setGroups {
$req->{sessionInfo}->{groups} = $groups;
$req->{sessionInfo}->{hGroups} = $hGroups;
PE_OK;
return PE_OK;
}
1;

@ -6,30 +6,30 @@ use Lemonldap::NG::Portal::Main::Constants;
extends 'Lemonldap::NG::Common::Module';
our $VERSION = '2.0.0';
our $VERSION = '2.0.12';
# INITIALIZATION
sub init {
1;
return 1;
}
# RUNNING METHODS
sub getUser {
PE_OK;
return PE_OK;
}
sub findUser {
PE_OK;
return PE_OK;
}
sub setSessionInfo {
PE_OK;
return PE_OK;
}
sub setGroups {
PE_OK;
return PE_OK;
}
1;

@ -3,30 +3,31 @@ package Lemonldap::NG::Portal::UserDB::OpenID;
use strict;
use Mouse;
use Lemonldap::NG::Portal::Main::Constants qw(
PE_MISSINGREQATTR
PE_OK
PE_MISSINGREQATTR
);
our $VERSION = '2.0.0';
our $VERSION = '2.0.12';
extends 'Lemonldap::NG::Common::Module',
'Lemonldap::NG::Portal::Lib::OpenIDConnect';
extends qw(
Lemonldap::NG::Common::Module
Lemonldap::NG::Portal::Lib::OpenIDConnect
);
# INITIALIZATION
sub init {
my ($self) = @_;
return 1;
}
# RUNNING METHODS
sub getUser {
PE_OK;
return PE_OK;
}
sub findUser {
PE_OK;
return PE_OK;
}
sub setSessionInfo {
@ -54,12 +55,13 @@ sub setSessionInfo {
);
}
}
PE_OK;
return PE_OK;
}
# Does nothing
sub setGroups {
PE_OK;
return PE_OK;
}
1;

@ -8,10 +8,12 @@ use Lemonldap::NG::Portal::Main::Constants qw(
PE_OK
);
our $VERSION = '2.0.11';
our $VERSION = '2.0.12';
extends 'Lemonldap::NG::Common::Module',
'Lemonldap::NG::Portal::Lib::OpenIDConnect';
extends qw(
Lemonldap::NG::Common::Module
Lemonldap::NG::Portal::Lib::OpenIDConnect
);
# INITIALIZATION
@ -56,7 +58,7 @@ sub getUser {
sub findUser {
# Nothing to do here
PE_OK;
return PE_OK;
}
# Get all required attributes
@ -73,12 +75,12 @@ sub setSessionInfo {
$req->{sessionInfo}->{$k} = $req->data->{OpenIDConnect_user_info}->{$v};
}
PE_OK;
return PE_OK;
}
# Does nothing
sub setGroups {
PE_OK;
return PE_OK;
}
1;

@ -6,7 +6,7 @@ use Lemonldap::NG::Portal::Main::Constants 'PE_OK';
extends 'Lemonldap::NG::Common::Module';
our $VERSION = '2.0.0';
our $VERSION = '2.0.12';
# INITIALIZATION
@ -26,7 +26,7 @@ sub init {
# RUNNING METHODS
sub setGroups {
PE_OK;
return PE_OK;
}
1;

@ -2,11 +2,14 @@ package Lemonldap::NG::Portal::UserDB::Remote;
use strict;
use Mouse;
use Lemonldap::NG::Portal::Main::Constants qw(PE_OK);
use Lemonldap::NG::Portal::Main::Constants 'PE_OK';
our $VERSION = '2.0.11';
our $VERSION = '2.0.12';
extends 'Lemonldap::NG::Common::Module', 'Lemonldap::NG::Portal::Lib::Remote';
extends qw(
Lemonldap::NG::Common::Module
Lemonldap::NG::Portal::Lib::Remote
);
# RUNNING METHODS
@ -15,18 +18,19 @@ extends 'Lemonldap::NG::Common::Module', 'Lemonldap::NG::Portal::Lib::Remote';
sub findUser {
# Nothing to do here
PE_OK;
return PE_OK;
}
sub setSessionInfo {
my ( $self, $req ) = @_;
delete $req->data->{rSessionInfo}->{_session_id};
$req->{sessionInfo} = $req->data->{rSessionInfo};
PE_OK;
return PE_OK;
}
sub setGroups {
PE_OK;
return PE_OK;
}
1;

@ -10,9 +10,12 @@ use Lemonldap::NG::Portal::Main::Constants qw(
PE_SAML_LOAD_SERVICE_ERROR
);
our $VERSION = '2.0.5';
our $VERSION = '2.0.12';
extends 'Lemonldap::NG::Common::Module', 'Lemonldap::NG::Portal::Lib::SAML';
extends qw(
Lemonldap::NG::Common::Module
Lemonldap::NG::Portal::Lib::SAML
);
# INITIALIZATION
@ -23,6 +26,7 @@ sub init {
$self->lassoServer(
$self->p->loadedModules->{'Lemonldap::NG::Portal::Auth::SAML'}
->lassoServer );
return 1;
}
@ -30,11 +34,11 @@ sub init {
# Does nothing
sub getUser {
PE_OK;
return PE_OK;
}
sub findUser {
PE_OK;
return PE_OK;
}
# Get all required attributes
@ -179,12 +183,12 @@ sub setSessionInfo {
# Restore current Lasso::Server
$self->lassoServer = $current_server;
PE_OK;
return PE_OK;
}
# Does nothing
sub setGroups {
PE_OK;
return PE_OK;
}
1;

@ -13,7 +13,7 @@ use Lemonldap::NG::Portal::Main::Constants qw(
PE_FORBIDDENIP
);
our $VERSION = '2.0.10';
our $VERSION = '2.0.12';
extends qw(
Lemonldap::NG::Common::Module
@ -22,16 +22,18 @@ extends qw(
# INITIALIZATION
sub init { 1 }
sub init {
return 1;
}
# RUNNING METHODS
sub getUser {
PE_OK;
return PE_OK;
}
sub findUser {
PE_OK;
return PE_OK;
}
# Search exportedVars values in HTTP headers.
@ -54,7 +56,7 @@ sub setSessionInfo {
}
sub setGroups {
PE_OK;
return PE_OK;
}
1;

@ -3,29 +3,29 @@ package Lemonldap::NG::Portal::UserDB::WebID;
use strict;
use Mouse;
use Lemonldap::NG::Portal::Main::Constants qw(
PE_OK
PE_ERROR
PE_MISSINGREQATTR
PE_OK
);
extends 'Lemonldap::NG::Common::Module';
our $VERSION = '2.0.0';
our $VERSION = '2.0.12';
# INITIALIZATION
sub init {
1;
return 1;
}
# RUNNING METHODS
sub getUser {
PE_OK;
return PE_OK;
}
sub findUser {
PE_OK;
return PE_OK;
}
sub setSessionInfo {
@ -52,11 +52,12 @@ sub setSessionInfo {
return PE_MISSINGREQATTR;
}
}
PE_OK;
return PE_OK;
}
sub setGroups {
PE_OK;
return PE_OK;
}
1;

Loading…
Cancel
Save