Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
lemonldap-ng
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
257
Issues
257
List
Boards
Labels
Service Desk
Milestones
Merge Requests
4
Merge Requests
4
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Operations
Operations
Incidents
Environments
Packages & Registries
Packages & Registries
Container Registry
Analytics
Analytics
CI / CD
Repository
Value Stream
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
LemonLDAP NG
lemonldap-ng
Commits
286af2cf
Commit
286af2cf
authored
Nov 21, 2020
by
Christophe Maudoux
🐛
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'v2.0' into code-refactoring-v2
parents
92854c2f
0a4fabb4
Pipeline
#10047
passed with stage
in 19 minutes and 37 seconds
Changes
5
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
37 additions
and
39 deletions
+37
-39
lemonldap-ng-common/lib/Lemonldap/NG/Common/Safelib.pm
lemonldap-ng-common/lib/Lemonldap/NG/Common/Safelib.pm
+13
-20
lemonldap-ng-manager/lib/Lemonldap/NG/Manager/2ndFA.pm
lemonldap-ng-manager/lib/Lemonldap/NG/Manager/2ndFA.pm
+6
-4
lemonldap-ng-manager/lib/Lemonldap/NG/Manager/Api/Common.pm
lemonldap-ng-manager/lib/Lemonldap/NG/Manager/Api/Common.pm
+4
-3
lemonldap-ng-manager/lib/Lemonldap/NG/Manager/Conf/Tests.pm
lemonldap-ng-manager/lib/Lemonldap/NG/Manager/Conf/Tests.pm
+4
-4
lemonldap-ng-portal/lib/Lemonldap/NG/Portal/Main/Init.pm
lemonldap-ng-portal/lib/Lemonldap/NG/Portal/Main/Init.pm
+10
-8
No files found.
lemonldap-ng-common/lib/Lemonldap/NG/Common/Safelib.pm
View file @
286af2cf
...
@@ -13,7 +13,7 @@ use JSON::XS;
...
@@ -13,7 +13,7 @@ use JSON::XS;
#use AutoLoader qw(AUTOLOAD);
#use AutoLoader qw(AUTOLOAD);
our
$VERSION
=
'
2.0.
7
';
our
$VERSION
=
'
2.0.
10
';
# Set here all the names of functions that must be available in Safe objects.
# Set here all the names of functions that must be available in Safe objects.
# Not that only functions, not methods, can be written here
# Not that only functions, not methods, can be written here
...
@@ -65,8 +65,8 @@ sub checkLogonHours {
...
@@ -65,8 +65,8 @@ sub checkLogonHours {
# Use time_correction
# Use time_correction
if
(
$time_correction
)
{
if
(
$time_correction
)
{
my
(
$sign
,
$time
)
=
(
$time_correction
=~
/([+|-]?)(\d+)/
);
my
(
$sign
,
$time
)
=
(
$time_correction
=~
/([+|-]?)(\d+)/
);
if
(
$sign
=~
/-/
)
{
$hourpos
-=
$time
;
}
if
(
$sign
=~
/-/
)
{
$hourpos
-=
$time
;
}
else
{
$hourpos
+=
$time
;
}
else
{
$hourpos
+=
$time
;
}
}
}
# Get the corresponding byte
# Get the corresponding byte
...
@@ -229,29 +229,22 @@ my $json = JSON::XS->new;
...
@@ -229,29 +229,22 @@ my $json = JSON::XS->new;
sub
has2f
{
sub
has2f
{
my
(
$session
,
$type
)
=
@_
;
my
(
$session
,
$type
)
=
@_
;
unless
(
$session
->
{
_2fDevices
}
)
{
return
0
unless
(
$session
->
{
_2fDevices
}
);
return
0
;
}
my
$
_2fDevices
=
eval
{
$json
->
decode
(
$session
->
{
_2fDevices
}
);
};
my
$
_2fDevices
;
return
0
if
(
$@
or
ref
(
$
_2fDevices
)
ne
"
ARRAY
"
);
eval
{
$
_2fDevices
=
$json
->
decode
(
$session
->
{
_2fDevices
}
);
};
if
(
$@
or
ref
(
$
_2fDevices
)
ne
"
ARRAY
"
)
{
my
$length
=
scalar
@
{
$
_2fDevices
};
return
0
;
}
# Empty array
# Empty array
if
(
length
@
{
$
_2fDevices
}
==
0
)
{
return
0
unless
$length
;
return
0
;
# Array has one value and we did not specify a type, succeed
# Array has one value and we did not specify a type, succeed
}
if
(
$type
)
{
elsif
(
not
$type
)
{
return
1
;
}
else
{
my
@found
=
grep
{
lc
(
$_
->
{
type
}
)
eq
lc
(
$type
)
}
@
{
$
_2fDevices
};
my
@found
=
grep
{
lc
(
$_
->
{
type
}
)
eq
lc
(
$type
)
}
@
{
$
_2fDevices
};
return
(
@found
?
1
:
0
);
return
(
@found
?
1
:
0
);
}
}
return
0
;
return
1
;
}
}
1
;
1
;
lemonldap-ng-manager/lib/Lemonldap/NG/Manager/2ndFA.pm
View file @
286af2cf
...
@@ -11,11 +11,13 @@ use Lemonldap::NG::Common::Conf::ReConstants;
...
@@ -11,11 +11,13 @@ use Lemonldap::NG::Common::Conf::ReConstants;
#use feature 'state';
#use feature 'state';
extends
'
Lemonldap::NG::Manager::Plugin
',
extends
qw(
'
Lemonldap::NG::Common::Conf::AccessLib
',
Lemonldap::NG::Manager::Plugin
'
Lemonldap::NG::Common::Session::REST
';
Lemonldap::NG::Common::Session::REST
Lemonldap::NG::Common::Conf::AccessLib
)
;
our
$VERSION
=
'
2.0.
9
';
our
$VERSION
=
'
2.0.
10
';
#############################
#############################
# I. INITIALIZATION METHODS #
# I. INITIALIZATION METHODS #
...
...
lemonldap-ng-manager/lib/Lemonldap/NG/Manager/Api/Common.pm
View file @
286af2cf
package
Lemonldap::NG::Manager::Api::
Common
;
package
Lemonldap::NG::Manager::Api::
Common
;
our
$VERSION
=
'
2.0.
9
';
our
$VERSION
=
'
2.0.
10
';
package
Lemonldap::NG::Manager::
Api
;
package
Lemonldap::NG::Manager::
Api
;
use
strict
;
use
Lemonldap::NG::Manager::Build::
Attributes
;
use
Lemonldap::NG::Manager::Build::
Attributes
;
use
Lemonldap::NG::Manager::Build::
CTrees
;
use
Lemonldap::NG::Manager::Build::
CTrees
;
...
@@ -26,7 +27,7 @@ sub _getDefaultValues {
...
@@ -26,7 +27,7 @@ sub _getDefaultValues {
my
$defaultAttrs
=
Lemonldap::NG::Manager::Build::Attributes::
attributes
();
my
$defaultAttrs
=
Lemonldap::NG::Manager::Build::Attributes::
attributes
();
my
$attrs
=
{};
my
$attrs
=
{};
foreach
$attr
(
@allAttrs
)
{
foreach
my
$attr
(
@allAttrs
)
{
$attrs
->
{
$attr
}
=
$defaultAttrs
->
{
$attr
}
->
{
default
}
$attrs
->
{
$attr
}
=
$defaultAttrs
->
{
$attr
}
->
{
default
}
if
(
defined
$defaultAttrs
->
{
$attr
}
if
(
defined
$defaultAttrs
->
{
$attr
}
&&
defined
$defaultAttrs
->
{
$attr
}
->
{
default
}
);
&&
defined
$defaultAttrs
->
{
$attr
}
->
{
default
}
);
...
@@ -39,7 +40,7 @@ sub _hasAllowedAttributes {
...
@@ -39,7 +40,7 @@ sub _hasAllowedAttributes {
my
(
$self
,
$attributes
,
$rootNode
)
=
@_
;
my
(
$self
,
$attributes
,
$rootNode
)
=
@_
;
my
@allowedAttributes
=
$self
->
_listAttributes
(
$rootNode
);
my
@allowedAttributes
=
$self
->
_listAttributes
(
$rootNode
);
foreach
$attribute
(
keys
%
{
$attributes
}
)
{
foreach
my
$attribute
(
keys
%
{
$attributes
}
)
{
if
(
length
(
ref
(
$attribute
)
)
)
{
if
(
length
(
ref
(
$attribute
)
)
)
{
return
{
return
{
res
=>
"
ko
",
res
=>
"
ko
",
...
...
lemonldap-ng-manager/lib/Lemonldap/NG/Manager/Conf/Tests.pm
View file @
286af2cf
package
Lemonldap::NG::Manager::Conf::
Tests
;
package
Lemonldap::NG::Manager::Conf::
Tests
;
use
strict
;
use
utf8
;
use
utf8
;
use
strict
;
use
strict
;
use
Lemonldap::NG::Common::
Regexp
;
use
Lemonldap::NG::Common::
Regexp
;
...
@@ -450,7 +451,7 @@ sub tests {
...
@@ -450,7 +451,7 @@ sub tests {
"
RSA_SHA1
"
)
"
RSA_SHA1
"
)
{
{
undef
$allsha1
;
undef
$allsha1
;
break
;
last
;
}
}
}
}
}
}
...
@@ -462,7 +463,7 @@ sub tests {
...
@@ -462,7 +463,7 @@ sub tests {
->
{
samlSPMetaDataOptionsSignatureMethod
}
ne
"
RSA_SHA1
"
)
->
{
samlSPMetaDataOptionsSignatureMethod
}
ne
"
RSA_SHA1
"
)
{
{
undef
$allsha1
;
undef
$allsha1
;
break
;
last
;
}
}
}
}
}
}
...
@@ -866,8 +867,7 @@ sub tests {
...
@@ -866,8 +867,7 @@ sub tests {
$appUrl
=~
m#^(https?://[^/]+)(/.*)?$#
;
$appUrl
=~
m#^(https?://[^/]+)(/.*)?$#
;
my
$appHost
=
$
1
;
my
$appHost
=
$
1
;
unless
(
$appHost
)
{
unless
(
$appHost
)
{
push
@msg
,
push
@msg
,
"
$casConfKey
CAS Application has no Service URL
";
"
$clientConfKey
CAS Application has no Service URL
";
$res
=
0
;
$res
=
0
;
next
;
next
;
}
}
...
...
lemonldap-ng-portal/lib/Lemonldap/NG/Portal/Main/Init.pm
View file @
286af2cf
...
@@ -8,7 +8,7 @@
...
@@ -8,7 +8,7 @@
# of lemonldap-ng.ini) and underlying handler configuration
# of lemonldap-ng.ini) and underlying handler configuration
package
Lemonldap::NG::Portal::Main::
Init
;
package
Lemonldap::NG::Portal::Main::
Init
;
our
$VERSION
=
'
2.0.
9
';
our
$VERSION
=
'
2.0.
10
';
package
Lemonldap::NG::Portal::
Main
;
package
Lemonldap::NG::Portal::
Main
;
...
@@ -161,24 +161,24 @@ sub setPortalRoutes {
...
@@ -161,24 +161,24 @@ sub setPortalRoutes {
# psgi.js
# psgi.js
->
addUnauthRoute
(
'
psgi.js
'
=>
'
sendJs
',
['
GET
']
)
->
addUnauthRoute
(
'
psgi.js
'
=>
'
sendJs
',
['
GET
']
)
->
addAuthRoute
(
'
psgi.js
'
=>
'
sendJs
',
['
GET
']
)
->
addAuthRoute
(
'
psgi.js
'
=>
'
sendJs
',
['
GET
']
)
# portal.css
# portal.css
->
addUnauthRoute
(
'
portal.css
'
=>
'
sendCss
',
['
GET
']
)
->
addUnauthRoute
(
'
portal.css
'
=>
'
sendCss
',
['
GET
']
)
->
addAuthRoute
(
'
portal.css
'
=>
'
sendCss
',
['
GET
']
)
->
addAuthRoute
(
'
portal.css
'
=>
'
sendCss
',
['
GET
']
)
# lmerror
# lmerror
->
addUnauthRoute
(
lmerror
=>
{
'
:code
'
=>
'
lmError
'
},
['
GET
']
)
->
addUnauthRoute
(
lmerror
=>
{
'
:code
'
=>
'
lmError
'
},
['
GET
']
)
->
addAuthRoute
(
lmerror
=>
{
'
:code
'
=>
'
lmError
'
},
['
GET
']
)
->
addAuthRoute
(
lmerror
=>
{
'
:code
'
=>
'
lmError
'
},
['
GET
']
)
# Core REST API
# Core REST API
->
addUnauthRoute
(
ping
=>
'
pleaseAuth
',
['
GET
']
)
->
addUnauthRoute
(
ping
=>
'
pleaseAuth
',
['
GET
']
)
->
addAuthRoute
(
ping
=>
'
authenticated
',
['
GET
']
)
->
addAuthRoute
(
ping
=>
'
authenticated
',
['
GET
']
)
# Refresh session
# Refresh session
->
addAuthRoute
(
refresh
=>
'
refresh
',
['
GET
']
)
->
addAuthRoute
(
refresh
=>
'
refresh
',
['
GET
']
)
->
addAuthRoute
(
'
*
'
=>
'
corsPreflight
',
['
OPTIONS
']
)
->
addAuthRoute
(
'
*
'
=>
'
corsPreflight
',
['
OPTIONS
']
)
->
addUnauthRoute
(
'
*
'
=>
'
corsPreflight
',
['
OPTIONS
']
)
->
addUnauthRoute
(
'
*
'
=>
'
corsPreflight
',
['
OPTIONS
']
)
# Logout
# Logout
...
@@ -239,9 +239,11 @@ sub reloadConf {
...
@@ -239,9 +239,11 @@ sub reloadConf {
# Initialize templateDir
# Initialize templateDir
$self
->
{
templateDir
}
=
$self
->
{
templateDir
}
=
$self
->
conf
->
{
templateDir
}
.
'
/
'
.
$self
->
conf
->
{
portalSkin
};
$self
->
conf
->
{
templateDir
}
.
'
/
'
.
$self
->
conf
->
{
portalSkin
}
if
(
$self
->
conf
->
{
templateDir
}
and
$self
->
conf
->
{
portalSkin
}
);
unless
(
-
d
$self
->
{
templateDir
}
)
{
unless
(
-
d
$self
->
{
templateDir
}
)
{
$self
->
error
("
Template dir
$self
->{templateDir} doesn't exist
");
$self
->
error
("
Template dir
$self
->{templateDir} doesn't exist
")
if
ref
(
$self
->
{
templateDir
}
)
eq
'
SCALAR
';
return
$self
->
fail
;
return
$self
->
fail
;
}
}
$self
->
templateDir
(
$self
->
templateDir
(
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment