Commit 193ac7c2 authored by Xavier Guimard's avatar Xavier Guimard

Combination in progress (#1151)

parent 6cc7190d
......@@ -116,7 +116,7 @@ sub parseBlock {
sub parseMod {
my ( $self, $moduleList, $type, $expr ) = @_;
my @mods = map {
die "Unknown module $_"
die "Undeclared module $_"
unless ( $moduleList->{$_}->[$type] );
$moduleList->{$_}->[$type]
} split( /\s+and\s+/, $expr );
......
......@@ -372,6 +372,7 @@ t/34-Auth-Proxy-and-REST-Server.t
t/34-Auth-Proxy-and-SOAP-Server.t
t/35-REST-sessions-with-REST-server.t
t/35-SOAP-sessions-with-SOAP-server.t
t/36-Combination.t
t/40-Notifications-JSON-DBI.t
t/40-Notifications-JSON-File-with-token.t
t/40-Notifications-JSON-File.t
......
package Lemonldap::NG::Portal::Auth::Choice;
package Lemonldap::NG::Portal::Auth::Combination;
use strict;
use Mouse;
......@@ -16,7 +16,7 @@ has stackSub => ( is => 'rw' );
sub init {
my ($self) = @_;
unless ( $self->conf->combination ) {
unless ( $self->conf->{combination} ) {
$self->error('No combination found');
return 0;
}
......@@ -44,7 +44,7 @@ sub init {
eval {
$self->stackSub(
Lemonldap::NG::Common::Combination::Parser->parse(
\%mods, $self->conf->combination
\%mods, $self->conf->{combination}
)
);
};
......
use Test::More;
use strict;
use IO::String;
require 't/test-lib.pm';
my $res;
my $mainTests = 0;
eval { unlink 't/userdb.db' };
SKIP: {
eval { require DBI; require DBD::SQLite; };
if ($@) {
skip 'DBD::SQLite not found', $mainTests;
}
my $dbh = DBI->connect("dbi:SQLite:dbname=t/userdb.db");
$dbh->do('CREATE TABLE users (user text,password text,name text)');
$dbh->do("INSERT INTO users VALUES ('test','test','Test user')");
my $client = LLNG::Manager::Test->new(
{
ini => {
logLevel => 'debug',
useSafeJail => 1,
authentication => 'Combination',
userDB => 'Same',
combination => '[DBI] or [Demo]',
combModules => [
{
for => 0,
name => 'DBI',
type => 'DBI',
},
{
for => 0,
name => 'Demo',
type => 'Demo',
},
],
dbiAuthChain => 'dbi:SQLite:dbname=t/userdb.db',
dbiAuthUser => '',
dbiAuthPassword => '',
dbiAuthTable => 'users',
dbiAuthLoginCol => 'user',
dbiAuthPasswordCol => 'password',
dbiAuthPasswordHash => '',
dbiExportedVars => {},
}
}
);
}
count($mainTests);
eval { unlink 't/userdb.db' };
done_testing( count() );
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