Use Perltidy 20220217 (Closes: #2765)

This commit is contained in:
Yadd 2022-06-23 12:12:25 +02:00
parent c0803bc306
commit 46d43e69d9
57 changed files with 181 additions and 159 deletions

View File

@ -1164,13 +1164,13 @@ test-diff:
done
tidy: clean
@if perltidy -v|grep v20210717 >/dev/null; then \
@if perltidy -v|grep v20220217 >/dev/null; then \
for f in `find lemon*/ -type f \( -name '*.pm' -or -name '*.pl' -or -name '*.fcgi' -or -name '*.t' \)`; do \
echo -n $$f; \
perltidy -se -b $$f; \
echo; \
done; \
else echo "Wrong perltidy version, please install Perl::Tidy@20210717" ; exit 1 ;\
else echo "Wrong perltidy version, please install Perl::Tidy@20220217" ; exit 1 ;\
fi
find lemon*/ -name '*.bak' -delete
$(MAKE) json

View File

@ -36,7 +36,7 @@ sub new {
$show = 0 if ( $level eq $_ );
}
die "Unknown logLevel $level" if $show;
return $self;
}

View File

@ -104,7 +104,7 @@ q"I refuse to compile 'rules.json' when useSafeJail isn't activated! Yes I know,
$class->logger->debug("DevOps handler called by $vhost");
$class->locationRulesInit( undef, { $vhost => $json->{rules} } );
$class->headersInit( undef, { $vhost => $json->{headers} } );
$class->headersInit( undef, { $vhost => $json->{headers} } );
$class->tsv->{lastVhostUpdate}->{$vhost} = time;
$class->tsv->{https}->{$vhost} = uc $req->env->{HTTPS_REDIRECT} eq 'ON'
if exists $req->env->{HTTPS_REDIRECT};

View File

@ -205,7 +205,8 @@ sub jailInit {
sub defaultValuesInit {
my ( $class, $conf ) = @_;
$class->tsv->{$_} = $conf->{$_} foreach ( qw(
$class->tsv->{$_} = $conf->{$_}
foreach ( qw(
cookieExpiration cookieName customFunctions httpOnly
securedCookie timeout timeoutActivity
timeoutActivityInterval useRedirectOnError useRedirectOnForbidden
@ -214,7 +215,7 @@ sub defaultValuesInit {
authChoiceAuthBasic authChoiceParam hiddenAttributes
upgradeSession
)
);
);
$class->tsv->{cipher} = Lemonldap::NG::Common::Crypto->new( $conf->{key} );

View File

@ -66,7 +66,7 @@ sub init {
my @res = ( "Lemonldap::NG::Manager::" . ucfirst($_) );
if ( my $tmp = $self->loadPlugin( @res, $conf ) ) {
$self->logger->debug("Plugin $_ loaded");
push @links, $_;
push @links, $_;
push @{ $self->loadedPlugins }, $tmp;
$self->hLoadedPlugins->{$_} = $tmp;
}
@ -188,7 +188,8 @@ sub javascript {
. "var impPrefix='$impPrefix';"
. ( $self->links ? 'var links=' . to_json( $self->links ) . ';' : '' )
. (
$self->menuLinks ? 'var menulinks=' . to_json( $self->menuLinks ) . ';'
$self->menuLinks
? 'var menulinks=' . to_json( $self->menuLinks ) . ';'
: ''
);
}

View File

@ -1485,7 +1485,7 @@ sub attributes {
flags => 'hp',
},
captchaOptions => {
type => 'keyTextContainer',
type => 'keyTextContainer',
documentation => 'Captcha module options',
flags => 'hp',
},

View File

@ -74,7 +74,7 @@ sub tree {
},
{
title => 'passwordManagement',
help =>
help =>
'portalcustom.html#password-management',
form => 'simpleInputContainer',
nodes => [
@ -101,7 +101,7 @@ sub tree {
},
{
title => 'portalOther',
help =>
help =>
'portalcustom.html#other-parameters',
form => 'simpleInputContainer',
nodes => [
@ -127,10 +127,7 @@ sub tree {
{
title => 'captchaCustom',
help => 'captcha.html#configuration',
nodes => [
'captcha',
'captchaOptions',
]
nodes => [ 'captcha', 'captchaOptions', ]
},
]
}
@ -138,8 +135,8 @@ sub tree {
},
{
title => 'authParams',
help =>
'start.html#authentication-users-and-password-databases',
help =>
'start.html#authentication-users-and-password-databases',
form => 'authParams',
nodes => [
'authentication', 'userDB', 'passwordDB', 'registerDB'
@ -224,8 +221,8 @@ sub tree {
nodes => [
'dbiDynamicHashEnabled',
'dbiDynamicHashValidSchemes',
'dbiDynamicHashValidSaltedSchemes',
'dbiDynamicHashNewPasswordScheme'
'dbiDynamicHashValidSaltedSchemes',
'dbiDynamicHashNewPasswordScheme'
]
}
]
@ -563,7 +560,7 @@ sub tree {
help => 'logs.html',
form => 'simpleInputContainer',
nodes =>
[ 'whatToTrace', 'customToTrace', 'hiddenAttributes' ]
[ 'whatToTrace', 'customToTrace', 'hiddenAttributes' ]
},
{
title => 'cookieParams',
@ -659,8 +656,8 @@ sub tree {
},
{
title => 'soapServices',
help =>
'portalservers.html#SOAP_(deprecated)',
help =>
'portalservers.html#SOAP_(deprecated)',
form => 'simpleInputContainer',
nodes => [
'soapSessionServer',
@ -693,15 +690,15 @@ sub tree {
'notificationStorageOptions',
{
title => 'serverNotification',
help =>
'notifications.html#notification-server',
help =>
'notifications.html#notification-server',
nodes => [
'notificationServer',
'notificationDefaultCond',
'notificationServerSentAttributes',
{
title =>
'notificationServerMethods',
'notificationServerMethods',
form => 'simpleInputContainer',
nodes => [
'notificationServerPOST',

View File

@ -552,22 +552,18 @@ sub tests {
}
# Use WebAuthn
if ( $conf->{webauthn2fActivation} )
{
if ( $conf->{webauthn2fActivation} ) {
eval "use Authen::WebAuthn";
return ( 1,
"Authen::WebAuthn module is required to enable WebAuthn"
) if ($@);
"Authen::WebAuthn module is required to enable WebAuthn" )
if ($@);
}
# WebAuthn requires https://
if ( $conf->{webauthn2fActivation} )
{
my $portal_uri = URI->new($conf->{portal});
unless ($portal_uri->scheme eq "https") {
return ( 1,
"WebAuthn requires HTTPS"
);
if ( $conf->{webauthn2fActivation} ) {
my $portal_uri = URI->new( $conf->{portal} );
unless ( $portal_uri->scheme eq "https" ) {
return ( 1, "WebAuthn requires HTTPS" );
}
}

View File

@ -229,7 +229,8 @@ sub run {
# Skip 2F if authnLevel is already high enough
if (
$self->conf->{sfOnlyUpgrade} and !$forceUpgrade
$self->conf->{sfOnlyUpgrade}
and !$forceUpgrade
and ( ( $req->pdata->{targetAuthnLevel} || 0 ) <=
( $req->sessionInfo->{authenticationLevel} || 0 ) )
)
@ -392,7 +393,8 @@ sub run {
MSG => $self->canUpdateSfa($req) || 'choose2f',
ALERT => ( $self->canUpdateSfa($req) ? 'warning' : 'positive' ),
MODULES => [
map { {
map {
{
CODE => $_->prefix,
LOGO => $_->logo,
LABEL => $_->label
@ -451,7 +453,7 @@ sub _choice {
return $self->p->do(
$req,
[
sub { $res }, 'controlUrl',
sub { $res }, 'controlUrl',
'buildCookie', @{ $self->p->endAuth },
]
);

View File

@ -18,7 +18,7 @@ has prefix => ( is => 'rw', default => 'totp' );
has template => ( is => 'ro', default => 'totp2fregister' );
has welcome => ( is => 'ro', default => 'yourNewTotpKey' );
has logo => ( is => 'rw', default => 'totp.png' );
has ott => (
has ott => (
is => 'rw',
lazy => 1,
default => sub {

View File

@ -18,7 +18,7 @@ has prefix => ( is => 'rw', default => 'webauthn' );
has template => ( is => 'ro', default => 'webauthn2fregister' );
has welcome => ( is => 'ro', default => 'webauthn2fWelcome' );
has logo => ( is => 'rw', default => 'webauthn.png' );
has ott => (
has ott => (
is => 'ro',
lazy => 1,
default => sub {
@ -178,7 +178,7 @@ sub _registration {
if (
$self->find2fDevicesByKey(
$req, $req->userData, $self->type,
$req, $req->userData, $self->type,
"_credentialId", $credential_id
)
)

View File

@ -16,7 +16,7 @@ our $VERSION = '2.0.12';
extends 'Lemonldap::NG::Portal::Auth::_WebForm';
has db => ( is => 'rw' );
has db => ( is => 'rw' );
has tmp => (
is => 'rw',
default => sub {

View File

@ -20,7 +20,7 @@ has allowedDomains => ( is => 'rw', isa => 'ArrayRef' );
has keytab => ( is => 'rw' );
has AjaxInitScript => ( is => 'rw', default => '' );
has Name => ( is => 'ro', default => 'Kerberos' );
has InitCmd => (
has InitCmd => (
is => 'ro',
default => q@$self->p->setHiddenFormValue( $req, kerberos => 0, '', 0 )@
);

View File

@ -19,8 +19,8 @@ extends qw(
# INTERFACE
has opList => ( is => 'rw', isa => 'ArrayRef', default => sub { [] } );
has path => ( is => 'rw', default => 'oauth2' );
has opList => ( is => 'rw', isa => 'ArrayRef', default => sub { [] } );
has path => ( is => 'rw', default => 'oauth2' );
use constant sessionKind => 'OIDC';

View File

@ -85,7 +85,7 @@ sub _getCaptcha {
$image->random;
$image->create( 'normal', 'default', $self->fgColor, $self->bgColor );
my ( $imageData, $mimeType, $rdm ) = $image->out( force => 'png' );
my $img = 'data:image/png;base64,' . encode_base64( $imageData, '' );
my $img = 'data:image/png;base64,' . encode_base64( $imageData, '' );
my $token = $self->ott->createToken( { captcha => $rdm } );
return ( $token, $img );
}

View File

@ -36,7 +36,7 @@ sub beforeAuth { 'exportRequestParameters' }
use constant sessionKind => 'OIDCI';
has rule => ( is => 'rw' );
has rule => ( is => 'rw' );
has configStorage => (
is => 'ro',
lazy => 1,

View File

@ -48,7 +48,8 @@ sub loadSrv {
my $cond = $self->conf->{casSrvMetaDataOptions}->{$_}
->{casSrvMetaDataOptionsResolutionRule};
if ( length $cond ) {
my $rule_sub = $self->p->buildRule( $cond, "CAS server resolution" );
my $rule_sub =
$self->p->buildRule( $cond, "CAS server resolution" );
if ($rule_sub) {
$self->srvRules->{$_} = $rule_sub;
}

View File

@ -125,7 +125,7 @@ sub getUser {
$self->validateLdap;
return PE_LDAPCONNECTFAILED unless $self->ldap;
return PE_LDAPERROR unless $self->bind();
return PE_LDAPERROR unless $self->bind();
my $mesg = $self->ldap->search(
base => $self->conf->{ldapBase},

View File

@ -21,9 +21,10 @@ sub sregHook {
# Refuse federation if rejected by user
if ( $req->param('confirm') and $req->param('confirm') == -1 ) {
my %h;
$h{$_} = undef foreach (
$h{$_} = undef
foreach (
qw(fullname nickname language postcode timezone country gender email dob)
);
);
$self->p->updatePersistentSession( $req, \%h );
return 0;
}

View File

@ -29,7 +29,7 @@ use constant PROFILE => [
qw/name family_name given_name middle_name nickname preferred_username
profile picture website gender birthdate zoneinfo locale updated_at/
];
use constant EMAIL => [qw/email email_verified/];
use constant EMAIL => [qw/email email_verified/];
use constant ADDRESS =>
[qw/formatted street_address locality region postal_code country/];
use constant PHONE => [qw/phone_number phone_number_verified/];

View File

@ -16,7 +16,7 @@ our $VERSION = '2.0.14';
has cookieName => ( is => 'rw' );
has sessionService => ( is => 'rw' );
has urn => (
has urn => (
is => 'rw',
lazy => 1,
default => sub {

View File

@ -95,7 +95,7 @@ sub validateCredential {
my $attestation_object_b64 = $credential->{response}->{attestationObject};
my $requested_uv =
$registration_options->{authenticatorSelection}->{userVerification} || "";
my $challenge_b64 = $registration_options->{challenge};
my $challenge_b64 = $registration_options->{challenge};
my $token_binding_id_b64 = encode_base64url(
$req->headers->header('Sec-Provided-Token-Binding-ID') );

View File

@ -7,7 +7,7 @@ use Exporter 'import';
our $VERSION = '2.0.14';
use constant HANDLER => 'Lemonldap::NG::Handler::PSGI::Main';
use constant URIRE =>
use constant URIRE =>
qr{(((?^:https?))://((?:(?:(?:(?:(?:[a-zA-Z0-9][-a-zA-Z0-9]*)?[a-zA-Z0-9])[.])*(?:[a-zA-Z][-a-zA-Z0-9]*[a-zA-Z0-9]|[a-zA-Z])[.]?)|(?:[0-9]+[.][0-9]+[.][0-9]+[.][0-9]+)))(?::((?:[0-9]*)))?(/(((?:(?:(?:(?:[a-zA-Z0-9\-_.!~*'():\@&=+\$,]+|(?:%[a-fA-F0-9][a-fA-F0-9]))*)(?:;(?:(?:[a-zA-Z0-9\-_.!~*'():\@&=+\$,]+|(?:%[a-fA-F0-9][a-fA-F0-9]))*))*)(?:/(?:(?:(?:[a-zA-Z0-9\-_.!~*'():\@&=+\$,]+|(?:%[a-fA-F0-9][a-fA-F0-9]))*)(?:;(?:(?:[a-zA-Z0-9\-_.!~*'():\@&=+\$,]+|(?:%[a-fA-F0-9][a-fA-F0-9]))*))*))*))(?:[?]((?:(?:[;/?:\@&=+\$,a-zA-Z0-9\-_.!~*'()]+|(?:%[a-fA-F0-9][a-fA-F0-9]))*)))?))?)};
use constant {
PE_IDPCHOICE => -5,

View File

@ -429,7 +429,7 @@ sub display {
%templateParams = ( %templateParams, TOKEN => $req->token, );
}
# DEPRECATED: This is only used for compatibility with existing templates
# DEPRECATED: This is only used for compatibility with existing templates
if ( $req->captcha ) {
%templateParams = (
%templateParams,

View File

@ -634,7 +634,8 @@ sub buildRule {
my $compiledRule =
$self->HANDLER->buildSub( $self->HANDLER->substitute($rule) );
unless ($compiledRule) {
my $error = $self->HANDLER->tsv->{jail}->error || 'Unable to compile rule';
my $error =
$self->HANDLER->tsv->{jail}->error || 'Unable to compile rule';
$self->logger->error( "Bad" . $ruleDesc . "rule: " . $error );
}
return $compiledRule,;

View File

@ -29,7 +29,7 @@ our $VERSION = '2.0.12';
has type => ( is => 'rw' );
has path => ( is => 'rw' );
has ipath => ( is => 'rw' );
has _ott => (
has _ott => (
is => 'rw',
lazy => 1,
default => sub {

View File

@ -149,7 +149,8 @@ sub canUpdateSfa {
if (
$req->userData->{
"$self->{conf}->{contextSwitchingPrefix}_session_id"}
&& !$self->conf->{contextSwitchingAllowed2fModifications} )
&& !$self->conf->{contextSwitchingAllowed2fModifications}
)
{
$self->userLogger->warn(
"ContextSwitching in progress! $user is not allowed to update 2FA."

View File

@ -76,8 +76,9 @@ has lockTime => ( is => 'rw' );
#
# Captcha HTML code to display in forms
has captchaHtml => ( is => 'rw' );
# DEPRECATED: 2.0 captcha compatibility
has captcha => ( is => 'rw' );
has captcha => ( is => 'rw' );
# Token
has token => ( is => 'rw' );

View File

@ -129,7 +129,8 @@ sub authenticated {
'controlUrl',
@{ $self->forAuthUser },
sub {
$req->response($self->sendJSONresponse( $req, { status => 1 } ));
$req->response(
$self->sendJSONresponse( $req, { status => 1 } ) );
return PE_SENDRESPONSE;
}
]
@ -1145,11 +1146,12 @@ sub _sumUpSession {
$withoutUser
? {}
: { user => $session->{ $self->conf->{whatToTrace} } };
$res->{$_} = $session->{$_} foreach (
$res->{$_} = $session->{$_}
foreach (
"_utime", "ipAddr",
keys %{ $self->conf->{sessionDataToRemember} },
keys %{ $self->pluginSessionDataToRemember }
);
);
return $res;
}

View File

@ -31,10 +31,10 @@ has ott => (
}
);
has prefix => ( is => 'rw' );
has logo => ( is => 'rw', default => '2f.png' );
has label => ( is => 'rw' );
has noRoute => ( is => 'ro' );
has prefix => ( is => 'rw' );
has logo => ( is => 'rw', default => '2f.png' );
has label => ( is => 'rw' );
has noRoute => ( is => 'ro' );
has authnLevel => (
is => 'rw',
lazy => 1,
@ -166,16 +166,19 @@ sub _verify {
authenticationLevel => $l,
groups => $req->sessionInfo->{groups},
hGroups => $req->sessionInfo->{hGroups},
_2f => $self->prefix,
_2f => $self->prefix,
%macros
}
);
} else {
}
else {
# Only update _2f session key
$self->p->updateSession($req,
$self->p->updateSession(
$req,
{
_2f => $self->prefix,
});
_2f => $self->prefix,
}
);
}
$req->authResult(PE_SENDRESPONSE);

View File

@ -65,7 +65,6 @@ sub modifyPassword {
0, $requireOldPassword );
return $code unless ( $code == PE_PASSWORD_OK );
# If password policy and force reset, set reset flag
if ( $self->conf->{ldapPpolicyControl}
and $req->data->{forceReset}

View File

@ -65,10 +65,10 @@ sub display {
# Display form
my $params = {
DOWNLOAD => $self->conf->{checkDevOpsDownload},
MSG => 'checkDevOps',
ALERTE => 'alert-info',
TOKEN => (
DOWNLOAD => $self->conf->{checkDevOpsDownload},
MSG => 'checkDevOps',
ALERTE => 'alert-info',
TOKEN => (
$self->ottRule->( $req, {} )
? $self->ott->createToken()
: ''
@ -106,10 +106,10 @@ sub parse {
# Prepare form
my $params = {
DOWNLOAD => $self->conf->{checkDevOpsDownload},
MSG => "PE$msg",
ALERTE => 'alert-warning',
TOKEN => $token
DOWNLOAD => $self->conf->{checkDevOpsDownload},
MSG => "PE$msg",
ALERTE => 'alert-warning',
TOKEN => $token
};
return $self->p->sendJSONresponse( $req, $params )
if ( $req->wantJSON && $msg );
@ -296,15 +296,15 @@ sub parse {
# Prepare form
my $params = {
DOWNLOAD => $self->conf->{checkDevOpsDownload},
MSG => $msg,
UNKNOWN => join( $self->conf->{multiValuesSeparator}, @$unknown ),
ALERTE => $alert,
FILE => $json,
HEADERS => $headers,
RULES => $rules,
URL => $url,
TOKEN => (
DOWNLOAD => $self->conf->{checkDevOpsDownload},
MSG => $msg,
UNKNOWN => join( $self->conf->{multiValuesSeparator}, @$unknown ),
ALERTE => $alert,
FILE => $json,
HEADERS => $headers,
RULES => $rules,
URL => $url,
TOKEN => (
$self->ottRule->( $req, {} )
? $self->ott->createToken()
: ''

View File

@ -206,10 +206,10 @@ sub check {
}
my $params = {
MSG => "PE$msg",
ALERTE => 'alert-warning',
LOGIN => '',
TOKEN => $token,
MSG => "PE$msg",
ALERTE => 'alert-warning',
LOGIN => '',
TOKEN => $token,
};
return $self->p->sendJSONresponse( $req, $params )
if $req->wantJSON && $msg;
@ -233,10 +233,10 @@ sub check {
$req,
'checkuser',
params => {
MSG => 'PE' . PE_MALFORMEDUSER,
ALERTE => 'alert-warning',
LOGIN => '',
TOKEN => (
MSG => 'PE' . PE_MALFORMEDUSER,
ALERTE => 'alert-warning',
LOGIN => '',
TOKEN => (
$self->ottRule->( $req, {} )
? $self->ott->createToken()
: ''

View File

@ -17,7 +17,7 @@ extends qw(
# INITIALIZATION
has rule => ( is => 'rw', default => sub { 0 } );
has ott => (
has ott => (
is => 'rw',
lazy => 1,
default => sub {
@ -53,9 +53,9 @@ sub display {
# Display form
my $params = {
MSG => 'decryptCipheredValue',
ALERTE => 'alert-warning',
TOKEN => (
MSG => 'decryptCipheredValue',
ALERTE => 'alert-warning',
TOKEN => (
$self->ottRule->( $req, {} )
? $self->ott->createToken()
: ''
@ -96,9 +96,9 @@ sub run {
}
my $params = {
MSG => "PE$msg",
ALERTE => 'alert-warning',
TOKEN => $token,
MSG => "PE$msg",
ALERTE => 'alert-warning',
TOKEN => $token,
};
return $self->p->sendJSONresponse( $req, $params )
if $req->wantJSON;

View File

@ -24,7 +24,7 @@ use constant beforeLogout => 'run';
# INITIALIZATION
has rule => ( is => 'rw', default => sub { 0 } );
has ott => (
has ott => (
is => 'rw',
lazy => 1,
default => sub {

View File

@ -614,9 +614,8 @@ sub display {
? ( CUSTOM_SCRIPT => $req->data->{customScript} )
: ()
),
MAIL => (
$self->p->checkXSSAttack( 'mail', $req->{user} )
? ''
MAIL => (
$self->p->checkXSSAttack( 'mail', $req->{user} ) ? ''
: $req->{user}
),
DISPLAY_FORM => 0,

View File

@ -11,7 +11,7 @@ our $VERSION = '2.0.14';
has locationAttribute => ( is => 'rw' );
has locationDisplayAttribute => ( is => 'rw' );
has locationMaxValues => ( is => 'rw' );
has mailSessionKey => (
has mailSessionKey => (
is => 'rw',
lazy => 1,
default => sub {

View File

@ -114,7 +114,7 @@ has exportedAttr => (
}
}
);
has ott => (
has ott => (
is => 'rw',
lazy => 1,
default => sub {

View File

@ -26,7 +26,7 @@ extends qw(
Lemonldap::NG::Common::Conf::AccessLib
);
has server => ( is => 'rw' );
has server => ( is => 'rw' );
has configStorage => (
is => 'ro',
lazy => 1,

View File

@ -23,7 +23,7 @@ use constant endAuth => 'run';
has singleIPRule => ( is => 'rw' );
has singleSessionRule => ( is => 'rw' );
has singleUserByIPRule => ( is => 'rw' );
has ott => (
has ott => (
is => 'rw',
lazy => 1,
default => sub {

View File

@ -21,7 +21,7 @@ use constant beforeLogout => 'logout';
# INITIALIZATION
has rule => ( is => 'rw', default => sub { 0 } );
has ott => (
has ott => (
is => 'rw',
lazy => 1,
default => sub {

View File

@ -37,7 +37,8 @@ ok( $res->[2]->[0] =~ /<span trmsg="37">/, 'Rejected with PE_BADURL' )
or print STDERR Dumper( $res->[2]->[0] );
ok( $res->[2]->[0] =~ m%<span id="languages"></span>%, ' Language icons found' )
or print STDERR Dumper( $res->[2]->[0] );
ok( $res->[2]->[0] =~ m%link href="/static/common/llng.ico%, ' Custom favicon found' )
ok( $res->[2]->[0] =~ m%link href="/static/common/llng.ico%,
' Custom favicon found' )
or print STDERR Dumper( $res->[2]->[0] );
count(4);

View File

@ -55,14 +55,14 @@ ok(
) or print STDERR Dumper( $res->[2]->[0] );
ok(
$res->[2]->[0] =~
m%<i id="toggle_confirmpassword" class="fa fa-eye-slash toggle-password">%,
m%<i id="toggle_confirmpassword" class="fa fa-eye-slash toggle-password">%,
' toggle confirmpassword icon found'
) or print STDERR Dumper( $res->[2]->[0] );
ok(
$res->[2]->[0] =~
$res->[2]->[0] =~
m%<input id="newpassword" name="newpassword" type="text" class="form-control"%,
' input type text found'
) or print STDERR Dumper( $res->[2]->[0] );
' input type text found'
) or print STDERR Dumper( $res->[2]->[0] );
count(5);
$client->logout($id);

View File

@ -327,11 +327,9 @@ ok(
m%\Q<span trspan="passwordPolicySpecialChar">Allowed special characters:</span> [ } \E%,
' passwordPolicySpecialChar'
) or print STDERR Dumper( $res->[2]->[0], 'passwordPolicySpecialChar' );
ok(
$res->[2]->[0] !~
m%class="fa fa-eye-slash toggle-password">%,
' no toggle icon found'
) or print STDERR Dumper( $res->[2]->[0] );
ok( $res->[2]->[0] !~ m%class="fa fa-eye-slash toggle-password">%,
' no toggle icon found' )
or print STDERR Dumper( $res->[2]->[0] );
count(8);
# Test $client->logout

View File

@ -17,7 +17,7 @@ my $client = LLNG::Manager::Test->new( {
}
);
ok( $res = $client->_get('/', accept => 'text/html'), 'Auth query' );
ok( $res = $client->_get( '/', accept => 'text/html' ), 'Auth query' );
ok( $res->[2]->[0] =~ m%"scrollTop":100%, 'scrollTop param found' )
or print STDERR Dumper( $res->[2]->[0] );
ok( $res->[2]->[0] =~ m%id="btn-back-to-top"%, 'scrollTop button found' )

View File

@ -116,7 +116,7 @@ sub issuer {
oidcOPMetaDataOptions => {
op => {
oidcOPMetaDataOptionsClientSecret => "rpsecret",
oidcOPMetaDataOptionsClientSecret => "rpsecret",
oidcOPMetaDataOptionsResolutionRule =>
'$_choice eq "OIDC1"',
},

View File

@ -301,8 +301,8 @@ count(1);
my $u = URI->new;
$u->query($query);
is( $u->query_param('my_param'), "my value",
"oidcGenerateAuthenticationRequest called" );
is( $u->query_param('my_param'),
"my value", "oidcGenerateAuthenticationRequest called" );
count(1);
# Test if consent was saved
@ -365,7 +365,7 @@ sub op {
oidcRPMetaDataOptionsBypassConsent => 0,
oidcRPMetaDataOptionsClientSecret => "rpsecret",
oidcRPMetaDataOptionsUserIDAttr => "",
oidcRPMetaDataOptionsAccessTokenExpiration => 3600,
oidcRPMetaDataOptionsAccessTokenExpiration => 3600,
oidcRPMetaDataOptionsPostLogoutRedirectUris =>
"http://auth.rp.com/?logout=1",
oidcRPMetaDataOptionsRule => '$uid eq "french"',

View File

@ -23,7 +23,8 @@ sub runTest {
my $idpId = login( $op, 'french' );
# Inital first name
$Lemonldap::NG::Portal::UserDB::Demo::demoAccounts{french}->{cn} = 'Frédéric Accents';
$Lemonldap::NG::Portal::UserDB::Demo::demoAccounts{french}->{cn} =
'Frédéric Accents';
my $code = authorize(
$op, $idpId,
@ -107,7 +108,8 @@ sub runTest {
Time::Fake->offset("+10d");
# Change attribute value
$Lemonldap::NG::Portal::UserDB::Demo::demoAccounts{french}->{cn} = 'Frédéric Freedom';
$Lemonldap::NG::Portal::UserDB::Demo::demoAccounts{french}->{cn} =
'Frédéric Freedom';
$json = expectJSON( refreshGrant( $op, 'rpid', $refresh_token ) );
@ -146,8 +148,8 @@ sub runTest {
$json = expectJSON( getUserinfo( $op, $access_token ) );
is( $json->{name}, "Frédéric Freedom", "Correct user info" );
is( $json->{'sub'}, "customfrench", 'Got User Info' );
is( $json->{name}, "Frédéric Freedom", "Correct user info" );
is( $json->{'sub'}, "customfrench", 'Got User Info' );
## Test introspection of refreshed token #2171
$json = expectJSON( introspect( $op, 'rpid', $access_token ) );

View File

@ -102,12 +102,12 @@ SKIP: {
or print STDERR Dumper( $res->[2]->[0] );
ok(
$res->[2]->[0] =~
m%<i id="toggle_newpassword" class="fa fa-eye-slash toggle-password">%,
m%<i id="toggle_newpassword" class="fa fa-eye-slash toggle-password">%,
' toggle newpassword icon found'
) or print STDERR Dumper( $res->[2]->[0] );
ok(
$res->[2]->[0] =~
m%<i id="toggle_confirmpassword" class="fa fa-eye-slash toggle-password">%,
m%<i id="toggle_confirmpassword" class="fa fa-eye-slash toggle-password">%,
' toggle confirmpassword icon found'
) or print STDERR Dumper( $res->[2]->[0] );
ok(

View File

@ -124,7 +124,10 @@ m#<img class="renewcaptchaclick" src="/static/common/icons/arrow_refresh.png"#,
);
ok( mail() =~ /<span>Your new password is<\/span>/, 'New password sent' );
ok( mail() =~ /<b>(.+?)<\/b>/s, 'New generated password found' );
ok( $1 =~ /[A-Z]{1}[a-z]{1}\d{2}[*#@]{1}/, 'New generated password matches' );
ok(
$1 =~ /[A-Z]{1}[a-z]{1}\d{2}[*#@]{1}/,
'New generated password matches'
);
#print STDERR Dumper($query);
}

View File

@ -186,12 +186,15 @@ ok( $res->[2]->[0] =~ m%<td scope="row">Macro_1</td>%, 'Found uid' )
ok( $nbr = ( $res->[2]->[0] =~ s%<td scope="row">Macro_1</td>%%g ),
'Found two well computed macros' )
or explain( $res->[2]->[0], 'Macros not well computed' );
ok( $res->[2]->[0] =~ m%<div class="card-text text-left ml-2">authGroup</div>%,
'Found group "authGroup"' )
or explain( $res->[2]->[0], 'Group "authgroup"' );
ok( $res->[2]->[0] =~ m%<div class="card-text text-left ml-2">realAuthGroup</div>%,
'Found group "realAuthGroup"' )
or explain( $res->[2]->[0], 'Found group "realAuthGroup"' );
ok(
$res->[2]->[0] =~ m%<div class="card-text text-left ml-2">authGroup</div>%,
'Found group "authGroup"'
) or explain( $res->[2]->[0], 'Group "authgroup"' );
ok(
$res->[2]->[0] =~
m%<div class="card-text text-left ml-2">realAuthGroup</div>%,
'Found group "realAuthGroup"'
) or explain( $res->[2]->[0], 'Found group "realAuthGroup"' );
count(7);
ok(

View File

@ -226,7 +226,8 @@ m%<div class="alert alert-success"><div class="text-center"><b><span trspan="all
or explain( $res->[2]->[0], 'Header Key: Auth-User' );
ok( $res->[2]->[0] =~ m%: dwho<br/>%, 'Found dwho' )
or explain( $res->[2]->[0], 'Header Value: dwho' );
ok( $res->[2]->[0] =~ m%<div class="card-text text-left ml-2">su</div>%, 'Found su' )
ok( $res->[2]->[0] =~ m%<div class="card-text text-left ml-2">su</div>%,
'Found su' )
or explain( $res->[2]->[0], 'SSO Groups: su' );
ok( $res->[2]->[0] =~ m%<td scope="row">uid</td>%, 'Found uid' )
or explain( $res->[2]->[0], 'Attribute Value uid' );

View File

@ -127,13 +127,17 @@ ok( $res->[2]->[0] =~ m%Auth-User: %, 'Found Auth-User' )
or explain( $res->[2]->[0], 'Header Key: Auth-User' );
ok( $res->[2]->[0] =~ m%: dwho<br/>%, 'Found dwho' )
or explain( $res->[2]->[0], 'Header Value: dwho' );
ok( $res->[2]->[0] =~ m%<div class="card-text text-left ml-2">su</div>%, 'Found su' )
ok( $res->[2]->[0] =~ m%<div class="card-text text-left ml-2">su</div>%,
'Found su' )
or explain( $res->[2]->[0], 'SSO Groups: su' );
ok( $res->[2]->[0] =~ m%<div class="card-text text-left ml-2">su_test</div>%, 'Found su_test' )
ok( $res->[2]->[0] =~ m%<div class="card-text text-left ml-2">su_test</div>%,
'Found su_test' )
or explain( $res->[2]->[0], 'SSO Groups: su_test' );
ok( $res->[2]->[0] !~ m%<div class="card-text text-left ml-2">_test_</div>%, 'NOT found _test_' )
ok( $res->[2]->[0] !~ m%<div class="card-text text-left ml-2">_test_</div>%,
'NOT found _test_' )
or explain( $res->[2]->[0], 'SSO Groups: _test_' );
ok( $res->[2]->[0] !~ m%<div class="card-text text-left ml-2">test_su</td>%, 'NOT found test_su' )
ok( $res->[2]->[0] !~ m%<div class="card-text text-left ml-2">test_su</td>%,
'NOT found test_su' )
or explain( $res->[2]->[0], 'SSO Groups: test_su' );
ok( $res->[2]->[0] =~ m%<td scope="row">uid</td>%, 'Found uid' )
or explain( $res->[2]->[0], 'Attribute Value uid' );

View File

@ -116,7 +116,8 @@ ok( $res->[2]->[0] =~ m%<span trspan="headers">%, 'Found trspan="headers"' )
ok( $res->[2]->[0] =~ m%<span trspan="groups_sso">%,
'Found trspan="groups_sso"' )
or explain( $res->[2]->[0], 'trspan="groups_sso"' );
ok( $res->[2]->[0] =~ m%<div class="card-text text-left ml-2">su</div>%, 'Found SSO group "su"' )
ok( $res->[2]->[0] =~ m%<div class="card-text text-left ml-2">su</div>%,
'Found SSO group "su"' )
or explain( $res->[2]->[0], 'Found SSO group "su"' );
ok( $res->[2]->[0] =~ m%<div class="card-text text-left ml-2">su_test</div>%,
'Found SSO group "su_test"' )
@ -135,13 +136,17 @@ ok( $res->[2]->[0] =~ m%Auth-User: %, 'Found Auth-User' )
or explain( $res->[2]->[0], 'Header Key: Auth-User' );
ok( $res->[2]->[0] =~ m%: dwho<br/>%, 'Found dwho' )
or explain( $res->[2]->[0], 'Header Value: dwho' );
ok( $res->[2]->[0] =~ m%<div class="card-text text-left ml-2">su</div>%, 'Found su' )
ok( $res->[2]->[0] =~ m%<div class="card-text text-left ml-2">su</div>%,
'Found su' )
or explain( $res->[2]->[0], 'SSO Groups: su' );
ok( $res->[2]->[0] =~ m%<div class="card-text text-left ml-2">su_test</div>%, 'Found su_test' )
ok( $res->[2]->[0] =~ m%<div class="card-text text-left ml-2">su_test</div>%,
'Found su_test' )
or explain( $res->[2]->[0], 'SSO Groups: su_test' );
ok( $res->[2]->[0] !~ m%<div class="card-text text-left ml-2">_test_</div>%, 'NOT found _test_' )
ok( $res->[2]->[0] !~ m%<div class="card-text text-left ml-2">_test_</div>%,
'NOT found _test_' )
or explain( $res->[2]->[0], 'SSO Groups: _test_' );
ok( $res->[2]->[0] =~ m%<div class="card-text text-left ml-2">test_su</div>%, 'Found test_su' )
ok( $res->[2]->[0] =~ m%<div class="card-text text-left ml-2">test_su</div>%,
'Found test_su' )
or explain( $res->[2]->[0], 'SSO Groups: test_su' );
ok( $res->[2]->[0] =~ m%<td scope="row">_whatToTrace</td>%,
'Found _whatToTrace' )

View File

@ -29,7 +29,7 @@ SKIP: {
u2fSelfRegistration => 1,
u2fActivation => 1,
u2fAuthnLevel => 5,
restSessionServer =>1,
restSessionServer => 1,
skipUpgradeConfirmation => 1,
sfManagerRule => '$uid eq "dwho"',
portalMainLogo => 'common/logos/logo_llng_old.png',
@ -152,7 +152,7 @@ SKIP: {
'Post code'
);
$id = expectCookie($res);
expectSessionAttributes($client, $id, _2f => "totp");
expectSessionAttributes( $client, $id, _2f => "totp" );
# Get 2F register form
ok(
@ -442,7 +442,7 @@ JjTJecOOS+88fK8qL1TrYv5rapIdqUI7aQ==
'Push U2F signature'
);
$id = expectCookie($res);
expectSessionAttributes($client, $id, _2f => "u");
expectSessionAttributes( $client, $id, _2f => "u" );
ok(
$res = $client->_get(
'/2fregisters',

View File

@ -84,7 +84,7 @@ ok(
);
count(1);
my $id = expectCookie($res);
expectSessionAttributes($client, $id, _2f => "work");
expectSessionAttributes( $client, $id, _2f => "work" );
$client->logout($id);
clean_sessions();
@ -168,7 +168,7 @@ ok(
);
count(1);
$id = expectCookie($res);
expectSessionAttributes($client, $id, _2f => "home");
expectSessionAttributes( $client, $id, _2f => "home" );
# Verify Authn Level
ok( $res = $client->_get("/sessions/global/$id"), 'Get session' );

View File

@ -9,7 +9,7 @@ sub undefined {
}
sub test_uc {
return uc($_[0] . '_' . $_[1]);
return uc( $_[0] . '_' . $_[1] );
}
1;