Be more consistent with REST params & Update doc (#1976)

This commit is contained in:
Christophe Maudoux 2021-04-01 22:48:02 +02:00
parent 61a35984c1
commit bcfb075f63
8 changed files with 31 additions and 23 deletions

View File

@ -20,6 +20,7 @@ Just enable it in the Manager (section “plugins”). Then, set searching attri
- **Activation**: Enable / Disable this plugin
- **Character used as wildcard**: Character that can be used by users as wildcard. An empty value disable wildcarded search requests
- **Parameters control**: Regular expression used for checking searching values syntax
- **User accounts URL**: User database URL to search on if REST backend is used. Let it blank to use default user data URL.
- **Searching attributes**: For each attribute, you have to set a key (attribute as defined in UserBD) and a value that will be display in login form (placeholder). A value can be a multivalued list separated by multiValuesSeparator parameter (General Parameters > Advanced parameters > Separator). See note below.
- **Excluding attributes**: You can defined here attributes used for excluding accounts. Set keys corresponding to UserBD attributes and values to exclude. A value can be a multivalued list separated by multiValuesSeparator parameter (General Parameters > Advanced parameters > Separator)

View File

@ -54,7 +54,7 @@ our $authParameters = {
proxyParams => [qw(proxyAuthnLevel proxyAuthService proxySessionService remoteCookieName proxyUseSoap)],
radiusParams => [qw(radiusAuthnLevel radiusSecret radiusServer)],
remoteParams => [qw(remotePortal remoteCookieName remoteGlobalStorage remoteGlobalStorageOptions)],
restParams => [qw(restAuthnLevel restAuthUrl restUserDBUrl restPwdConfirmUrl restPwdModifyUrl restFindUserDBUrl)],
restParams => [qw(restAuthnLevel restAuthUrl restUserDBUrl restPwdConfirmUrl restPwdModifyUrl)],
slaveParams => [qw(slaveAuthnLevel slaveUserHeader slaveMasterIP slaveHeaderName slaveHeaderContent slaveDisplayLogo slaveExportedVars)],
sslParams => [qw(SSLAuthnLevel SSLVar SSLVarIf sslByAjax sslHost)],
twitterParams => [qw(twitterAuthnLevel twitterKey twitterSecret twitterAppName twitterUserField)],

View File

@ -393,9 +393,9 @@ sub tree {
help => 'authrest.html',
form => 'simpleInputContainer',
nodes => [
'restAuthnLevel', 'restAuthUrl',
'restUserDBUrl', 'restPwdConfirmUrl',
'restPwdModifyUrl', 'restFindUserDBUrl'
'restAuthnLevel', 'restAuthUrl',
'restUserDBUrl', 'restPwdConfirmUrl',
'restPwdModifyUrl'
]
},
{
@ -825,6 +825,7 @@ sub tree {
'findUser',
'findUserWildcard',
'findUserControl',
'restFindUserDBUrl',
'findUserSearchingAttributes',
'findUserExcludingAttributes'
]

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

View File

@ -35,7 +35,7 @@ has cookieName => (
is => 'rw',
lazy => 1,
default => sub {
$_[0]->{conf}->{stayConnectedCookieName} || 'llngconnection';
$_[0]->conf->{stayConnectedCookieName} || 'llngconnection';
}
);
@ -44,7 +44,7 @@ has timeout => (
is => 'rw',
lazy => 1,
default => sub {
$_[0]->{conf}->{stayConnectedTimeout} || 2592000;
$_[0]->conf->{stayConnectedTimeout} || 2592000;
}
);

View File

@ -15,22 +15,26 @@ extends qw(
Lemonldap::NG::Portal::Lib::REST
);
our $VERSION = '2.0.11';
our $VERSION = '2.0.12';
# INITIALIZATION
has findUserDBUrl => (
is => 'ro',
lazy => 1,
default => sub {
$_[0]->conf->{restFindUserDBUrl} || $_[0]->conf->{restUserDBUrl};
}
);
sub init {
my $self = shift;
# Add warning in log
unless ( $self->conf->{restUserDBUrl} ) {
$self->logger->error('REST User data URL is not set');
return 0;
}
if ( !$self->conf->{restFindUserDBUrl} && $self->conf->{findUser} ) {
$self->logger->error('REST User accounts URL is not set');
return 0;
}
return 1;
}
@ -85,7 +89,7 @@ sub findUser {
];
$res = eval {
$self->restCall(
$self->conf->{restFindUserDBUrl},
$self->findUserDBUrl,
{
searchingAttributes => to_json($searching),
(
@ -124,11 +128,12 @@ sub setSessionInfo {
my ( $self, $req ) = @_;
$req->sessionInfo->{$_} = $req->data->{restUserDBInfo}->{$_}
foreach ( keys %{ $req->data->{restUserDBInfo} } );
PE_OK;
return PE_OK;
}
sub setGroups {
PE_OK;
return PE_OK;
}
1;

View File

@ -76,12 +76,13 @@ my $json;
my $request;
my $client = LLNG::Manager::Test->new( {
ini => {
logLevel => 'error',
authentication => 'Null',
userDB => 'REST',
passwordDB => 'Null',
restUserDBUrl => 'http://ws/user',
restFindUserDBUrl => 'http://ws/search',
logLevel => 'debug',
authentication => 'Null',
userDB => 'REST',
passwordDB => 'Null',
restUserDBUrl => 'http://ws/search',
#restFindUserDBUrl => 'http://ws/search',
findUser => 1,
impersonationRule => 1,
useSafeJail => 1,