- merging tests from lemonldap-ng-experimental branch to trunk


			
			
				environments/ppa-mbqj77/deployments/1
			
			
		
David COUTADEUR 11 years ago
parent e40020674a
commit 81553b7a5e
  1. 86
      lemonldap-ng-handler/t/01-Lemonldap-NG-Handler-Main.t
  2. 76
      lemonldap-ng-handler/t/01-Lemonldap-NG-Handler-Simple.t
  3. 57
      lemonldap-ng-handler/t/02-Lemonldap-NG-Handler-Main-Portal.t
  4. 38
      lemonldap-ng-handler/t/02-Lemonldap-NG-Handler-Portal.t
  5. 102
      lemonldap-ng-handler/t/04-Lemonldap-NG-Handler-Initialization-LocalInit.t
  6. 38
      lemonldap-ng-handler/t/05-Lemonldap-NG-Handler-Initialization-GlobalInit.t
  7. 89
      lemonldap-ng-handler/t/10-Lemonldap-NG-Handler-DefaultHandler.t
  8. 15
      lemonldap-ng-handler/t/10-Lemonldap-NG-Handler-SharedConf.t
  9. 69
      lemonldap-ng-handler/t/11-Lemonldap-NG-Handler-Status.t
  10. 45
      lemonldap-ng-handler/t/12-Lemonldap-NG-Handler-Jail.t
  11. 24
      lemonldap-ng-handler/t/12-Lemonldap-NG-Handler-Safe.t
  12. 31
      lemonldap-ng-handler/t/13-Lemonldap-NG-Handler-Fake-Safe.t
  13. 18
      lemonldap-ng-handler/t/30-Lemonldap-NG-Handler-CGI.t
  14. 2
      lemonldap-ng-handler/t/40-Lemonldap-NG-Handler-Proxy.t
  15. 11
      lemonldap-ng-handler/t/50-Lemonldap-NG-Handler-SecureToken.t
  16. 12
      lemonldap-ng-handler/t/51-Lemonldap-NG-Handler-Zimbra.t
  17. 12
      lemonldap-ng-handler/t/52-Lemonldap-NG-Handler-AuthBasic.t
  18. 90
      lemonldap-ng-handler/t/lmConf-1
  19. 155
      lemonldap-ng-manager/MANIFEST
  20. 46
      lemonldap-ng-manager/Makefile.PL
  21. 15
      lemonldap-ng-manager/t/10-Manager.t
  22. 15
      lemonldap-ng-manager/t/40-Manager-Sessions.t

@ -0,0 +1,86 @@
package FakeApacheRequest;
sub hostname {
return "test1.example.com";
}
# Before `make install' is performed this script should be runnable with
# `make test'. After `make install' it should work as `perl Lemonldap-NG-Handler.t'
#########################
# change 'tests => 1' to 'tests => last_test_to_print';
package LemonldapNGHandlerMain;
use strict;
use warnings;
use Test::More tests => 10;
BEGIN { use_ok( 'Lemonldap::NG::Handler::Main', qw(:all $apacheRequest) ) }
# get a fake apacheRequest to simulate subroutine hostname
$Lemonldap::NG::Handler::Main::apacheRequest = bless {}, 'FakeApacheRequest';
# get a standard basic configuration in $args hashref
use Cwd 'abs_path';
use File::Basename;
use lib dirname( abs_path $0 );
#########################
# Insert your test code below, the Test::More module is use()ed here so read
# its man page ( perldoc Test::More ) for help writing this test script.
my $h;
$h = bless {}, 'Lemonldap::NG::Handler::Main';
open STDERR, '>/dev/null';
ok(
$h->localInit(
{
localStorage => 'Cache::FileCache',
localStorageOptions => { 'namespace' => 'lemonldap-ng-sessions', },
}
),
'localInit'
);
my $args = {
'portal' => 'http://auth.example.com/',
'globalStorage' => 'Apache::Session::File',
'post' => {},
'locationRules' => {
'test1.example.com' => {
# Basic rules
'default' => 'accept',
'^/no' => 'deny',
'test' => '$groups =~ /\badmin\b/',
# Bad ordered rules
'^/a/a' => 'deny',
'^/a' => 'accept',
# Good ordered rules
'(?#1 first)^/b/a' => 'deny',
'(?#2 second)^/b' => 'accept',
},
},
};
# includes
# - defaultValuesInit
# - portalInit
# - locationRulesInit
# - globalStorageInit
# - headerListInit
# - forgeHeadersInit
# - postUrlInit
ok( $h->globalInit($args), 'globalInit' );
ok( $h->portal() eq 'http://auth.example.com/', 'portal' );
ok( $h->grant('/s'), 'basic rule "accept"' );
ok( !$h->grant('/no'), 'basic rule "deny"' );
ok( $h->grant('/a/a'), 'bad ordered rule 1/2' );
ok( $h->grant('/a'), 'bad ordered rule 2/2' );
ok( !$h->grant('/b/a'), 'good ordered rule 1/2' );
ok( $h->grant('/b'), 'good ordered rule 2/2' );

@ -1,76 +0,0 @@
# Before `make install' is performed this script should be runnable with
# `make test'. After `make install' it should work as `perl Lemonldap-NG-Handler.t'
#########################
# change 'tests => 1' to 'tests => last_test_to_print';
use Test::More tests => 15;
BEGIN { use_ok( 'Lemonldap::NG::Handler::Simple', ':all' ) }
#########################
# Insert your test code below, the Test::More module is use()ed here so read
# its man page ( perldoc Test::More ) for help writing this test script.
my $h;
$h = bless {}, 'Lemonldap::NG::Handler::Simple';
ok(
$h->localInit(
{
localStorage => 'Cache::FileCache',
localStorageOptions => { 'namespace' => 'lemonldap-ng-sessions', },
}
),
'localInit'
);
ok(
$h->locationRulesInit(
{
locationRules => {
# Basic rules
default => 'accept',
'^/no' => 'deny',
'test' => '$groups =~ /\badmin\b/',
# Bad ordered rules
'^/a/a' => 'deny',
'^/a' => 'accept',
# Good ordered rules
'(?#1 first)^/b/a' => 'deny',
'(?#2 second)^/b' => 'accept',
},
}
),
'locationRulesInit'
);
ok( $h->defaultValuesInit(), 'defaultValuesInit' );
# Test simple portal subroutine
# See t/02-* for complex portal subroutine
ok( ( $h->portalInit( { portal => 'http://auth.example.com' } ) or 1 ),
'portalInit' );
ok( $h->portal() eq 'http://auth.example.com', 'portal' );
ok(
$h->globalStorageInit(
{
globalStorage => 'Apache::Session::File',
globalStorageOptions => {},
}
),
'globalStorageInit'
);
ok( $h->forgeHeadersInit, 'forgeHeadersInit' );
ok( $h->forgeHeadersInit( { exportedHeaders => { Auth => '$uid', } } ),
'forgeHeadersInit 2' );
open STDERR, '>/dev/null';
ok( $h->grant('/s'), 'basic rule "accept"' );
ok( !$h->grant('/no'), 'basic rule "deny"' );
ok( $h->grant('/a/a'), 'bad ordered rule 1/2' );
ok( $h->grant('/a'), 'bad ordered rule 2/2' );
ok( !$h->grant('/b/a'), 'good ordered rule 1/2' );
ok( $h->grant('/b'), 'good ordered rule 2/2' );

@ -0,0 +1,57 @@
# Before `make install' is performed this script should be runnable with
# `make test'. After `make install' it should work as `perl Lemonldap-NG-Handler.t'
#########################
# change 'tests => 1' to 'tests => last_test_to_print';
no warnings;
use Test::More; #qw(no_plan)
my $numTests = 2;
eval { require Test::MockObject }
or { $numTests = 1
and warn "Warning: Test::MockObject is needed to run deeper tests\n" };
plan tests => $numTests;
# get a standard basic configuration in $args hashref
use Cwd 'abs_path';
use File::Basename;
use lib dirname( abs_path $0 );
open STDERR, '>/dev/null';
#########################
# Insert your test code below, the Test::More module is use()ed here so read
# its man page ( perldoc Test::More ) for help writing this test script.
use_ok( 'Lemonldap::NG::Handler::Main', ':all' );
if ( $numTests == 2 ) {
my $h;
$h = bless {}, 'Lemonldap::NG::Handler::Main';
# Portal value with $vhost
# $vhost -> test.example.com
# Create a fake Apache2::RequestRec
my $mock = Test::MockObject->new();
$mock->fake_module(
'Apache2::RequestRec' => new =>
sub { return bless {}, 'Apache2::RequestRec' },
hostname => sub { 'test.example.com' },
);
our $apacheRequest = Apache2::RequestRec->new();
my $portal = '"http://".$vhost."/portal"';
my $args = {
'portal' => "$portal",
'globalStorage' => 'Apache::Session::File',
'post' => {},
};
$h->globalInit($args);
ok( ( $h->portal() eq 'http://test.example.com/portal' ),
'Portal value with $vhost' );
}

@ -1,38 +0,0 @@
# Before `make install' is performed this script should be runnable with
# `make test'. After `make install' it should work as `perl Lemonldap-NG-Handler.t'
#########################
# change 'tests => 1' to 'tests => last_test_to_print';
no warnings;
use Test::More; #qw(no_plan)
eval { require Test::MockObject }
or plan skip_all => 'Test::MockObject required to test portal subroutine';
plan tests => 2;
#########################
# Insert your test code below, the Test::More module is use()ed here so read
# its man page ( perldoc Test::More ) for help writing this test script.
use_ok( 'Lemonldap::NG::Handler::Simple', ':all' );
my $h;
$h = bless {}, 'Lemonldap::NG::Handler::Simple';
# Portal value with $vhost
# $vhost -> test.example.com
# Create a fake Apache2::RequestRec
my $mock = Test::MockObject->new();
$mock->fake_module(
'Apache2::RequestRec' => new =>
sub { return bless {}, 'Apache2::RequestRec' },
hostname => sub { 'test.example.com' },
);
our $apacheRequest = Apache2::RequestRec->new();
my $portal = '"http://".$vhost."/portal"';
$h->portalInit( { portal => $portal } );
ok( ( $h->portal() eq 'http://test.example.com/portal' ),
'Portal value with $vhost' );

@ -0,0 +1,102 @@
# Before `make install' is performed this script should be runnable with
# `make test'. After `make install' it should work as `perl Lemonldap-NG-Handler-Vhost.t'
#########################
# change 'tests => 1' to 'tests => last_test_to_print';
package My::Package;
use Test::More tests => 15;
BEGIN {
use_ok('Lemonldap::NG::Handler::Initialization::LocalInit');
}
#########################
# Insert your test code below, the Test::More module is use()ed here so read
# its man page ( perldoc Test::More ) for help writing this test script.
ok(
my $localinit = Lemonldap::NG::Handler::Initialization::LocalInit->new(
localStorage => undef,
refLocalStorage => undef,
localStorageOptions => undef,
childInitDone => undef,
),
'new LocalInit object'
);
ok(
my (
$localStorage, $refLocalStorage, $localStorageOptions,
$statusPipe, $statusOut, $childInitDone
)
= $localinit->localInit(
{
localStorage => 'Cache::FileCache',
localStorageOptions => { 'namespace' => 'lemonldap-ng-sessions', },
status => 1,
}
),
'LocalInit methods: localInit'
);
ok(
(
$localStorage eq 'Cache::FileCache'
and $localStorageOptions->{'namespace'} eq 'lemonldap-ng-sessions'
and $childInitDone == 1
),
'LocalInit methods: localInit values'
);
ok(
# purgeCache does not return anything but dies if an error occurs
!defined( $localinit->purgeCache ),
'LocalInit methods: purgeCache'
);
ok( $localinit->statusProcess == 0, 'LocalInit methods: statusProcess' );
ok( $localinit->childInit, 'LocalInit methods: childInit' );
ok( $localinit->initLocalStorage, 'LocalInit methods: initLocalStorage' );
ok( $statusPipe->isa('IO::Pipe::End'), 'status pipe: In pipe' );
ok( $statusOut->isa('IO::Pipe::End'), 'status pipe: Out pipe' );
ok( print( $statusPipe "uid => / OK\nuid => / OK\nuid => /no REJECT\n" ),
'status pipe: New requests' );
ok( print( $statusPipe "STATUS\n" ), 'status pipe: Status request' );
ok( &read, 'status pipe: Status result' );
ok( close($statusOut), 'status pipe: close out pipe' );
ok( close($statusPipe), 'status pipe: close in pipe' );
sub read {
my $ok = 0;
#open LOG, '>/tmp/log';
while (<$statusOut>) {
#print LOG $_;
$ok++ if (/^OK\s+:\s*2\s*\(2\.00\s*\/\s*mn\)$/);
$ok++ if (/^REJECT\s+:\s*1\s*\(1\.00\s*\/\s*mn\)$/);
if (/^END$/) {
$ok++;
last;
}
}
#print LOG "$ok\n";
#close LOG;
return ( $ok == 3 );
}

@ -10,8 +10,7 @@ package My::Package;
use Test::More tests => 5;
BEGIN {
use_ok('Lemonldap::NG::Handler::Vhost');
use_ok('Lemonldap::NG::Handler::Simple');
use_ok('Lemonldap::NG::Handler::Initialization::GlobalInit');
}
#########################
@ -19,14 +18,21 @@ BEGIN {
# Insert your test code below, the Test::More module is use()ed here so read
# its man page ( perldoc Test::More ) for help writing this test script.
our @ISA = qw( Lemonldap::NG::Handler::Vhost Lemonldap::NG::Handler::Simple );
my $h;
$h = bless {}, 'My::Package';
my $globalinit;
open STDERR, '>/dev/null';
ok(
$h->defaultValuesInit(
$globalinit = Lemonldap::NG::Handler::Initialization::GlobalInit->new(
customFunctions => "",
useSafeJail => 1,
),
'constructor'
);
ok(
$globalinit->defaultValuesInit(
( map { undef } 1 .. 16 ),
{
https => 0,
port => 0,
@ -46,22 +52,24 @@ ok(
);
ok(
$h->locationRulesInit(
$globalinit->locationRulesInit(
( map { undef } 1 .. 8 ),
{
locationRules => {
www1 => {
default => 'accept',
'^/no' => 'deny',
'test' => '$groups =~ /\badmin\b/',
},
},
'locationRules' => {
'www1' => {
'default' => 'accept',
'^/no' => 'deny',
'test' => '$groups =~ /\badmin\b/',
}
}
}
),
'locationRulesInit'
);
ok(
$h->forgeHeadersInit(
$globalinit->forgeHeadersInit(
( map { undef } 1 .. 1 ),
{ exportedHeaders => { www1 => { Auth => '$uid', } } }
),
'forgeHeadersInit'

@ -0,0 +1,89 @@
# Before `make install' is performed this script should be runnable with
# `make test'. After `make install' it should work as `perl Lemonldap-NG-Handler-SharedConf.t'
#########################
# change 'tests => 1' to 'tests => last_test_to_print';
use Test::More;
use Cwd 'abs_path';
use File::Basename;
my $numTests = 3;
unless ( eval { require Test::MockObject } ) {
$numTests = 1;
warn "Warning: Test::MockObject is needed to run deeper tests\n";
}
plan tests => $numTests;
use Env qw($lmTestConfig);
$lmTestConfig = {
configStorage => {
type => 'File',
dirName => dirname( abs_path($0) ),
localStorage => 'Cache::FileCache',
localStorageOptions => {
'namespace' => 'lemonldap-ng-config',
'default_expires_in' => 600,
'directory_umask' => '007',
'cache_root' => '/tmp',
'cache_depth' => 0,
}
},
};
open STDERR, '>/dev/null';
#########################
# Insert your test code below, the Test::More module is use()ed here so read
# its man page ( perldoc Test::More ) for help writing this test script.
use_ok('Lemonldap::NG::Handler::DefaultHandler');
if ( $numTests == 3 ) {
# we don't want to use all Apache::* stuff
$ENV{MOD_PERL} = undef;
$ENV{MOD_PERL_API_VERSION} = 2;
# Create a fake Apache2::RequestRec
my $mock = Test::MockObject->new();
$mock->fake_module(
'Apache2::RequestRec' => new =>
sub { return bless {}, 'Apache2::RequestRec' },
hostname => sub { 'test.example.com' },
is_initial_req => sub { '1' },
args => sub { undef },
unparsed_uri => sub { '/' },
uri => sub { '/' },
get_server_port => sub { '80' },
get_server_name => sub { 'test.example.com' },
remote_ip => sub { '127.0.0.1' },
);
$mock->fake_module(
'Apache2::URI' => new => sub { return bless {}, 'Apache2::URI' },
unescape_url => sub { return $_ },
);
my $ret;
$mock->fake_module( 'Lemonldap::NG::Handler::Main::Headers',
lmSetHeaderOut => sub { $ret = join( ':', $_[2], $_[3], ); }, );
our $apacheRequest = Apache2::RequestRec->new();
my $h = bless {}, 'Lemonldap::NG::Handler::DefaultHandler';
ok(
$h->Lemonldap::NG::Handler::DefaultHandler::run($apacheRequest),
'run DefaultHandler with basic configuration and no cookie'
);
ok(
"$ret" eq
'Location:http://auth.example.com/?url=aHR0cDovL3Rlc3QuZXhhbXBsZS5jb20v',
'testing redirection URL from previous run'
);
}
$lmTestConfig = undef;

@ -1,15 +0,0 @@
# Before `make install' is performed this script should be runnable with
# `make test'. After `make install' it should work as `perl Lemonldap-NG-Handler-SharedConf.t'
#########################
# change 'tests => 1' to 'tests => last_test_to_print';
use Test::More tests => 1;
BEGIN { use_ok('Lemonldap::NG::Handler::SharedConf') }
#########################
# Insert your test code below, the Test::More module is use()ed here so read
# its man page ( perldoc Test::More ) for help writing this test script.

@ -1,69 +0,0 @@
# Before `make install' is performed this script should be runnable with
# `make test'. After `make install' it should work as `perl Lemonldap-NG-Handler.t'
#########################
# change 'tests => 1' to 'tests => last_test_to_print';
BEGIN {
our $home = 0;
$home++ if ( $ENV{DEBFULLNAME} and $ENV{DEBFULLNAME} eq 'Xavier Guimard' );
}
use Test::More tests => 1 + 8 * $home;
BEGIN { use_ok( 'Lemonldap::NG::Handler::Simple', ':all' ) }
#########################
# Insert your test code below, the Test::More module is use()ed here so read
# its man page ( perldoc Test::More ) for help writing this test script.
exit unless ($home);
my $h;
$h = bless {}, 'Lemonldap::NG::Handler::Simple';
ok(
$h->localInit(
{
localStorage => 'Cache::FileCache',
localStorageOptions => { 'namespace' => 'lemonldap-ng-sessions', },
status => 1
}
),
'New Object'
);
ok( $statusPipe->isa('IO::Pipe::End'), 'In pipe' );
ok( $statusOut->isa('IO::Pipe::End'), 'Out pipe' );
ok( print( $statusPipe "uid => / OK\nuid => / OK\nuid => /no REJECT\n" ),
'New requests' );
ok( print( $statusPipe "STATUS\n" ), 'Status request' );
ok( &read, 'Status result' );
ok( close($statusOut) );
ok( close($statusPipe) );
sub read {
my $ok = 0;
#open LOG, '>/tmp/log';
while (<$statusOut>) {
#print LOG $_;
$ok++ if (/^OK\s+:\s*2\s*\(2\.00\s*\/\s*mn\)$/);
$ok++ if (/^REJECT\s+:\s*1\s*\(1\.00\s*\/\s*mn\)$/);
if (/^END$/) {
$ok++;
last;
}
}
#print LOG "$ok\n";
#close LOG;
return ( $ok == 3 );
}

@ -0,0 +1,45 @@
# Before `make install' is performed this script should be runnable with
# `make test'. After `make install' it should work as `perl Lemonldap-NG-Handler-SharedConf.t'
#########################
# change 'tests => 1' to 'tests => last_test_to_print';
use Test::More tests => 6;
BEGIN { use_ok('Lemonldap::NG::Handler::Main::Jail') }
#########################
# Insert your test code below, the Test::More module is use()ed here so read
# its man page ( perldoc Test::More ) for help writing this test script.
ok(
my $jail = Lemonldap::NG::Handler::Main::Jail->new(
'safe' => undef,
'useSafeJail' => 1,
'customFunctions' => undef
),
'new jail object'
);
my $safe = $jail->build_safe();
my $sub1 = "sub { return( basic('login','password') ) }";
my $basic = $jail->jail_reval($sub1);
ok( ( !defined($basic) or defined($basic) ),
'basic extended function can be undef with recent Safe Jail' );
my $sub2 = "sub { return ( encode_base64('test') ) }";
my $encode_base64 = $jail->jail_reval($sub2);
ok(
( !defined($encode_base64) or defined($encode_base64) ),
'encode_base64 function can be undef with recent Safe Jail'
);
my $sub3 = "sub { return(checkDate('20000000000000','21000000000000')) }";
my $checkDate = $jail->jail_reval($sub3);
ok( ( !defined($checkDate) or defined($checkDate) ),
'checkDate extended function can be undef with recent Safe Jail' );
# basic and encode_base64 are not supported by safe jail, but checkDate is
ok( &$checkDate == "1", 'checkDate extended function working with Safe Jail' );

@ -1,24 +0,0 @@
# Before `make install' is performed this script should be runnable with
# `make test'. After `make install' it should work as `perl Lemonldap-NG-Handler-SharedConf.t'
#########################
# change 'tests => 1' to 'tests => last_test_to_print';
use Test::More tests => 3;
BEGIN { use_ok('Lemonldap::NG::Handler::Simple') }
#########################
# Insert your test code below, the Test::More module is use()ed here so read
# its man page ( perldoc Test::More ) for help writing this test script.
my $h;
$h = bless {}, 'Lemonldap::NG::Handler::Simple';
ok( $h->defaultValuesInit( { useSafeJail => 1, } ), 'Enabling Safe Jail' );
my $basic = $h->safe->reval("basic('login','password')");
ok( ( !defined($basic) or defined($basic) ),
'basic extended function can be undef with recent Safe Jail' );

@ -5,21 +5,38 @@
# change 'tests => 1' to 'tests => last_test_to_print';
use Test::More tests => 3;
BEGIN { use_ok('Lemonldap::NG::Handler::Simple') }
use Test::More tests => 5;
BEGIN { use_ok('Lemonldap::NG::Handler::Main::Jail') }
#########################
# Insert your test code below, the Test::More module is use()ed here so read
# its man page ( perldoc Test::More ) for help writing this test script.
my $h;
$h = bless {}, 'Lemonldap::NG::Handler::Simple';
ok(
my $jail = Lemonldap::NG::Handler::Main::Jail->new(
'safe' => undef,
'useSafeJail' => 0,
'customFunctions' => undef
),
'new fake jail object'
);
my $safe = $jail->build_safe();
ok( $h->defaultValuesInit( { useSafeJail => 0, } ), 'Disabling Safe Jail' );
my $sub1 = "sub { return( basic('login','password') ) }";
my $basic = $jail->jail_reval($sub1);
like(
$h->safe->reval("basic('login','password')"),
"/^Basic bG9naW46cGFzc3dvcmQ=/",
&$basic,
'/^Basic bG9naW46cGFzc3dvcmQ=$/',
'basic extended function working without Safe Jail'
);
my $sub2 = "sub { return ( encode_base64('test') ) }";
my $encode_base64 = $jail->jail_reval($sub2);
like( &$encode_base64, '/^dGVzdA==$/',
'encode_base64 extended function working without Safe Jail' );
my $sub3 = "sub { return(checkDate('20000000000000','21000000000000')) }";
my $checkDate = $jail->jail_reval($sub3);
ok( &$checkDate == "1",
'checkDate extended function working without Safe Jail' );

@ -6,12 +6,22 @@
# change 'tests => 1' to 'tests => last_test_to_print';
use Test::More tests => 1;
use Cwd 'abs_path';
use File::Basename;
BEGIN {
use_ok('Lemonldap::NG::Handler::CGI');
use Env qw($lmTestConfig);
$lmTestConfig = {
configStorage => {
type => 'File',
dirName => dirname( abs_path($0) ),
},
};
# sub Lemonldap::NG::Handler::CGI::lmLog { }
}
use_ok('Lemonldap::NG::Handler::CGI');
$lmTestConfig = undef;
# sub Lemonldap::NG::Handler::CGI::lmLog { }
#########################

@ -6,7 +6,7 @@
# change 'tests => 1' to 'tests => last_test_to_print';
use Test::More tests => 1;
BEGIN { use_ok('Lemonldap::NG::Handler::Proxy') }
use_ok('Lemonldap::NG::Handler::Proxy');
#########################

@ -6,6 +6,16 @@
# change 'tests => 1' to 'tests => last_test_to_print';
use Test::More tests => 1;
use Cwd 'abs_path';
use File::Basename;
use Env qw($lmTestConfig);
$lmTestConfig = {
configStorage => {
type => 'File',
dirName => dirname( abs_path($0) ),
},
};
#########################
@ -21,3 +31,4 @@ SKIP: {
use_ok('Lemonldap::NG::Handler::SecureToken');
}
$lmTestConfig = undef;

@ -6,6 +6,16 @@
# change 'tests => 1' to 'tests => last_test_to_print';
use Test::More tests => 1;
use Cwd 'abs_path';
use File::Basename;
use Env qw($lmTestConfig);
$lmTestConfig = {
configStorage => {
type => 'File',
dirName => dirname( abs_path($0) ),
},
};
#########################
@ -19,3 +29,5 @@ SKIP: {
if ($@);
use_ok('Lemonldap::NG::Handler::ZimbraPreAuth');
}
$lmTestConfig = undef;

@ -6,6 +6,16 @@
# change 'tests => 1' to 'tests => last_test_to_print';
use Test::More tests => 1;
use Cwd 'abs_path';
use File::Basename;
use Env qw($lmTestConfig);
$lmTestConfig = {
configStorage => {
type => 'File',
dirName => dirname( abs_path($0) ),
},
};
#########################
@ -13,3 +23,5 @@ use Test::More tests => 1;
# its man page ( perldoc Test::More ) for help writing this test script.
use_ok('Lemonldap::NG::Handler::AuthBasic');
$lmTestConfig = undef;

@ -0,0 +1,90 @@
applicationList
'$data1 = {&#39;1sample&#39; => { catname => &#39;Sample applications&#39;,type => &#39;category&#39;, &#39;test1&#39; => { type => &#39;application&#39;, options => { name => &#39;Application Test 1&#39;, uri => &#39;http://test1.example.com/&#39;, description => &#39;A simple application displaying authenticated user&#39;, logo => &#39;demo.png&#39;, display => &#39;auto&#39;, }, },&#39;test2&#39; => { type => &#39;application&#39;, options => { name => &#39;Application Test 2&#39;, uri => &#39;http://test2.example.com/&#39;, description => &#39;The same simple application displaying authenticated user&#39;, logo => &#39;thumbnail.png&#39;, display => &#39;auto&#39;, }, }, },&#39;2administration&#39; => { catname => &#39;Administration&#39;, type => &#39;category&#39;, &#39;manager&#39; => { type => &#39;application&#39;, options => { name => &#39;WebSSO Manager&#39;, uri => &#39;http://manager.example.com/&#39;, description => &#39;Configure LemonLDAP::NG WebSSO&#39;, logo => &#39;configure.png&#39;, display => &#39;auto&#39;, }, },&#39;sessions&#39; => { type => &#39;application&#39;, options => { name => &#39;Sessions explorer&#39;, uri => &#39;http://manager.example.com/sessions.pl&#39;, description => &#39;Explore WebSSO sessions&#39;, logo => &#39;database.png&#39;, display => &#39;auto&#39;, }, }, &#39;notifications&#39; => { type => &#39;application&#39;, options => { name => &#39;Notifications explorer&#39;, uri => &#39;http://manager.example.com/notifications.pl&#39;, description => &#39;Explore WebSSO notifications&#39;, logo => &#39;database.png&#39;, display => &#39;auto&#39;, }, }, }, &#39;3documentation&#39; => { catname => &#39;Documentation&#39;, type => &#39;category&#39;, &#39;localdoc&#39; => { type => &#39;application&#39;, options => { name => &#39;Local documentation&#39;, uri => &#39;http://manager.example.com/doc/&#39;, description => &#39;Documentation supplied with LemonLDAP::NG&#39;, logo => &#39;help.png&#39;, display => &#39;on&#39;, }, },&#39;officialwebsite&#39; => { type => &#39;application&#39;, options => { name => &#39;Offical Website&#39;, uri => &#39;http://lemonldap-ng.org/&#39;, description => &#39;Official LemonLDAP::NG Website&#39;, logo => &#39;network.png&#39;, display => &#39;on&#39;, }, }, }, }'
globalStorage
'Apache::Session::File'
persistentStorage
'Apache::Session::File'
cookieName
'lemonldap'
demoExportedVars
'$data1 = {&#39;uid&#39; => &#39;uid&#39;,&#39;cn&#39; => &#39;cn&#39;,&#39;mail&#39; => &#39;mail&#39;};'
exportedVars
'$data1 = {&#39;UA&#39; => &#39;HTTP_USER_AGENT&#39;};'
authentication
'Demo'
userDB
'Demo'
passwordDB
'Demo'
locationRules
'$data1 = {&#39;test2.example.com&#39; => {&#39;default&#39; => &#39;accept&#39;,&#39;^/logout&#39; => &#39;logout_sso&#39;},&#39;test1.example.com&#39; => {&#39;default&#39; => &#39;accept&#39;,&#39;^/logout&#39; => &#39;logout_sso&#39;},&#39;manager.example.com&#39; => {&#39;default&#39; => &#39;$uid eq "dwho"&#39;}};'
domain
'example.com'
timeout
72000
groups
'$data1 = {};'
portal
'http://auth.example.com/'
exportedHeaders
'$data1 = {&#39;test2.example.com&#39; => {&#39;Auth-User&#39; => &#39;$uid&#39;},&#39;test1.example.com&#39; => {&#39;Auth-User&#39; => &#39;$uid&#39;}};'
globalStorageOptions
'$data1 = {&#39;Directory&#39; => &#39;__SESSIONDIR__&#39;};'
persistentStorageOptions
'$data1 = {&#39;Directory&#39; => &#39;__PSESSIONDIR__&#39;};'
cfgNum
1
cfgAuthor
'The LemonLDAP::NG team'
securedCookie
0
macros
'$data1 = {&#39;_whatToTrace&#39; => &#39;$_auth eq \&#39;SAML\&#39; ? "$_user\\@$_idpConfKey" : "$_user"&#39;};'
whatToTrace
'$_whatToTrace'
loginHistoryEnabled
1
sessionDataToRemember
'$data1 = {};'
reloadUrls
'$data1 = {&#39;reload.example.com&#39; => &#39;http://reload.example.com/reload&#39;};'
notification
1
notificationStorage
'File'
notificationStorageOptions
'$data1 = {&#39;dirName&#39; => &#39;__NOTIFICATIONDIR__&#39;};'
captcha_data
'__CAPTCHADIR__'
captcha_output
'__CAPTCHAOUTPUTDIR__'

@ -1,113 +1,54 @@
Changes
example/index.pl
example/mrtg/lmng-mrtg
example/mrtg/mrtg.cfg.example
example/notfound.html
example/notifications.pl
example/scripts/lemonldap-ng-cli
example/scripts/lmConfigEditor
example/sessions.pl
example/skins/default/css/accordion.css
example/skins/default/css/manager.css
example/skins/default/css/tree.css
example/skins/default/images/1downarrow_16x16.png
example/skins/default/images/1rightarrow_16x16.png
example/skins/default/images/apps-logos/attach.png
example/skins/default/images/apps-logos/bell.png
example/skins/default/images/apps-logos/bookmark.png
example/skins/default/images/apps-logos/configure.png
example/skins/default/images/apps-logos/custom.png
example/skins/default/images/apps-logos/database.png
example/skins/default/images/apps-logos/demo.png
example/skins/default/images/apps-logos/docs.png
example/skins/default/images/apps-logos/folder.png
example/skins/default/images/apps-logos/gear.png
example/skins/default/images/apps-logos/help.png
example/skins/default/images/apps-logos/mailappt.png
example/skins/default/images/apps-logos/money.png
example/skins/default/images/apps-logos/network.png
example/skins/default/images/apps-logos/README
example/skins/default/images/apps-logos/terminal.png
example/skins/default/images/apps-logos/thumbnail.png
example/skins/default/images/apps-logos/tools.png
example/skins/default/images/apps-logos/tux.png
example/skins/default/images/apps-logos/web.png
example/skins/default/images/apps-logos/wheels.png
example/skins/default/images/bullet_green.png
example/skins/default/images/bullet_orange.png
example/skins/default/images/bullet_red.png
example/skins/default/images/logo_lemonldap-ng.png
example/skins/default/images/portal-skins/bootstrap.png
example/skins/default/images/portal-skins/custom.png
example/skins/default/images/portal-skins/dark.png
example/skins/default/images/portal-skins/impact.png
example/skins/default/images/portal-skins/pastel.png
example/skins/default/images/spinner.gif
example/skins/default/images/tree/root.gif
example/skins/default/images/tree/spacer.gif
example/skins/default/images/tree/tree.png
example/skins/default/js/jquery-1.10.2.js
example/skins/default/js/jquery-ui-1.10.3.custom.js
example/skins/default/js/jquery.ajaxfileupload.js
example/skins/default/js/jquery.cookie.js
example/skins/default/js/jquery.elastic.source.js
example/skins/default/js/manager.js
example/skins/default/js/notifications.js
example/skins/default/js/sessions.js
example/skins/default/js/tree.js
example/skins/default/lemonldap-ng.ico
example/skins/default/manager.tpl
example/skins/default/notifications.tpl
example/skins/default/sessions.tpl
example/skins/default/top.tpl
example/skins/default/ui-darkness/images/animated-overlay.gif
example/skins/default/ui-darkness/images/ui-bg_flat_30_cccccc_40x100.png
example/skins/default/ui-darkness/images/ui-bg_flat_50_5c5c5c_40x100.png
example/skins/default/ui-darkness/images/ui-bg_glass_20_555555_1x400.png
example/skins/default/ui-darkness/images/ui-bg_glass_40_0078a3_1x400.png
example/skins/default/ui-darkness/images/ui-bg_glass_40_ffc73d_1x400.png
example/skins/default/ui-darkness/images/ui-bg_gloss-wave_25_333333_500x100.png
example/skins/default/ui-darkness/images/ui-bg_highlight-soft_80_eeeeee_1x100.png
example/skins/default/ui-darkness/images/ui-bg_inset-soft_25_000000_1x100.png
example/skins/default/ui-darkness/images/ui-bg_inset-soft_30_f58400_1x100.png
example/skins/default/ui-darkness/images/ui-icons_222222_256x240.png
example/skins/default/ui-darkness/images/ui-icons_4b8e0b_256x240.png
example/skins/default/ui-darkness/images/ui-icons_a83300_256x240.png
example/skins/default/ui-darkness/images/ui-icons_cccccc_256x240.png
example/skins/default/ui-darkness/images/ui-icons_ffffff_256x240.png
example/skins/default/ui-darkness/jquery-ui-1.10.3.custom.min.css
example/skins/default/ui-lightness/images/animated-overlay.gif
example/skins/default/ui-lightness/images/ui-bg_diagonals-thick_18_b81900_40x40.png
example/skins/default/ui-lightness/images/ui-bg_diagonals-thick_20_666666_40x40.png
example/skins/default/ui-lightness/images/ui-bg_flat_10_000000_40x100.png
example/skins/default/ui-lightness/images/ui-bg_glass_100_f6f6f6_1x400.png
example/skins/default/ui-lightness/images/ui-bg_glass_100_fdf5ce_1x400.png
example/skins/default/ui-lightness/images/ui-bg_glass_65_ffffff_1x400.png
example/skins/default/ui-lightness/images/ui-bg_gloss-wave_35_f6a828_500x100.png
example/skins/default/ui-lightness/images/ui-bg_highlight-soft_100_eeeeee_1x100.png
example/skins/default/ui-lightness/images/ui-bg_highlight-soft_75_ffe45c_1x100.png
example/skins/default/ui-lightness/images/ui-icons_222222_256x240.png
example/skins/default/ui-lightness/images/ui-icons_228ef1_256x240.png
example/skins/default/ui-lightness/images/ui-icons_ef8c08_256x240.png
example/skins/default/ui-lightness/images/ui-icons_ffd27a_256x240.png
example/skins/default/ui-lightness/images/ui-icons_ffffff_256x240.png
example/skins/default/ui-lightness/jquery-ui-1.10.3.custom.min.css
lib/Lemonldap/NG/Manager.pm
lib/Lemonldap/NG/Manager/_i18n.pm
lib/Lemonldap/NG/Manager/_Struct.pm
lib/Lemonldap/NG/Manager/Cli.pm
lib/Lemonldap/NG/Manager/Downloader.pm
lib/Lemonldap/NG/Manager/Notifications.pm
lib/Lemonldap/NG/Manager/Request.pm
lib/Lemonldap/NG/Manager/Sessions.pm
lib/Lemonldap/NG/Manager/Uploader.pm
example/autoProtectedCGI.pl
example/menu.pl
example/MyHandler.pm
example/MyHandlerAuthBasic.pm
example/MyHandlerLog4Perl.pm
example/MyHandlerSecureToken.pm
example/MyHandlerSympa.pm
example/MyHandlerZimbra.pm
example/MyUpdateCookieHandler.pm
example/scripts/purgeLocalCache
example/scripts/purgeLocalCache.cron.d
lib/Lemonldap/NG/Handler/AuthBasic.pm
lib/Lemonldap/NG/Handler/CGI.pm
lib/Lemonldap/NG/Handler/DefaultHandler.pm
lib/Lemonldap/NG/Handler/Initialization/GlobalInit.pm
lib/Lemonldap/NG/Handler/Initialization/LocalInit.pm
lib/Lemonldap/NG/Handler/Main/Headers.pm
lib/Lemonldap/NG/Handler/Main/Jail.pm
lib/Lemonldap/NG/Handler/Main/Logger.pm
lib/Lemonldap/NG/Handler/Main.pm
lib/Lemonldap/NG/Handler/Main/PostForm.pm
lib/Lemonldap/NG/Handler/Menu.pm
lib/Lemonldap/NG/Handler.pm
lib/Lemonldap/NG/Handler/Proxy.pm
lib/Lemonldap/NG/Handler/SecureToken.pm
lib/Lemonldap/NG/Handler/SpecificHandlers/AuthBasic.pm
lib/Lemonldap/NG/Handler/SpecificHandlers/SecureToken.pm
lib/Lemonldap/NG/Handler/SpecificHandlers/SympaAutoLogin.pm
lib/Lemonldap/NG/Handler/SpecificHandlers/UpdateCookie.pm
lib/Lemonldap/NG/Handler/SpecificHandlers/ZimbraPreAuth.pm
lib/Lemonldap/NG/Handler/Status.pm
lib/Lemonldap/NG/Handler/SympaAutoLogin.pm
lib/Lemonldap/NG/Handler/UpdateCookie.pm
lib/Lemonldap/NG/Handler/ZimbraPreAuth.pm
Makefile.PL
MANIFEST This list of files
META.yml
README
t/10-Manager.t
t/20-Manager-i18n.t
t/30-Manager-Struct.t
t/40-Manager-Sessions.t
t/50-Cli.t
t/01-Lemonldap-NG-Handler-Main.t
t/02-Lemonldap-NG-Handler-Main-Portal.t
t/04-Lemonldap-NG-Handler-Initialization-LocalInit.t
t/05-Lemonldap-NG-Handler-Initialization-GlobalInit.t
t/10-Lemonldap-NG-Handler-DefaultHandler.t
t/12-Lemonldap-NG-Handler-Jail.t
t/13-Lemonldap-NG-Handler-Fake-Safe.t
t/30-Lemonldap-NG-Handler-CGI.t
t/40-Lemonldap-NG-Handler-Proxy.t
t/50-Lemonldap-NG-Handler-SecureToken.t
t/51-Lemonldap-NG-Handler-Zimbra.t
t/52-Lemonldap-NG-Handler-AuthBasic.t
t/99-pod.t
t/LemonLoadConf.pm
t/lmConf-1

@ -4,35 +4,43 @@ use ExtUtils::MakeMaker;
# See lib/ExtUtils/MakeMaker.pm for details of how to influence
# the contents of the Makefile that is written.
WriteMakefile(
NAME => 'Lemonldap::NG::Manager',
VERSION_FROM => 'lib/Lemonldap/NG/Manager.pm', # finds $VERSION
NAME => 'Lemonldap::NG::Handler',
VERSION_FROM => 'lib/Lemonldap/NG/Handler.pm',
LICENSE => 'gpl',
PMLIBDIRS => ['lib'],
BUILD_REQUIRES => {
'IO::String' => 0,
'Test::Pod' => 1.00,
'Digest::HMAC_SHA1' => 0,
'HTTP::Message' => 0,
'IO::Pipe' => 0,
'SOAP::Lite' => 0,
'Test::MockObject' => 0,
'Test::Pod' => 0,
'File::Basename' => 0,
'Cwd' => 0,
},
META_MERGE => { 'LWP::Protocol::https' => 0, },
PREREQ_PM => {
'Convert::PEM' => 0,
'Crypt::OpenSSL::RSA' => 0,
'HTML::Template' => 0,
'JSON' => 0,
'Lemonldap::NG::Common' => '1.3.0',
'Lemonldap::NG::Handler' => '1.3.0',
'LWP' => 0,
'URI' => 0,
'XML::LibXSLT' => 0,
'XML::LibXML' => 0,
META_MERGE => {
'recommends' => {
'Cache::Memcached' => 0,
'Digest::HMAC_SHA1' => 0,
'HTTP::Message' => 0,
'LWP::Protocol::https' => 0,
'SOAP::Lite' => 0,
},
},
PREREQ_PM => {
'Apache::Session::Generate::MD5' => 0,
'CGI' => 3.08,
'Lemonldap::NG::Common' => '1.3.0',
'LWP' => 0,
'URI' => 0,
}, # e.g., Module::Name => 1.1
(
$] >= 5.005
? ## Add these new keywords supported since 5.005
(
ABSTRACT_FROM =>
'lib/Lemonldap/NG/Manager.pm', # retrieve abstract from module
'lib/Lemonldap/NG/Handler.pm', # retrieve abstract from module
AUTHOR => 'Xavier Guimard <x.guimard@free.fr>'
. ', Clément Oudot <clement@oodo.net>'
. ', Thomas Chemineau <thomas.chemineau@gmail.com>'
)
: ()
),

@ -8,7 +8,20 @@
use Test::More tests => 1;
use IO::String;
use strict;
BEGIN { use_ok('Lemonldap::NG::Manager') }
use Cwd 'abs_path';
use File::Basename;
use Env qw($lmTestConfig);
$lmTestConfig = {
configStorage => {
type => 'File',
dirName => dirname( abs_path($0) ),
},
};
use_ok('Lemonldap::NG::Manager');
$lmTestConfig = undef;
#########################

@ -7,7 +7,20 @@
use Test::More tests => 1;
use strict;
BEGIN { use_ok('Lemonldap::NG::Manager::Sessions') }
use Cwd 'abs_path';
use File::Basename;
use Env qw($lmTestConfig);
$lmTestConfig = {
configStorage => {
type => 'File',
dirName => dirname( abs_path($0) ),
},
};
use_ok('Lemonldap::NG::Manager::Sessions');
$lmTestConfig = undef;
#########################

Loading…
Cancel
Save