From d1a1dad4427849973c182d2e4d74e9a424e9bf16 Mon Sep 17 00:00:00 2001 From: Christophe Maudoux Date: Sun, 29 Apr 2018 22:02:26 +0200 Subject: [PATCH] Update pod --- lemonldap-ng-manager/lib/Lemonldap/NG/Manager.pm | 6 ++++-- .../lib/Lemonldap/NG/Manager/Conf/Tests.pm | 2 +- .../lib/Lemonldap/NG/Portal/Main/SecondFactor.pm | 9 +++++++++ 3 files changed, 14 insertions(+), 3 deletions(-) diff --git a/lemonldap-ng-manager/lib/Lemonldap/NG/Manager.pm b/lemonldap-ng-manager/lib/Lemonldap/NG/Manager.pm index 290842be2..a523e95e4 100644 --- a/lemonldap-ng-manager/lib/Lemonldap/NG/Manager.pm +++ b/lemonldap-ng-manager/lib/Lemonldap/NG/Manager.pm @@ -193,7 +193,7 @@ inherits of L =head1 ORGANIZATION -Lemonldap::NG Manager contains 5 parts: +Lemonldap::NG Manager contains 6 parts: =over @@ -203,6 +203,8 @@ Lemonldap::NG Manager contains 5 parts: =item Notification explorer +=item Second Factors manager + =item Configuration builder (see L =item Command line (see L @@ -253,7 +255,7 @@ you can also fix them in $opts hash ref passed as argument to run() or new()). protection = manager ;enabledModules: Modules to display. Default to `conf, sessions, notifications` - enabledModules = conf, sessions, notifications + enabledModules = conf, sessions, notifications, 2ndFA ;logLevel: choose one of error, warn, notice, info, debug ; See Lemonldap::NG::Common::PSGI doc for more diff --git a/lemonldap-ng-manager/lib/Lemonldap/NG/Manager/Conf/Tests.pm b/lemonldap-ng-manager/lib/Lemonldap/NG/Manager/Conf/Tests.pm index 2d9495c0e..3835bfecd 100644 --- a/lemonldap-ng-manager/lib/Lemonldap/NG/Manager/Conf/Tests.pm +++ b/lemonldap-ng-manager/lib/Lemonldap/NG/Manager/Conf/Tests.pm @@ -362,7 +362,7 @@ sub tests { return 1 unless ( $conf->{utotp2fActivation} ); my $w = ""; foreach ( 'totp', 'u' ) { - $w .= uc($_) . "2F is activated twice !!! \n" + $w .= uc($_) . "2F is activated twice \n" if ( $conf->{ $_ . '2fActivation' } eq '1' ); } return ( 1, ( $w ? $w : () ) ); diff --git a/lemonldap-ng-portal/lib/Lemonldap/NG/Portal/Main/SecondFactor.pm b/lemonldap-ng-portal/lib/Lemonldap/NG/Portal/Main/SecondFactor.pm index 88ba7e454..c5ced8fd7 100644 --- a/lemonldap-ng-portal/lib/Lemonldap/NG/Portal/Main/SecondFactor.pm +++ b/lemonldap-ng-portal/lib/Lemonldap/NG/Portal/Main/SecondFactor.pm @@ -131,6 +131,15 @@ L second factor plugins. sub init { my ($self) = @_; # Insert here initialization process + # + # If self registration is enabled and "activation" is set to "enabled", + # replace the rule to detect if user has registered a device key. + # The rule must be like this : + # By example : + $self->conf->{u2fActivation} = '$_2fDevices =~ /"type":\s*"U2F"/s' + # Optionnaly, the rule can be : '$_2fDevices and $_2fDevices =~ /"type":\s*"U2F"/s' + # to avoid warning due to undef variable + # # Required call: return $self->SUPER::init(); }