Create a "Same" value for userDB and remove some other

This commit is contained in:
Xavier Guimard 2017-02-05 09:13:20 +00:00
parent 9c3bdd51b8
commit 7d27259e64
44 changed files with 89 additions and 257 deletions

View File

@ -162,6 +162,6 @@
"securedCookie" : 0,
"sessionDataToRemember" : {},
"timeout" : 72000,
"userDB" : "Demo",
"userDB" : "Same",
"whatToTrace" : "_whatToTrace"
}

View File

@ -184,6 +184,6 @@
"securedCookie": 0,
"sessionDataToRemember": {},
"timeout": 72000,
"userDB": "Demo",
"userDB": "Same",
"whatToTrace": "_whatToTrace"
}
}

View File

@ -24,8 +24,8 @@ describe('Lemonldap::NG Manager', function() {
element(by.css('.glyphicon-plus-sign')).click();
element(by.id('a-authChoiceModules')).click();
element(by.id('t-authChoiceModules/n1')).click();
element(by.xpath("//option[@value='BrowserID']")).click();
expect(element(by.id('t-browseridParams')).isDisplayed()).toBeTruthy();
element(by.xpath("//option[@value='LDAP']")).click();
expect(element(by.id('t-ldapParams')).isDisplayed()).toBeTruthy();
});
it('should display auth modules chosen with authMulti', function() {
@ -39,4 +39,4 @@ describe('Lemonldap::NG Manager', function() {
expect(element(by.id('t-casParams')).isDisplayed()).toBeTruthy();
});
});
});
});

View File

@ -244,7 +244,7 @@ sub defaultValues {
'trustedProxies' => '',
'twitterAuthnLevel' => 1,
'userControl' => '^[\\w\\.\\-@]+$',
'userDB' => 'Demo',
'userDB' => 'Same',
'useRedirectOnError' => 1,
'useSafeJail' => 1,
'webIDAuthnLevel' => 1,

View File

@ -227,7 +227,7 @@ m[^(?:(?:\-+\s*BEGIN\s+(?:PUBLIC\s+KEY|CERTIFICATE)\s*\-+\r?\n)?[a-zA-Z0-9/\+\r\
map( { $_->{'k'}; } @{ $_[2]{'select'}; } ) );
return $test
? 1
: ( 0, "Invalid value '$_[0]' for this select" );
: ( 1, "Invalid value '$_[0]' for this select" );
}
},
'subContainer' => {
@ -2839,8 +2839,12 @@ qr/^(?:(?:(?:(?:(?:(?:[a-zA-Z0-9][-a-zA-Z0-9]*)?[a-zA-Z0-9])[.])*(?:[a-zA-Z][-a-
'type' => 'pcre'
},
'userDB' => {
'default' => 'Demo',
'default' => 'Same',
'select' => [
{
'k' => 'Same',
'v' => 'Same'
},
{
'k' => 'AD',
'v' => 'Active Directory'
@ -2849,58 +2853,14 @@ qr/^(?:(?:(?:(?:(?:(?:[a-zA-Z0-9][-a-zA-Z0-9]*)?[a-zA-Z0-9])[.])*(?:[a-zA-Z][-a-
'k' => 'DBI',
'v' => 'Database (DBI)'
},
{
'k' => 'Choice',
'v' => 'authChoice'
},
{
'k' => 'Demo',
'v' => 'Demonstration'
},
{
'k' => 'Facebook',
'v' => 'Facebook'
},
{
'k' => 'Google',
'v' => 'Google'
},
{
'k' => 'LDAP',
'v' => 'LDAP'
},
{
'k' => 'Multi',
'v' => 'Multiple'
},
{
'k' => 'Null',
'v' => 'None'
},
{
'k' => 'OpenID',
'v' => 'OpenID'
},
{
'k' => 'OpenIDConnect',
'v' => 'OpenID Connect'
},
{
'k' => 'Proxy',
'v' => 'Proxy'
},
{
'k' => 'Remote',
'v' => 'Remote'
},
{
'k' => 'SAML',
'v' => 'SAML v2'
},
{
'k' => 'Slave',
'v' => 'Slave'
},
{
'k' => 'WebID',
'v' => 'WebID'

View File

@ -120,7 +120,7 @@ sub types {
{ $_ eq $_[0] } map ( { $_->{k} } @{ $_[2]->{select} } ) );
return $test
? 1
: ( 0, "Invalid value '$_[0]' for this select" );
: ( 1, "Invalid value '$_[0]' for this select" );
},
},
@ -1796,24 +1796,14 @@ sub attributes {
userDB => {
type => 'select',
select => [
{ k => 'AD', v => 'Active Directory' },
{ k => 'DBI', v => 'Database (DBI)' },
{ k => 'Choice', v => 'authChoice' },
{ k => 'Demo', v => 'Demonstration' },
{ k => 'Facebook', v => 'Facebook' },
{ k => 'Google', v => 'Google' },
{ k => 'LDAP', v => 'LDAP' },
{ k => 'Multi', v => 'Multiple' },
{ k => 'Null', v => 'None' },
{ k => 'OpenID', v => 'OpenID' },
{ k => 'OpenIDConnect', v => 'OpenID Connect' },
{ k => 'Proxy', v => 'Proxy' },
{ k => 'Remote', v => 'Remote' },
{ k => 'SAML', v => 'SAML v2' },
{ k => 'Slave', v => 'Slave' },
{ k => 'WebID', v => 'WebID' },
{ k => 'Same', v => 'Same' },
{ k => 'AD', v => 'Active Directory' },
{ k => 'DBI', v => 'Database (DBI)' },
{ k => 'LDAP', v => 'LDAP' },
{ k => 'Null', v => 'None' },
{ k => 'WebID', v => 'WebID' },
],
default => 'Demo',
default => 'Same',
documentation => 'User module',
},
passwordDB => {

View File

@ -9,7 +9,7 @@ sub zeroConf {
return {
'timeout' => 72000,
'loginHistoryEnabled' => 1,
'userDB' => 'Demo',
'userDB' => 'Same',
'applicationList' => {
'2administration' => {
'manager' => {

File diff suppressed because one or more lines are too long

View File

@ -147,6 +147,6 @@
"securedCookie": 0,
"sessionDataToRemember": {},
"timeout": 72000,
"userDB": "Demo",
"userDB": "Same",
"whatToTrace": "_whatToTrace"
}

View File

@ -239,53 +239,23 @@
"title": "authentication",
"type": "select"
}, {
"default": "Demo",
"default": "Same",
"id": "userDB",
"select": [{
"k": "Same",
"v": "Same as auth"
}, {
"k": "AD",
"v": "Active Directory"
}, {
"k": "DBI",
"v": "Database (DBI)"
}, {
"k": "Choice",
"v": "authChoice"
}, {
"k": "Demo",
"v": "Demonstration"
}, {
"k": "Facebook",
"v": "Facebook"
}, {
"k": "Google",
"v": "Google"
}, {
"k": "LDAP",
"v": "LDAP"
}, {
"k": "Multi",
"v": "Multiple"
}, {
"k": "Null",
"v": "None"
}, {
"k": "OpenID",
"v": "OpenID"
}, {
"k": "Proxy",
"v": "Proxy"
}, {
"k": "Remote",
"v": "Remote"
}, {
"k": "SAML",
"v": "SAML v2"
}, {
"k": "Slave",
"v": "Slave"
}, {
"k": "WebID",
"v": "WebID"
}],
"title": "userDB",
"type": "select"

View File

@ -351,57 +351,27 @@
"type": "select",
"data": "Demo"
}, {
"default": "Demo",
"default": "Same",
"id": "userDB",
"select": [{
"k": "Same",
"v": "Same as auth"
}, {
"k": "AD",
"v": "Active Directory"
}, {
"k": "DBI",
"v": "Database (DBI)"
}, {
"k": "Choice",
"v": "authChoice"
}, {
"k": "Demo",
"v": "Demonstration"
}, {
"k": "Facebook",
"v": "Facebook"
}, {
"k": "Google",
"v": "Google"
}, {
"k": "LDAP",
"v": "LDAP"
}, {
"k": "Multi",
"v": "Multiple"
}, {
"k": "Null",
"v": "None"
}, {
"k": "OpenID",
"v": "OpenID"
}, {
"k": "Proxy",
"v": "Proxy"
}, {
"k": "Remote",
"v": "Remote"
}, {
"k": "SAML",
"v": "SAML v2"
}, {
"k": "Slave",
"v": "Slave"
}, {
"k": "WebID",
"v": "WebID"
}],
"title": "userDB",
"type": "select",
"data": "Demo"
"data": "Same"
}, {
"default": "Demo",
"id": "passwordDB",

View File

@ -361,53 +361,23 @@
"type": "select",
"data": "Demo"
}, {
"default": "Demo",
"default": "Same",
"id": "userDB",
"select": [{
"k": "Same",
"v": "Same as auth"
}, {
"k": "AD",
"v": "Active Directory"
}, {
"k": "DBI",
"v": "Database (DBI)"
}, {
"k": "Choice",
"v": "authChoice"
}, {
"k": "Demo",
"v": "Demonstration"
}, {
"k": "Facebook",
"v": "Facebook"
}, {
"k": "Google",
"v": "Google"
}, {
"k": "LDAP",
"v": "LDAP"
}, {
"k": "Multi",
"v": "Multiple"
}, {
"k": "Null",
"v": "None"
}, {
"k": "OpenID",
"v": "OpenID"
}, {
"k": "Proxy",
"v": "Proxy"
}, {
"k": "Remote",
"v": "Remote"
}, {
"k": "SAML",
"v": "SAML v2"
}, {
"k": "Slave",
"v": "Slave"
}, {
"k": "WebID",
"v": "WebID"
}],
"title": "userDB",
"type": "select",

View File

@ -351,57 +351,27 @@
"type": "select",
"data": "Demo"
}, {
"default": "Demo",
"default": "Same",
"id": "userDB",
"select": [{
"k": "Same",
"v": "Same as auth"
}, {
"k": "AD",
"v": "Active Directory"
}, {
"k": "DBI",
"v": "Database (DBI)"
}, {
"k": "Choice",
"v": "authChoice"
}, {
"k": "Demo",
"v": "Demonstration"
}, {
"k": "Facebook",
"v": "Facebook"
}, {
"k": "Google",
"v": "Google"
}, {
"k": "LDAP",
"v": "LDAP"
}, {
"k": "Multi",
"v": "Multiple"
}, {
"k": "Null",
"v": "None"
}, {
"k": "OpenID",
"v": "OpenID"
}, {
"k": "Proxy",
"v": "Proxy"
}, {
"k": "Remote",
"v": "Remote"
}, {
"k": "SAML",
"v": "SAML v2"
}, {
"k": "Slave",
"v": "Slave"
}, {
"k": "WebID",
"v": "WebID"
}],
"title": "userDB",
"type": "select",
"data": "Demo"
"data": "Same"
}, {
"default": "Demo",
"id": "passwordDB",

View File

@ -177,12 +177,14 @@ sub reloadConf {
# Load authentication/userDB
# --------------------------
my $mod;
for my $type (qw(authentication userDB)) {
unless ( $self->conf->{$type} ) {
$self->error("$type is not set");
return $self->fail;
}
my $module = '::' . ucfirst($type) . '::' . $self->conf->{$type};
$mod = $self->conf->{$type} unless($self->conf->{$type} eq 'Same');
my $module = '::' . ucfirst($type) . '::' . $mod;
$module =~ s/Authentication/Auth/;
# Launch and initialize module

View File

@ -23,7 +23,7 @@ SKIP: {
logLevel => 'error',
useSafeJail => 1,
authentication => 'DBI',
userDB => 'DBI',
userDB => 'Same',
dbiAuthChain => 'dbi:SQLite:dbname=t/userdb.db',
dbiAuthUser => '',
dbiAuthPassword => '',

View File

@ -16,7 +16,7 @@ SKIP: {
useSafeJail => 1,
authentication => 'LDAP',
portal => 'http://auth.example.com/',
userDB => 'LDAP',
userDB => 'Same',
registerDB => 'LDAP',
LDAPFilter => $ENV{LDAPFILTER} || '(cn=$user)',
ldapServer => $ENV{LDAPSERVER},

View File

@ -16,7 +16,7 @@ SKIP: {
logLevel => 'error',
useSafeJail => 1,
authentication => 'AD',
userDB => 'AD',
userDB => 'Same',
LDAPFilter => $ENV{ADFILTER} || '(cn=$user)',
ldapServer => $ENV{ADSERVER},
ldapBase => $ENV{ADBASE},

View File

@ -11,7 +11,7 @@ my $client = LLNG::Manager::Test->new(
logLevel => 'error',
useSafeJail => 1,
authentication => 'Null',
userDB => 'Null',
userDB => 'Same',
}
}
);

View File

@ -11,7 +11,7 @@ my $client = LLNG::Manager::Test->new(
logLevel => 'error',
useSafeJail => 1,
authentication => 'Slave',
userDB => 'Slave',
userDB => 'Same',
slaveUserHeader => 'My-Test',
slaveExportedVars => {
name => 'Name',

View File

@ -11,7 +11,7 @@ my $client = LLNG::Manager::Test->new(
logLevel => 'error',
useSafeJail => 1,
authentication => 'Remote',
userDB => 'Remote',
userDB => 'Same',
remoteUserField => 'uid',
remoteGlobalStorage => 'Apache::Session::File',
remoteGlobalStorageOptions => {

View File

@ -14,7 +14,7 @@ SKIP: {
logLevel => 'error',
useSafeJail => 1,
authentication => 'Proxy',
userDB => 'Proxy',
userDB => 'Same',
soapAuthService => $ENV{REMOTELLNG},
}
}

View File

@ -27,7 +27,7 @@ SKIP: {
logLevel => 'error',
useSafeJail => 1,
authentication => 'Choice',
userDB => 'Choice',
userDB => 'Same',
authChoiceParam => 'test',
authChoiceModules => {

View File

@ -182,7 +182,7 @@ sub issuer {
domain => 'idp.com',
portal => 'http://auth.idp.com',
authentication => 'Demo',
userDB => 'Demo',
userDB => 'Same',
issuerDBSAMLActivation => 1,
samlSPMetaDataOptions => {
'sp.com' => {
@ -468,7 +468,7 @@ sub sp {
domain => 'sp.com',
portal => 'http://auth.sp.com',
authentication => 'SAML',
userDB => 'SAML',
userDB => 'Same',
issuerDBSAMLActivation => 0,
samlIDPMetaDataExportedAttributes => {
idp => {

View File

@ -231,7 +231,7 @@ sub issuer {
domain => 'idp.com',
portal => 'http://auth.idp.com',
authentication => 'Demo',
userDB => 'Demo',
userDB => 'Same',
issuerDBSAMLActivation => 1,
samlSPMetaDataOptions => {
'sp.com' => {
@ -516,7 +516,7 @@ sub sp {
domain => 'sp.com',
portal => 'http://auth.sp.com',
authentication => 'SAML',
userDB => 'SAML',
userDB => 'Same',
issuerDBSAMLActivation => 0,
samlIDPMetaDataExportedAttributes => {
idp => {

View File

@ -40,7 +40,7 @@ sub issuer {
domain => 'idp.com',
portal => 'http://auth.idp.com',
authentication => 'Demo',
userDB => 'Demo',
userDB => 'Same',
issuerDBSAMLActivation => 1,
samlSPMetaDataOptions => {
'sp.com' => {

View File

@ -208,7 +208,7 @@ sub issuer {
domain => 'idp.com',
portal => 'http://auth.idp.com',
authentication => 'Demo',
userDB => 'Demo',
userDB => 'Same',
issuerDBSAMLActivation => 1,
samlSPMetaDataOptions => {
'sp.com' => {
@ -496,7 +496,7 @@ sub sp {
domain => 'sp.com',
portal => 'http://auth.sp.com',
authentication => 'SAML',
userDB => 'SAML',
userDB => 'Same',
issuerDBSAMLActivation => 0,
samlIDPMetaDataExportedAttributes => {
idp => {

View File

@ -225,7 +225,7 @@ sub issuer {
domain => 'idp.com',
portal => 'http://auth.idp.com',
authentication => 'Demo',
userDB => 'Demo',
userDB => 'Same',
issuerDBSAMLActivation => 1,
samlSPMetaDataOptions => {
'sp.com' => {
@ -512,7 +512,7 @@ sub sp {
domain => 'sp.com',
portal => 'http://auth.sp.com',
authentication => 'SAML',
userDB => 'SAML',
userDB => 'Same',
issuerDBSAMLActivation => 0,
samlIDPMetaDataExportedAttributes => {
idp => {

View File

@ -188,7 +188,7 @@ sub issuer {
domain => 'idp.com',
portal => 'http://auth.idp.com',
authentication => 'Demo',
userDB => 'Demo',
userDB => 'Same',
issuerDBSAMLActivation => 1,
samlSPMetaDataOptions => {
'sp.com' => {
@ -479,7 +479,7 @@ sub sp {
domain => 'sp.com',
portal => 'http://auth.sp.com',
authentication => 'SAML',
userDB => 'SAML',
userDB => 'Same',
issuerDBSAMLActivation => 0,
samlIDPMetaDataExportedAttributes => {
idp => {

View File

@ -239,7 +239,7 @@ sub issuer {
domain => 'idp.com',
portal => 'http://auth.idp.com',
authentication => 'Demo',
userDB => 'Demo',
userDB => 'Same',
issuerDBSAMLActivation => 1,
samlSPMetaDataOptions => {
'sp.com' => {
@ -529,7 +529,7 @@ sub sp {
domain => 'sp.com',
portal => 'http://auth.sp.com',
authentication => 'SAML',
userDB => 'SAML',
userDB => 'Same',
issuerDBSAMLActivation => 0,
samlIDPMetaDataExportedAttributes => {
idp => {

View File

@ -182,7 +182,7 @@ sub issuer {
domain => 'idp.com',
portal => 'http://auth.idp.com',
authentication => 'Demo',
userDB => 'Demo',
userDB => 'Same',
issuerDBCASActivation => 1,
casAttr => 'uid',
casAttributes => { cn => 'cn', uid => 'uid', },

View File

@ -254,7 +254,7 @@ sub op {
domain => 'idp.com',
portal => 'http://auth.op.com',
authentication => 'Demo',
userDB => 'Demo',
userDB => 'Same',
issuerDBOpenIDConnectActivation => "1",
oidcRPMetaDataExportedVars => {
rp => {
@ -350,7 +350,7 @@ sub rp {
domain => 'rp.com',
portal => 'http://auth.rp.com',
authentication => 'OpenIDConnect',
userDB => 'OpenIDConnect',
userDB => 'Same',
oidcOPMetaDataExportedVars => {
op => {
cn => "name",

View File

@ -173,7 +173,7 @@ sub op {
domain => 'idp.com',
portal => 'http://auth.op.com',
authentication => 'Demo',
userDB => 'Demo',
userDB => 'Same',
issuerDBOpenIDConnectActivation => "1",
oidcRPMetaDataExportedVars => {
rp => {
@ -269,7 +269,7 @@ sub rp {
domain => 'rp.com',
portal => 'http://auth.rp.com',
authentication => 'OpenIDConnect',
userDB => 'OpenIDConnect',
userDB => 'Same',
oidcOPMetaDataExportedVars => {
op => {
cn => "name",

View File

@ -164,7 +164,7 @@ sub op {
domain => 'idp.com',
portal => 'http://auth.op.com',
authentication => 'Demo',
userDB => 'Demo',
userDB => 'Same',
issuerDBOpenIDConnectActivation => "1",
oidcRPMetaDataExportedVars => {
rp => {
@ -260,7 +260,7 @@ sub rp {
domain => 'rp.com',
portal => 'http://auth.rp.com',
authentication => 'OpenIDConnect',
userDB => 'OpenIDConnect',
userDB => 'Same',
oidcOPMetaDataExportedVars => {
op => {
cn => "name",

View File

@ -149,7 +149,7 @@ sub issuer {
domain => 'idp.com',
portal => 'http://auth.idp.com',
authentication => 'Demo',
userDB => 'Demo',
userDB => 'Same',
issuerDBOpenIDActivation => 1,
}
}
@ -164,7 +164,7 @@ sub sp {
domain => 'sp.com',
portal => 'http://auth.sp.com',
authentication => 'OpenID',
userDB => 'OpenID',
userDB => 'Same',
openIdSecret => 'qwerty',
exportedVars => {
mail => 'email',

View File

@ -248,7 +248,7 @@ sub issuer {
domain => 'idp.com',
portal => 'http://auth.idp.com',
authentication => 'Demo',
userDB => 'Demo',
userDB => 'Same',
restSessionServer => 1,
restConfigServer => 1,
}
@ -264,7 +264,7 @@ sub sp {
domain => 'sp.com',
portal => 'http://auth.sp.com',
authentication => 'Proxy',
userDB => 'Proxy',
userDB => 'Same',
proxyAuthService => 'http://auth.idp.com',
proxyUseSoap => 0,
whatToTrace => '_whatToTrace',

View File

@ -152,7 +152,7 @@ sub issuer {
domain => 'idp.com',
portal => 'http://auth.idp.com',
authentication => 'Demo',
userDB => 'Demo',
userDB => 'Same',
soapSessionServer => 1,
}
}
@ -167,7 +167,7 @@ sub sp {
domain => 'sp.com',
portal => 'http://auth.sp.com',
authentication => 'Proxy',
userDB => 'Proxy',
userDB => 'Same',
proxyAuthService => 'http://auth.idp.com/sessions',
proxyUseSoap => 1,
},

View File

@ -161,7 +161,7 @@ sub issuer {
domain => 'idp.com',
portal => 'http://auth.idp.com',
authentication => 'Demo',
userDB => 'Demo',
userDB => 'Same',
restSessionServer => 1,
restConfigServer => 1,
}
@ -177,7 +177,7 @@ sub sp {
domain => 'sp.com',
portal => 'http://auth.sp.com',
authentication => 'Demo',
userDB => 'Demo',
userDB => 'Same',
globalStorage => 'Lemonldap::NG::Common::Apache::Session::REST',
globalStorageOptions => {
baseUrl => 'http://auth.idp.com/sessions/global/'

View File

@ -134,7 +134,7 @@ sub issuer {
domain => 'idp.com',
portal => 'http://auth.idp.com',
authentication => 'Demo',
userDB => 'Demo',
userDB => 'Same',
soapSessionServer => 1,
}
}
@ -149,7 +149,7 @@ sub sp {
domain => 'sp.com',
portal => 'http://auth.sp.com',
authentication => 'Demo',
userDB => 'Demo',
userDB => 'Same',
globalStorage => 'Lemonldap::NG::Common::Apache::Session::SOAP',
globalStorageOptions =>
{ proxy => 'http://auth.idp.com/adminSessions' },

View File

@ -17,7 +17,7 @@ my $client = LLNG::Manager::Test->new(
useSafeJail => 1,
portalDisplayRegister => 1,
authentication => 'Demo',
userDB => 'Demo',
userDB => 'Same',
registerDB => 'Demo',
captcha_register_enabled => 0,
}

View File

@ -25,7 +25,7 @@ SKIP: {
useSafeJail => 1,
portalDisplayRegister => 1,
authentication => 'Demo',
userDB => 'Demo',
userDB => 'Same',
passwordDB => 'Demo',
captcha_mail_enabled => 1,
requireToken => 1,

View File

@ -19,7 +19,7 @@ my $client = LLNG::Manager::Test->new(
useSafeJail => 1,
portalDisplayRegister => 1,
authentication => 'Demo',
userDB => 'Demo',
userDB => 'Same',
passwordDB => 'Demo',
captcha_mail_enabled => 0,
requireToken => 1,

View File

@ -19,7 +19,7 @@ my $client = LLNG::Manager::Test->new(
useSafeJail => 1,
portalDisplayRegister => 1,
authentication => 'Demo',
userDB => 'Demo',
userDB => 'Same',
passwordDB => 'Demo',
captcha_mail_enabled => 0,
portalDisplayResetPassword => 1,

View File

@ -14,7 +14,7 @@ my $client = LLNG::Manager::Test->new(
logLevel => 'error',
portalStatus => 1,
authentication => 'Demo',
userDB => 'Demo',
userDB => 'Same',
}
}
);

View File

@ -75,6 +75,6 @@
},
"reloadUrls": {},
"requireToken": 0,
"userDB": "Demo",
"userDB": "Same",
"whatToTrace": "_whatToTrace"
}