Fix unit tests after introducing RegisterDB (#26)
This commit is contained in:
parent
81dbe943c3
commit
9b10d96341
@ -896,6 +896,13 @@ has 'redirectFormMethod' => (
|
|||||||
documentation => 'HTTP method for redirect page form',
|
documentation => 'HTTP method for redirect page form',
|
||||||
);
|
);
|
||||||
|
|
||||||
|
has 'registerDB' => (
|
||||||
|
is => 'rw',
|
||||||
|
isa => 'Str',
|
||||||
|
default => 'Demo',
|
||||||
|
documentation => 'Register module',
|
||||||
|
);
|
||||||
|
|
||||||
has 'remoteGlobalStorage' => (
|
has 'remoteGlobalStorage' => (
|
||||||
is => 'rw',
|
is => 'rw',
|
||||||
isa => 'Str',
|
isa => 'Str',
|
||||||
|
@ -0,0 +1,36 @@
|
|||||||
|
##@file
|
||||||
|
# Demo register backend file
|
||||||
|
|
||||||
|
##@class
|
||||||
|
# Demo register backend class
|
||||||
|
package Lemonldap::NG::Portal::RegisterDBDemo;
|
||||||
|
|
||||||
|
use strict;
|
||||||
|
use Lemonldap::NG::Portal::Simple;
|
||||||
|
|
||||||
|
## @method int computeLogin
|
||||||
|
# Compute a login from register infos
|
||||||
|
# @result Lemonldap::NG::Portal constant
|
||||||
|
sub computeLogin {
|
||||||
|
my ($self) = splice @_;
|
||||||
|
|
||||||
|
# Get first letter of firstname and lastname
|
||||||
|
my $login =
|
||||||
|
substr( lc $self->{registerInfo}->{firstname}, 0, 1 )
|
||||||
|
. lc $self->{registerInfo}->{lastname};
|
||||||
|
|
||||||
|
$self->{registerInfo}->{login} = $login;
|
||||||
|
|
||||||
|
return PE_OK;
|
||||||
|
}
|
||||||
|
|
||||||
|
## @method int createUser
|
||||||
|
# Do nothing
|
||||||
|
# @result Lemonldap::NG::Portal constant
|
||||||
|
sub createUser {
|
||||||
|
my ($self) = splice @_;
|
||||||
|
|
||||||
|
return PE_OK;
|
||||||
|
}
|
||||||
|
|
||||||
|
1;
|
@ -11,6 +11,7 @@ use Lemonldap::NG::Portal::Simple;
|
|||||||
our $VERSION = '1.4.0';
|
our $VERSION = '1.4.0';
|
||||||
|
|
||||||
sub getLogin {
|
sub getLogin {
|
||||||
|
my $self = splice @_;
|
||||||
$self->{registerInfo}->{login} = "";
|
$self->{registerInfo}->{login} = "";
|
||||||
return PE_OK;
|
return PE_OK;
|
||||||
}
|
}
|
||||||
|
@ -41,6 +41,7 @@ ok(
|
|||||||
authentication => 'LDAP test=1',
|
authentication => 'LDAP test=1',
|
||||||
userDB => 'LDAP',
|
userDB => 'LDAP',
|
||||||
passwordDB => 'LDAP',
|
passwordDB => 'LDAP',
|
||||||
|
registerDB => 'LDAP',
|
||||||
cookieName => 'lemonldap',
|
cookieName => 'lemonldap',
|
||||||
whatToTrace => '_user',
|
whatToTrace => '_user',
|
||||||
multiValuesSeparator => '; ',
|
multiValuesSeparator => '; ',
|
||||||
@ -71,6 +72,7 @@ $p = Lemonldap::NG::Portal::Simple->new(
|
|||||||
authentication => 'LDAP test=1',
|
authentication => 'LDAP test=1',
|
||||||
userDB => 'Null',
|
userDB => 'Null',
|
||||||
passwordDB => 'Null',
|
passwordDB => 'Null',
|
||||||
|
registerDB => 'Null',
|
||||||
cookieName => 'lemonldap',
|
cookieName => 'lemonldap',
|
||||||
whatToTrace => 'dummy',
|
whatToTrace => 'dummy',
|
||||||
multiValuesSeparator => '; ',
|
multiValuesSeparator => '; ',
|
||||||
|
@ -134,6 +134,7 @@ ok(
|
|||||||
authentication => 'LDAP test=1',
|
authentication => 'LDAP test=1',
|
||||||
userDB => 'Null',
|
userDB => 'Null',
|
||||||
passwordDB => 'Null',
|
passwordDB => 'Null',
|
||||||
|
registerDB => 'Null',
|
||||||
domain => 'example.com',
|
domain => 'example.com',
|
||||||
trustedDomains => '.example2.com example3.com',
|
trustedDomains => '.example2.com example3.com',
|
||||||
checkXSS => 1,
|
checkXSS => 1,
|
||||||
|
@ -78,6 +78,7 @@ SKIP: {
|
|||||||
authentication => 'Null',
|
authentication => 'Null',
|
||||||
userDB => 'Null',
|
userDB => 'Null',
|
||||||
passwordDB => 'Null',
|
passwordDB => 'Null',
|
||||||
|
registerDB => 'Null',
|
||||||
soap => 1,
|
soap => 1,
|
||||||
}
|
}
|
||||||
),
|
),
|
||||||
|
@ -25,6 +25,7 @@ ok(
|
|||||||
authentication => 'Null',
|
authentication => 'Null',
|
||||||
userDB => 'Null',
|
userDB => 'Null',
|
||||||
passwordDB => 'Null',
|
passwordDB => 'Null',
|
||||||
|
registerDB => 'Null',
|
||||||
useSafeJail => 1,
|
useSafeJail => 1,
|
||||||
}
|
}
|
||||||
),
|
),
|
||||||
|
@ -23,6 +23,7 @@ ok(
|
|||||||
authentication => 'Apache',
|
authentication => 'Apache',
|
||||||
userDB => 'Null',
|
userDB => 'Null',
|
||||||
passwordDB => 'Null',
|
passwordDB => 'Null',
|
||||||
|
registerDB => 'Null',
|
||||||
}
|
}
|
||||||
)
|
)
|
||||||
);
|
);
|
||||||
|
@ -23,6 +23,7 @@ ok(
|
|||||||
authentication => 'SSL',
|
authentication => 'SSL',
|
||||||
userDB => 'Null',
|
userDB => 'Null',
|
||||||
passwordDB => 'Null',
|
passwordDB => 'Null',
|
||||||
|
registerDB => 'Null',
|
||||||
}
|
}
|
||||||
)
|
)
|
||||||
);
|
);
|
||||||
|
@ -35,6 +35,7 @@ SKIP: {
|
|||||||
authentication => 'CAS',
|
authentication => 'CAS',
|
||||||
userDB => 'Null',
|
userDB => 'Null',
|
||||||
passwordDB => 'Null',
|
passwordDB => 'Null',
|
||||||
|
registerDB => 'Null',
|
||||||
CAS_url => 'https://cas.example.com',
|
CAS_url => 'https://cas.example.com',
|
||||||
CAS_pgt => '/tmp/pgt.txt',
|
CAS_pgt => '/tmp/pgt.txt',
|
||||||
CAS_proxiedServices => {},
|
CAS_proxiedServices => {},
|
||||||
@ -50,6 +51,7 @@ SKIP: {
|
|||||||
authentication => 'CAS',
|
authentication => 'CAS',
|
||||||
userDB => 'Null',
|
userDB => 'Null',
|
||||||
passwordDB => 'Null',
|
passwordDB => 'Null',
|
||||||
|
registerDB => 'Null',
|
||||||
CAS_url => 'https://cas.example.com',
|
CAS_url => 'https://cas.example.com',
|
||||||
CAS_pgt => '/tmp/pgt.txt',
|
CAS_pgt => '/tmp/pgt.txt',
|
||||||
CAS_proxiedServices => { 'CAS1' => 'http://cas1.example.com' },
|
CAS_proxiedServices => { 'CAS1' => 'http://cas1.example.com' },
|
||||||
|
@ -58,6 +58,7 @@ ok(
|
|||||||
authentication => 'Remote',
|
authentication => 'Remote',
|
||||||
userDB => 'Null',
|
userDB => 'Null',
|
||||||
passwordDB => 'Null',
|
passwordDB => 'Null',
|
||||||
|
registerDB => 'Null',
|
||||||
cookieName => 'lemonldap',
|
cookieName => 'lemonldap',
|
||||||
portal => 'http://abc',
|
portal => 'http://abc',
|
||||||
remotePortal => 'http://zz/',
|
remotePortal => 'http://zz/',
|
||||||
|
@ -81,6 +81,7 @@ my ( $test, $testU );
|
|||||||
authentication => 'Multi 1;2',
|
authentication => 'Multi 1;2',
|
||||||
userDB => 'Multi 1;2',
|
userDB => 'Multi 1;2',
|
||||||
passwordDB => 'Null',
|
passwordDB => 'Null',
|
||||||
|
registerDB => 'Null',
|
||||||
cookieName => 'lemonldap',
|
cookieName => 'lemonldap',
|
||||||
whatToTrace => 'dummy',
|
whatToTrace => 'dummy',
|
||||||
multiValuesSeparator => '; ',
|
multiValuesSeparator => '; ',
|
||||||
@ -115,6 +116,7 @@ my ( $test, $testU );
|
|||||||
authentication => 'Multi 1;2',
|
authentication => 'Multi 1;2',
|
||||||
userDB => 'Multi 1;2',
|
userDB => 'Multi 1;2',
|
||||||
passwordDB => 'Null',
|
passwordDB => 'Null',
|
||||||
|
registerDB => 'Null',
|
||||||
cookieName => 'lemonldap',
|
cookieName => 'lemonldap',
|
||||||
whatToTrace => 'dummy',
|
whatToTrace => 'dummy',
|
||||||
multiValuesSeparator => '; ',
|
multiValuesSeparator => '; ',
|
||||||
@ -143,6 +145,7 @@ my ( $test, $testU );
|
|||||||
authentication => 'Multi 1;2',
|
authentication => 'Multi 1;2',
|
||||||
userDB => 'Multi 3;4',
|
userDB => 'Multi 3;4',
|
||||||
passwordDB => 'Null',
|
passwordDB => 'Null',
|
||||||
|
registerDB => 'Null',
|
||||||
cookieName => 'lemonldap',
|
cookieName => 'lemonldap',
|
||||||
whatToTrace => 'dummy',
|
whatToTrace => 'dummy',
|
||||||
multiValuesSeparator => '; ',
|
multiValuesSeparator => '; ',
|
||||||
@ -171,6 +174,7 @@ my ( $test, $testU );
|
|||||||
authentication => 'Multi 1 1==0;2 1==0',
|
authentication => 'Multi 1 1==0;2 1==0',
|
||||||
userDB => 'Multi 3;4',
|
userDB => 'Multi 3;4',
|
||||||
passwordDB => 'Null',
|
passwordDB => 'Null',
|
||||||
|
registerDB => 'Null',
|
||||||
cookieName => 'lemonldap',
|
cookieName => 'lemonldap',
|
||||||
whatToTrace => 'dummy',
|
whatToTrace => 'dummy',
|
||||||
multiValuesSeparator => '; ',
|
multiValuesSeparator => '; ',
|
||||||
@ -196,6 +200,7 @@ my ( $test, $testU );
|
|||||||
authentication => 'Multi 1;2 1==0',
|
authentication => 'Multi 1;2 1==0',
|
||||||
userDB => 'Multi 3;4',
|
userDB => 'Multi 3;4',
|
||||||
passwordDB => 'Null',
|
passwordDB => 'Null',
|
||||||
|
registerDB => 'Null',
|
||||||
cookieName => 'lemonldap',
|
cookieName => 'lemonldap',
|
||||||
whatToTrace => 'dummy',
|
whatToTrace => 'dummy',
|
||||||
multiValuesSeparator => '; ',
|
multiValuesSeparator => '; ',
|
||||||
@ -221,6 +226,7 @@ my ( $test, $testU );
|
|||||||
authentication => 'Multi 1;2 1==1',
|
authentication => 'Multi 1;2 1==1',
|
||||||
userDB => 'Multi 3;4',
|
userDB => 'Multi 3;4',
|
||||||
passwordDB => 'Null',
|
passwordDB => 'Null',
|
||||||
|
registerDB => 'Null',
|
||||||
cookieName => 'lemonldap',
|
cookieName => 'lemonldap',
|
||||||
whatToTrace => 'dummy',
|
whatToTrace => 'dummy',
|
||||||
multiValuesSeparator => '; ',
|
multiValuesSeparator => '; ',
|
||||||
|
@ -32,6 +32,7 @@ ok(
|
|||||||
authentication => 'Choice',
|
authentication => 'Choice',
|
||||||
userDB => 'Null',
|
userDB => 'Null',
|
||||||
passwordDB => 'Null',
|
passwordDB => 'Null',
|
||||||
|
registerDB => 'Null',
|
||||||
getUser => sub { PE_OK },
|
getUser => sub { PE_OK },
|
||||||
setSessionInfo => sub { PE_OK },
|
setSessionInfo => sub { PE_OK },
|
||||||
portal => 'http://abc',
|
portal => 'http://abc',
|
||||||
|
@ -58,6 +58,7 @@ ok(
|
|||||||
authentication => 'Proxy',
|
authentication => 'Proxy',
|
||||||
userDB => 'Null',
|
userDB => 'Null',
|
||||||
passwordDB => 'Null',
|
passwordDB => 'Null',
|
||||||
|
registerDB => 'Null',
|
||||||
cookieName => 'lemonldap',
|
cookieName => 'lemonldap',
|
||||||
portal => 'http://abc',
|
portal => 'http://abc',
|
||||||
soapAuthService => 'https://lm.com',
|
soapAuthService => 'https://lm.com',
|
||||||
|
@ -28,6 +28,7 @@ ok(
|
|||||||
authentication => 'Null',
|
authentication => 'Null',
|
||||||
userDB => 'Null',
|
userDB => 'Null',
|
||||||
passwordDB => 'Null',
|
passwordDB => 'Null',
|
||||||
|
registerDB => 'Null',
|
||||||
exportedVars => { uid => "TEST_STRING", },
|
exportedVars => { uid => "TEST_STRING", },
|
||||||
}
|
}
|
||||||
)
|
)
|
||||||
|
@ -32,7 +32,7 @@ ok(
|
|||||||
authentication => 'Null',
|
authentication => 'Null',
|
||||||
userDB => 'Null',
|
userDB => 'Null',
|
||||||
passwordDB => 'Null',
|
passwordDB => 'Null',
|
||||||
|
registerDB => 'Null',
|
||||||
}
|
}
|
||||||
),
|
),
|
||||||
'Portal object'
|
'Portal object'
|
||||||
|
@ -24,6 +24,7 @@ my $p = Lemonldap::NG::Portal::Simple->new(
|
|||||||
authentication => 'Null',
|
authentication => 'Null',
|
||||||
userDB => 'Null',
|
userDB => 'Null',
|
||||||
passwordDB => 'Null',
|
passwordDB => 'Null',
|
||||||
|
registerDB => 'Null',
|
||||||
applicationList => {},
|
applicationList => {},
|
||||||
locationRules => {
|
locationRules => {
|
||||||
'test.example.com' => {
|
'test.example.com' => {
|
||||||
|
@ -23,7 +23,7 @@ SKIP: {
|
|||||||
userDB => 'SAML',
|
userDB => 'SAML',
|
||||||
issuerDB => 'Null',
|
issuerDB => 'Null',
|
||||||
passwordDB => 'Null',
|
passwordDB => 'Null',
|
||||||
|
registerDB => 'Null',
|
||||||
}
|
}
|
||||||
);
|
);
|
||||||
|
|
||||||
|
@ -14,6 +14,7 @@ my $p = Lemonldap::NG::Portal::Simple->new(
|
|||||||
authentication => 'Demo',
|
authentication => 'Demo',
|
||||||
userDB => 'Null',
|
userDB => 'Null',
|
||||||
passwordDB => 'Null',
|
passwordDB => 'Null',
|
||||||
|
registerDB => 'Null',
|
||||||
applicationList => {},
|
applicationList => {},
|
||||||
locationRules => {
|
locationRules => {
|
||||||
'test.example.com' => {
|
'test.example.com' => {
|
||||||
|
@ -23,6 +23,7 @@ ok(
|
|||||||
authentication => 'BrowserID',
|
authentication => 'BrowserID',
|
||||||
userDB => 'Null',
|
userDB => 'Null',
|
||||||
passwordDB => 'Null',
|
passwordDB => 'Null',
|
||||||
|
registerDB => 'Null',
|
||||||
}
|
}
|
||||||
)
|
)
|
||||||
);
|
);
|
||||||
|
Loading…
Reference in New Issue
Block a user