New "Custom" modules family (closes: #1188)

This commit is contained in:
Xavier Guimard 2017-03-07 17:28:09 +00:00
parent d7340203a5
commit 2fb085b2a6
13 changed files with 168 additions and 20 deletions

View File

@ -34,6 +34,7 @@ our $authParameters = {
casParams => [qw(CAS_authnLevel CAS_url CAS_CAFile CAS_renew CAS_gateway CAS_pgtFile CAS_proxiedServices)],
choiceParams => [qw(authChoiceParam authChoiceModules)],
combinationParams => [qw(combination combModules)],
customParams => [qw(customAuth customUserDB customPassword customRegister)],
dbiParams => [qw(dbiAuthnLevel dbiExportedVars dbiAuthChain dbiAuthUser dbiAuthPassword dbiUserChain dbiUserUser dbiUserPassword dbiAuthTable dbiUserTable dbiAuthLoginCol dbiAuthPasswordCol dbiPasswordMailCol userPivot dbiAuthPasswordHash)],
demoParams => [qw(demoExportedVars)],
facebookParams => [qw(facebookAuthnLevel facebookExportedVars facebookAppId facebookAppSecret)],

View File

@ -359,6 +359,10 @@ sub attributes {
{
'k' => 'Yubikey',
'v' => 'Yubikey'
},
{
'k' => 'Custom',
'v' => 'customModule'
}
],
[
@ -421,6 +425,10 @@ sub attributes {
{
'k' => 'WebID',
'v' => 'WebID'
},
{
'k' => 'Custom',
'v' => 'customModule'
}
],
[
@ -447,6 +455,10 @@ sub attributes {
{
'k' => 'Null',
'v' => 'None'
},
{
'k' => 'Custom',
'v' => 'customModule'
}
]
],
@ -553,6 +565,10 @@ sub attributes {
{
'k' => 'Null',
'v' => 'None'
},
{
'k' => 'Custom',
'v' => 'customModule'
}
],
'type' => 'select'
@ -747,6 +763,10 @@ qr/(?:(?:https?):\/\/(?:(?:(?:(?:(?:(?:[a-zA-Z0-9][-a-zA-Z0-9]*)?[a-zA-Z0-9])[.]
{
'k' => 'Null',
'v' => 'None'
},
{
'k' => 'Custom',
'v' => 'customModule'
}
],
'test' => sub {
@ -801,11 +821,23 @@ qr/(?:(?:https?):\/\/(?:(?:(?:(?:(?:(?:[a-zA-Z0-9][-a-zA-Z0-9]*)?[a-zA-Z0-9])[.]
'default' => '\'self\'',
'type' => 'text'
},
'customAuth' => {
'type' => 'text'
},
'customFunctions' => {
'msgFail' => '__badCustomFuncName__',
'test' => qr/^(?:\w+(?:::\w+)*(?:\s+\w+(?:::\w+)*)*)?$/,
'type' => 'text'
},
'customPassword' => {
'type' => 'text'
},
'customRegister' => {
'type' => 'text'
},
'customUserDB' => {
'type' => 'text'
},
'dbiAuthChain' => {
'type' => 'text'
},
@ -1826,6 +1858,10 @@ qr/^(?:(?:(?:(?:[a-zA-Z0-9][-a-zA-Z0-9]*)?[a-zA-Z0-9])[.])*(?:[a-zA-Z][-a-zA-Z0-
{
'k' => 'Null',
'v' => 'None'
},
{
'k' => 'Custom',
'v' => 'customModule'
}
],
'type' => 'select'
@ -2060,6 +2096,10 @@ qr/^(?:(?:(?:(?:[a-zA-Z0-9][-a-zA-Z0-9]*)?[a-zA-Z0-9])[.])*(?:[a-zA-Z][-a-zA-Z0-
{
'k' => 'Null',
'v' => 'None'
},
{
'k' => 'Custom',
'v' => 'customModule'
}
],
'type' => 'select'
@ -2874,6 +2914,10 @@ qr/^(?:(?:(?:(?:(?:(?:[a-zA-Z0-9][-a-zA-Z0-9]*)?[a-zA-Z0-9])[.])*(?:[a-zA-Z][-a-
{
'k' => 'Null',
'v' => 'None'
},
{
'k' => 'Custom',
'v' => 'customModule'
}
],
'type' => 'select'

View File

@ -922,10 +922,11 @@ sub attributes {
registerDB => {
type => 'select',
select => [
{ k => 'AD', v => 'Active Directory' },
{ k => 'Demo', v => 'Demonstration' },
{ k => 'LDAP', v => 'LDAP' },
{ k => 'Null', v => 'None' },
{ k => 'AD', v => 'Active Directory' },
{ k => 'Demo', v => 'Demonstration' },
{ k => 'LDAP', v => 'LDAP' },
{ k => 'Null', v => 'None' },
{ k => 'Custom', v => 'customModule' },
],
default => 'Null',
documentation => 'Register module',
@ -1737,6 +1738,7 @@ sub attributes {
{ k => 'Remote', v => 'Remote' },
{ k => 'Slave', v => 'Slave' },
{ k => 'Null', v => 'None' },
{ k => 'Custom', v => 'customModule' },
],
default => 'Demo',
documentation => 'Authentication module',
@ -1744,12 +1746,13 @@ sub attributes {
userDB => {
type => 'select',
select => [
{ k => 'Same', v => 'Same' },
{ k => 'AD', v => 'Active Directory' },
{ k => 'DBI', v => 'Database (DBI)' },
{ k => 'LDAP', v => 'LDAP' },
{ k => 'REST', v => 'REST' },
{ k => 'Null', v => 'None' },
{ k => 'Same', v => 'Same' },
{ k => 'AD', v => 'Active Directory' },
{ k => 'DBI', v => 'Database (DBI)' },
{ k => 'LDAP', v => 'LDAP' },
{ k => 'REST', v => 'REST' },
{ k => 'Null', v => 'None' },
{ k => 'Custom', v => 'customModule' },
],
default => 'Same',
documentation => 'User module',
@ -1764,6 +1767,7 @@ sub attributes {
{ k => 'LDAP', v => 'LDAP' },
{ k => 'REST', v => 'REST' },
{ k => 'Null', v => 'None' },
{ k => 'Custom', v => 'customModule' },
],
default => 'Demo',
documentation => 'Password module',
@ -2192,7 +2196,8 @@ m{^(?:ldapi://[^/]*/?|\w[\w\-\.]*(?::\d{1,5})?|ldap(?:s|\+tls)?://\w[\w\-\.]*(?:
{ k => 'SSL', v => 'SSL' },
{ k => 'Twitter', v => 'Twitter' },
{ k => 'WebID', v => 'WebID' },
{ k => 'Yubikey', v => 'Yubikey' }
{ k => 'Yubikey', v => 'Yubikey' },
{ k => 'Custom', v => 'customModule' },
],
[
{ k => 'AD', v => 'Active Directory' },
@ -2209,15 +2214,17 @@ m{^(?:ldapi://[^/]*/?|\w[\w\-\.]*(?::\d{1,5})?|ldap(?:s|\+tls)?://\w[\w\-\.]*(?:
{ k => 'Remote', v => 'Remote' },
{ k => 'SAML', v => 'SAML v2' },
{ k => 'Slave', v => 'Slave' },
{ k => 'WebID', v => 'WebID' }
{ k => 'WebID', v => 'WebID' },
{ k => 'Custom', v => 'customModule' },
],
[
{ k => 'AD', v => 'Active Directory' },
{ k => 'DBI', v => 'Database (DBI)' },
{ k => 'Demo', v => 'Demo' },
{ k => 'LDAP', v => 'LDAP' },
{ k => 'REST', v => 'REST' },
{ k => 'Null', v => 'None' }
{ k => 'AD', v => 'Active Directory' },
{ k => 'DBI', v => 'Database (DBI)' },
{ k => 'Demo', v => 'Demo' },
{ k => 'LDAP', v => 'LDAP' },
{ k => 'REST', v => 'REST' },
{ k => 'Null', v => 'None' },
{ k => 'Custom', v => 'customModule' },
]
],
},
@ -2254,6 +2261,7 @@ m{^(?:ldapi://[^/]*/?|\w[\w\-\.]*(?::\d{1,5})?|ldap(?:s|\+tls)?://\w[\w\-\.]*(?:
{ k => 'Remote', v => 'Remote' },
{ k => 'Slave', v => 'Slave' },
{ k => 'Null', v => 'None' },
{ k => 'Custom', v => 'customModule' },
],
},
@ -2271,6 +2279,24 @@ m{^(?:ldapi://[^/]*/?|\w[\w\-\.]*(?::\d{1,5})?|ldap(?:s|\+tls)?://\w[\w\-\.]*(?:
documentation => 'Yubikey public ID size',
},
# Custom auth modules
customAuth => {
type => 'text',
documentation => 'Custom auth module',
},
customUserDB => {
type => 'text',
documentation => 'Custom user DB module',
},
customPassword => {
type => 'text',
documentation => 'Custom password module',
},
customRegister => {
type => 'text',
documentation => 'Custom register module',
},
# OpenID Connect auth params
oidcAuthnLevel => {
type => 'int',

View File

@ -356,6 +356,15 @@ sub tree {
'yubikeySecretKey', 'yubikeyPublicIDSize'
]
},
{
title => 'customParams',
help => 'authcustom.html',
form => 'simpleInputContainer',
nodes => [
'customAuth', 'customUserDB',
'customPassword', 'customRegister',
]
},
],
'nodes_filter' => 'authParams'
},

View File

@ -143,8 +143,14 @@
"cookieParams": "Cookies",
"create": "Create",
"currentConfiguration": "Current configuration",
"customAuth": "Custom authentication module",
"customFunctions": "Custom functions",
"customModule": "Custom module",
"customParams": "Custom authentication modules",
"customPassword": "Custom password module",
"customPortalSkin": "Custom portal skin",
"customRegister": "Custom register module",
"customUserDB": "Custom user DB module",
"date": "Date",
"dbiAuthChain": "Chain",
"dbiAuthLoginCol": "Login field name",

View File

@ -143,8 +143,14 @@
"cookieParams": "Cookies",
"create": "Créer",
"currentConfiguration": "Configuration actuelle",
"customAuth": "Module d'authentification personnalisé",
"customFunctions": "Fonctions personnalisées",
"customModule": "Module personnalisé",
"customParams": "Modules d'authentification personnalisés",
"customPassword": "Module de mots-de-passe personnalisé",
"customPortalSkin": "Style personnalisé du portail",
"customRegister": "Module d'enregistrement personnalisé",
"customUserDB": "Module BD utilisateurs personnalisé",
"date": "Date",
"dbiAuthChain": "Chaîne",
"dbiAuthLoginCol": "Champ identifiant",

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

View File

@ -15,6 +15,7 @@ lib/Lemonldap/NG/Portal/Auth/Base.pm
lib/Lemonldap/NG/Portal/Auth/CAS.pm
lib/Lemonldap/NG/Portal/Auth/Choice.pm
lib/Lemonldap/NG/Portal/Auth/Combination.pm
lib/Lemonldap/NG/Portal/Auth/Custom.pm
lib/Lemonldap/NG/Portal/Auth/DBI.pm
lib/Lemonldap/NG/Portal/Auth/Demo.pm
lib/Lemonldap/NG/Portal/Auth/Facebook.pm
@ -73,6 +74,7 @@ lib/Lemonldap/NG/Portal/Main/Request.pm
lib/Lemonldap/NG/Portal/Main/Run.pm
lib/Lemonldap/NG/Portal/Password/Base.pm
lib/Lemonldap/NG/Portal/Password/Choice.pm
lib/Lemonldap/NG/Portal/Password/Custom.pm
lib/Lemonldap/NG/Portal/Password/DBI.pm
lib/Lemonldap/NG/Portal/Password/Demo.pm
lib/Lemonldap/NG/Portal/Password/LDAP.pm
@ -91,12 +93,14 @@ lib/Lemonldap/NG/Portal/Plugins/SOAPServer.pm
lib/Lemonldap/NG/Portal/Plugins/Status.pm
lib/Lemonldap/NG/Portal/Plugins/U2F.pm
lib/Lemonldap/NG/Portal/Register/AD.pm
lib/Lemonldap/NG/Portal/Register/Custom.pm
lib/Lemonldap/NG/Portal/Register/Demo.pm
lib/Lemonldap/NG/Portal/Register/LDAP.pm
lib/Lemonldap/NG/Portal/Register/U2F.pm
lib/Lemonldap/NG/Portal/UserDB/AD.pm
lib/Lemonldap/NG/Portal/UserDB/Choice.pm
lib/Lemonldap/NG/Portal/UserDB/Combination.pm
lib/Lemonldap/NG/Portal/UserDB/Custom.pm
lib/Lemonldap/NG/Portal/UserDB/DBI.pm
lib/Lemonldap/NG/Portal/UserDB/Demo.pm
lib/Lemonldap/NG/Portal/UserDB/Facebook.pm

View File

@ -0,0 +1,13 @@
package Lemonldap::NG::Portal::Auth::Custom;
use strict;
sub new {
my ( $class, $self ) = @_;
unless ( $self->{conf}->{customAuth} ) {
die 'Custom auth module not defined';
}
return $self->{p}->loadModule( $self->{conf}->{customAuth} );
}
1;

View File

@ -0,0 +1,13 @@
package Lemonldap::NG::Portal::Password::Custom;
use strict;
sub new {
my ( $class, $self ) = @_;
unless ( $self->{conf}->{customPassword} ) {
die 'Custom password module not defined';
}
return $self->{p}->loadModule( $self->{conf}->{customPassword} );
}
1;

View File

@ -0,0 +1,13 @@
package Lemonldap::NG::Portal::Register::Custom;
use strict;
sub new {
my ( $class, $self ) = @_;
unless ( $self->{conf}->{customRegister} ) {
die 'Custom register module not defined';
}
return $self->{p}->loadModule( $self->{conf}->{customRegister} );
}
1;

View File

@ -0,0 +1,13 @@
package Lemonldap::NG::Portal::UserDB::Custom;
use strict;
sub new {
my ( $class, $self ) = @_;
unless ( $self->{conf}->{customUserDB} ) {
die 'Custom user DB module not defined';
}
return $self->{p}->loadModule( $self->{conf}->{customUserDB} );
}
1;