Commit 1ed74737 authored by Yadd's avatar Yadd
Browse files

Null auth (#595)

parent baa102a6
package Lemonldap::NG::Portal::Auth::Null;
use strict;
use Mouse;
use Lemonldap::NG::Portal::Main::Constants;
our $VERSION = '2.0.0';
extends 'Lemonldap::NG::Portal::Auth::Base';
sub init {
1;
}
sub extractFormInfo {
my ( $self, $req ) = @_;
$req->user('anonymous');
PE_OK;
}
sub authenticate {
PE_OK;
}
sub authForce {
PE_OK;
}
sub authLogout {
PE_OK;
}
1;
package Lemonldap::NG::Portal::UserDB::Null;
use strict;
use Mouse;
use Lemonldap::NG::Portal::Main::Constants;
extends 'Lemonldap::NG::Portal::Main::Module';
our $VERSION = '2.0.0';
sub init {
1;
}
sub getUser {
PE_OK;
}
sub setSessionInfo {
PE_OK;
}
sub setGroups {
PE_OK;
}
1;
use Test::More;
use strict;
require 't/test-lib.pm';
my $res;
init(
{
logLevel => 'debug',
useSafeJail => 1,
authentication => 'Null',
userDB => 'Null',
}
);
ok( $res = &client->_get('/'), 'Auth query' );
ok( $res->[0] == 200, 'Response is 200' ) or explain( $res->[0], 200 );
my $cookies = getCookies($res);
ok( $cookies->{lemonldap}, 'Get cookie' )
or explain( $res, 'Set-Cookie: something' );
clean_sessions();
count(3);
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