Commit 3a669167 authored by Xavier Guimard's avatar Xavier Guimard

Temp

parent 642e98e1
Pipeline #3441 failed with stages
in 4 minutes and 42 seconds
......@@ -28,7 +28,7 @@ Build-Depends-Indep: libapache-session-perl,
libjson-perl,
liblasso-perl,
libmime-tools-perl,
libmouse-perl,
libmoo-perl,
libnet-cidr-lite-perl,
libnet-ldap-perl,
libnet-openid-consumer-perl,
......@@ -197,7 +197,7 @@ Depends: ${misc:Depends},
libcrypt-rijndael-perl,
libhtml-template-perl,
libjson-perl,
libmouse-perl,
libmoo-perl,
libplack-perl,
liburi-perl,
libwww-perl
......
# debian/tests/runner launch pkg-perl-autopkgtest tests for each library
Test-Command: ./debian/tests/runner build-deps
Depends: @, @builddeps@, pkg-perl-autopkgtest, libmouse-perl
Depends: @, @builddeps@, pkg-perl-autopkgtest, libmoo-perl
Test-Command: ./debian/tests/runner runtime-deps
Depends: @, pkg-perl-autopkgtest, libmouse-perl
Depends: @, pkg-perl-autopkgtest, libmoo-perl
# Use pkg-perl-autopkgtest test for runtime-deps-and-recommends
# Some portal suggested dependencies are added here
......@@ -11,4 +11,4 @@ Test-Command: /usr/share/pkg-perl-autopkgtest/runner runtime-deps-and-recommends
Depends: @, @builddeps@, pkg-perl-autopkgtest, libyaml-perl, liblog-log4perl-perl, libauthen-pam-perl, libauthen-radius-perl, libweb-id-perl
#Test-Command: ./debian/tests/runner heavy-deps
#Depends: @, pkg-perl-autopkgtest, pkg-perl-autopkgtest-heavy, libmouse-perl
#Depends: @, pkg-perl-autopkgtest, pkg-perl-autopkgtest-heavy, libmoo-perl
......@@ -10,27 +10,23 @@ our $VERSION = '2.0.0';
use strict;
use Lemonldap::NG::Common::Session;
use Mouse;
use Moo;
use Digest::MD5 qw(md5_hex);
has 'storageModule' => (
is => 'ro',
isa => 'Str',
required => 1,
);
has 'storageModuleOptions' => (
is => 'ro',
isa => 'HashRef|Undef',
);
has 'storageModuleOptions' => ( is => 'ro' );
has code => ( is => 'rw', isa => 'Str' );
has code => ( is => 'rw' );
has md5 => ( is => 'rw', isa => 'Str' );
has md5 => ( is => 'rw' );
has image => ( is => 'rw', isa => 'Str' );
has image => ( is => 'rw' );
has size => ( is => 'ro', isa => 'Int' );
has size => ( is => 'ro' );
sub BUILD {
......@@ -115,6 +111,4 @@ sub removeSession {
return 0;
}
no Mouse;
1;
package Lemonldap::NG::Common::Cli;
use strict;
use Mouse;
use Moo;
use Lemonldap::NG::Common::Conf;
our $VERSION = '2.0.0';
has confAccess => (
is => 'rw',
builder => sub {
lazy=>1,
builder => 1,
);
sub _build_confAccess {
my $res = Lemonldap::NG::Common::Conf->new(
{
(
......@@ -21,11 +24,9 @@ has confAccess => (
die $Lemonldap::NG::Common::Conf::msg unless ($res);
return $res;
},
);
has cfgNum => (
is => 'rw',
isa => 'Int',
);
sub info {
......
package Lemonldap::NG::Common::Combination::Parser;
use strict;
use Mouse;
use Moo;
use Safe;
use constant PE_OK => 0;
......
......@@ -2,14 +2,14 @@ package Lemonldap::NG::Common::Conf::AccessLib;
use 5.10.0;
use utf8;
use Mouse;
use Moo;
use Lemonldap::NG::Common::Conf;
has '_confAcc' => ( is => 'rw', isa => 'Lemonldap::NG::Common::Conf' );
has 'configStorage' => ( is => 'rw', isa => 'HashRef', default => sub { {} } );
has 'currentConf' => ( is => 'rw', required => 1, default => sub { {} } );
has 'protection' => ( is => 'rw', isa => 'Str', default => 'manager' );
has '_confAcc' => ( is => 'rw' );
has 'configStorage' => ( is => 'rw', default => sub { {} } );
has 'currentConf' => ( is => 'rw', required => 1, default => sub { {} } );
has 'protection' => ( is => 'rw', default => sub { 'manager' } );
our $VERSION = '2.0.0';
......
package Lemonldap::NG::Common::Conf::Compact;
use strict;
use Mouse;
use Moo;
use Lemonldap::NG::Common::Conf::ReConstants;
our $VERSION = '2.0.0';
......
......@@ -2,7 +2,7 @@ package Lemonldap::NG::Common::Conf::RESTServer;
use strict;
use JSON 'from_json';
use Mouse;
use Moo;
use Lemonldap::NG::Common::Conf::Constants;
use Lemonldap::NG::Common::Conf::ReConstants;
......
......@@ -6,7 +6,7 @@
package Lemonldap::NG::Common::Conf::SAML::Metadata;
use strict;
use Mouse;
use Moo;
use Crypt::OpenSSL::RSA;
use Crypt::OpenSSL::X509;
use HTML::Template;
......
package Lemonldap::NG::Common::Module;
use strict;
use Mouse;
use Moo;
our $VERSION = '2.0.0';
......
package Lemonldap::NG::Common::Notifications;
use strict;
use Mouse;
use Moo;
our $VERSION = '2.0.0';
......@@ -20,7 +20,10 @@ sub import {
has notifField => (
is => 'rw',
builder => sub {
lazy=>1,
builder => 1,
);
sub _build_notifField {
my $uid =
$_[0]->conf->{notificationField}
|| $_[0]->conf->{whatToTrace}
......@@ -28,7 +31,6 @@ has notifField => (
$uid =~ s/^\$//;
return $uid;
}
);
sub getNotifications {
my ( $self, $uid ) = @_;
......
......@@ -6,7 +6,7 @@
package Lemonldap::NG::Common::Notifications::DBI;
use strict;
use Mouse;
use Moo;
use Time::Local;
use DBI;
use Encode;
......@@ -40,13 +40,15 @@ has dbiUser => (
}
);
has dbiPassword => ( is => 'ro', default => '' );
has dbiPassword => ( is => 'ro', default => sub{''} );
# Database handle object
has _dbh => (
is => 'rw',
lazy => 1,
builder => sub {
builder => 1,
);
sub _build__dbh {
my $self = shift;
my $r = DBI->connect_cached(
$self->{dbiChain}, $self->{dbiUser},
......@@ -55,7 +57,6 @@ has _dbh => (
$self->logger->error($DBI::errstr) unless ($r);
return $r;
}
);
# Current query
has sth => ( is => 'rw' );
......
......@@ -6,7 +6,7 @@
package Lemonldap::NG::Common::Notifications::File;
use strict;
use Mouse;
use Moo;
use MIME::Base64;
our $VERSION = '2.0.0';
......@@ -31,7 +31,7 @@ has table => (
}
);
has fileNameSeparator => ( is => 'rw', default => '_' );
has fileNameSeparator => ( is => 'rw', default => sub{'_'} );
# Returns notifications corresponding to the user $uid.
# If $ref is set, returns only notification corresponding to this reference.
......
package Lemonldap::NG::Common::Notifications::JSON;
use strict;
use Mouse;
use Moo;
use JSON qw(from_json to_json);
our $VERSION = '2.0.0';
......
......@@ -7,7 +7,7 @@
package Lemonldap::NG::Common::Notifications::LDAP;
use strict;
use Mouse;
use Moo;
use Time::Local;
use MIME::Base64;
use Net::LDAP;
......
package Lemonldap::NG::Common::Notifications::XML;
use strict;
use Mouse;
use Moo;
use XML::LibXML;
our $VERSION = '2.0.0';
......@@ -9,10 +9,13 @@ our $VERSION = '2.0.0';
# XML parser
has parser => (
is => 'rw',
builder => sub {
lazy=>1,
builder => 1,
);
sub _build_parser {
return XML::LibXML->new();
}
);
# Check XML data and insert new notifications.
# @param $xml XML string containing notification
......
package Lemonldap::NG::Common::PSGI;
use 5.10.0;
use Mouse;
use Moo;
use JSON;
use Lemonldap::NG::Common::PSGI::Constants;
use Lemonldap::NG::Common::PSGI::Request;
......@@ -12,16 +12,16 @@ our $_json = JSON->new->allow_nonref;
# PROPERTIES
has error => ( is => 'rw', default => '' );
has languages => ( is => 'rw', isa => 'Str', default => 'en' );
has logLevel => ( is => 'rw', isa => 'Str', default => 'info' );
has portal => ( is => 'rw', isa => 'Str' );
has staticPrefix => ( is => 'rw', isa => 'Str' );
has templateDir => ( is => 'rw', isa => 'Str' );
has links => ( is => 'rw', isa => 'ArrayRef' );
has menuLinks => ( is => 'rw', isa => 'ArrayRef' );
has logger => ( is => 'rw' );
has userLogger => ( is => 'rw' );
has error => ( is => 'rw', default => sub { '' } );
has languages => ( is => 'rw', default => sub { 'en' } );
has logLevel => ( is => 'rw', default => sub { 'info' } );
has portal => ( is => 'rw' );
has staticPrefix => ( is => 'rw' );
has templateDir => ( is => 'rw' );
has links => ( is => 'rw' );
has menuLinks => ( is => 'rw' );
has logger => ( is => 'rw' );
has userLogger => ( is => 'rw' );
# INITIALIZATION
......
package Lemonldap::NG::Common::PSGI::Cli::Lib;
use JSON;
use Mouse;
use Moo;
use Lemonldap::NG::Common::PSGI;
our $VERSION = '2.0.0';
has iniFile => ( is => 'ro', isa => 'Str' );
has iniFile => ( is => 'ro' );
has app => ( is => 'ro', isa => 'CodeRef' );
has app => ( is => 'ro' );
sub _get {
my ( $self, $path, $query ) = @_;
......
......@@ -2,7 +2,7 @@ package Lemonldap::NG::Common::PSGI::Request;
use strict;
use 5.14.0;
use Mouse;
use Moo;
use JSON;
use Plack::Request;
use URI::Escape;
......
package Lemonldap::NG::Common::PSGI::Router;
use Mouse;
use Moo;
use Lemonldap::NG::Common::PSGI;
use Lemonldap::NG::Common::PSGI::Constants;
......@@ -11,10 +11,9 @@ extends 'Lemonldap::NG::Common::PSGI';
# Properties
has 'routes' => (
is => 'rw',
isa => 'HashRef',
default => sub { { GET => {}, POST => {}, PUT => {}, DELETE => {} } }
);
has 'defaultRoute' => ( is => 'rw', default => 'index.html' );
has 'defaultRoute' => ( is => 'rw', default => sub{'index.html'} );
# Routes initialization
......
......@@ -10,71 +10,36 @@ our $VERSION = '2.0.0';
use Lemonldap::NG::Common::Apache::Session;
# Workaround for another ModPerl/Mouse issue...
BEGIN {
require Mouse;
my $v = sprintf( "%d.%03d%03d", ( $Mouse::VERSION =~ /(\d+)/g ) );
if ( $v < 2.005001 and $Lemonldap::NG::Handler::Apache2::Main::VERSION ) {
require Moose;
Moose->import();
}
else {
Mouse->import();
}
}
use Moo;
has 'id' => (
is => 'rw',
isa => 'Str|Undef',
);
has 'id' => ( is => 'rw', );
has 'force' => (
is => 'rw',
isa => 'Bool',
default => 0,
default => sub { 0 },
);
has 'kind' => (
is => 'rw',
isa => 'Str|Undef',
);
has 'kind' => ( is => 'rw', );
has 'data' => (
is => 'rw',
isa => 'HashRef',
default => sub { {} },
);
has 'options' => (
is => 'rw',
isa => 'HashRef',
);
has 'options' => ( is => 'rw', );
has 'storageModule' => (
is => 'ro',
isa => 'Str',
required => 1,
);
has 'storageModuleOptions' => (
is => 'ro',
isa => 'HashRef|Undef',
);
has 'storageModuleOptions' => ( is => 'ro', );
has 'cacheModule' => (
is => 'rw',
isa => 'Str|Undef',
);
has 'cacheModule' => ( is => 'rw', );
has 'cacheModuleOptions' => (
is => 'rw',
isa => 'HashRef|Undef',
);
has 'cacheModuleOptions' => ( is => 'rw', );
has 'error' => (
is => 'rw',
isa => 'Str|Undef',
);
has 'error' => ( is => 'rw', );
has info => ( is => 'rw' );
......@@ -224,6 +189,4 @@ sub remove {
return 1;
}
no Mouse;
1;
package Lemonldap::NG::Common::Session::REST;
use strict;
use Mouse;
use Moo;
use Lemonldap::NG::Common::Conf::Constants;
use JSON qw(from_json to_json);
......
......@@ -4,7 +4,7 @@ package Lemonldap::NG::Common::TOTP;
# <gryphon@cpan.org>
use strict;
use Mouse;
use Moo;
use Convert::Base32 'decode_base32';
use Digest::HMAC_SHA1 'hmac_sha1_hex';
......
package Lemonldap::NG::Handler::Lib::PSGI;
#use 5.10.0;
use Mouse;
use Moo;
#use Lemonldap::NG::Handler::Main qw(:jailSharedVars);
our $VERSION = '2.0.0';
has protection => ( is => 'rw', isa => 'Str' );
has rule => ( is => 'rw', isa => 'Str' );
has api => ( is => 'rw', isa => 'Str' );
has protection => ( is => 'rw' );
has rule => ( is => 'rw' );
has api => ( is => 'rw' );
## @method boolean init($args)
# Initalize main handler
......
......@@ -5,22 +5,11 @@ use strict;
use Safe;
use Lemonldap::NG::Common::Safelib; #link protected safe Safe object
# Workaround for another ModPerl/Mouse issue...
BEGIN {
require Mouse;
my $v = sprintf( "%d.%03d%03d", ( $Mouse::VERSION =~ /(\d+)/g ) );
if ( $v < 2.005001 and $Lemonldap::NG::Handler::Apache2::Main::VERSION ) {
require Moose;
Moose->import();
}
else {
Mouse->import();
}
}
use Moo;
has customFunctions => ( is => 'rw', isa => 'Maybe[Str]' );
has customFunctions => ( is => 'rw' );
has useSafeJail => ( is => 'rw', isa => 'Maybe[Int]' );
has useSafeJail => ( is => 'rw' );
has jail => ( is => 'rw' );
......
......@@ -4,7 +4,7 @@
package Lemonldap::NG::Handler::PSGI;
use 5.10.0;
use Mouse;
use Moo;
use Lemonldap::NG::Handler::PSGI::Main;
extends 'Lemonldap::NG::Handler::Lib::PSGI', 'Lemonldap::NG::Common::PSGI';
......
package Lemonldap::NG::Handler::PSGI::Router;
use 5.10.0;
use Mouse;
use Moo;
require Lemonldap::NG::Handler::PSGI::Main;
extends 'Lemonldap::NG::Handler::Lib::PSGI',
......
package Lemonldap::NG::Handler::PSGI::Try;
use strict;
use Mouse;
use Moo;
our $VERSION = '2.0.0';
......@@ -9,13 +9,11 @@ extends 'Lemonldap::NG::Handler::PSGI::Router';
has 'authRoutes' => (
is => 'rw',
isa => 'HashRef',
default => sub { { GET => {}, POST => {}, PUT => {}, DELETE => {} } }
);
has 'unAuthRoutes' => (
is => 'rw',
isa => 'HashRef',
default => sub { { GET => {}, POST => {}, PUT => {}, DELETE => {} } }
);
......
......@@ -4,7 +4,7 @@
package Lemonldap::NG::Handler::Server;
use strict;
use Mouse;
use Moo;
use Lemonldap::NG::Handler::Server::Main;
our $VERSION = '2.0.0';
......
......@@ -3,7 +3,7 @@
package Lemonldap::NG::Handler::Server::Nginx;
use strict;
use Mouse;
use Moo;
use Lemonldap::NG::Handler::Server::Main;
our $VERSION = '2.0.0';
......
......@@ -29,7 +29,7 @@ sub init {
cookieName => 'lemonldap',
securedCookie => 0,
https => 0,
logger => 'Lemonldap::NG::Common::Logger::Std',
logger => 'Lemonldap::NG::Common::Logger::Std',
%$prms
);
ok(
......@@ -87,7 +87,7 @@ sub clean {
package Lemonldap::NG::Handler::PSGI::Cli::Lib;
use Mouse;
use Moo;
extends 'Lemonldap::NG::Common::PSGI::Cli::Lib';
......@@ -95,12 +95,14 @@ has ini => ( is => 'rw' );
has app => (
is => 'ro',
isa => 'CodeRef',
builder => sub {
return $module->run( $_[0]->{ini} );
}
lazy => 1,
builder => 1,
);
sub _build_app {
return $module->run( $_[0]->{ini} );
</