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
246
Issues
246
List
Boards
Labels
Service Desk
Milestones
Merge Requests
2
Merge Requests
2
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
a0ea56a2
Commit
a0ea56a2
authored
Jan 08, 2017
by
Xavier Guimard
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
SOAP/REST in progress (
#970
)
parent
d1646392
Changes
6
Hide whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
25 additions
and
73 deletions
+25
-73
lemonldap-ng-common/lib/Lemonldap/NG/Common/Session/REST.pm
lemonldap-ng-common/lib/Lemonldap/NG/Common/Session/REST.pm
+22
-2
lemonldap-ng-manager/lib/Lemonldap/NG/Manager/Sessions.pm
lemonldap-ng-manager/lib/Lemonldap/NG/Manager/Sessions.pm
+3
-16
lemonldap-ng-manager/t/jsonfiles/01-base-tree.json
lemonldap-ng-manager/t/jsonfiles/01-base-tree.json
+0
-13
lemonldap-ng-manager/t/jsonfiles/02-base-tree-all-nodes-opened.json
...ng-manager/t/jsonfiles/02-base-tree-all-nodes-opened.json
+0
-14
lemonldap-ng-manager/t/jsonfiles/12-modified.json
lemonldap-ng-manager/t/jsonfiles/12-modified.json
+0
-14
lemonldap-ng-manager/t/jsonfiles/14-bad.json
lemonldap-ng-manager/t/jsonfiles/14-bad.json
+0
-14
No files found.
lemonldap-ng-common/lib/Lemonldap/NG/Common/Session/REST.pm
View file @
a0ea56a2
...
...
@@ -2,6 +2,26 @@ package Lemonldap::NG::Common::Session::REST;
use
strict
;
use
Mouse
;
use
Lemonldap::NG::Common::Conf::
Constants
;
has
sessionTypes
=>
(
is
=>
'
rw
'
);
sub
setTypes
{
my
(
$self
,
$conf
)
=
@_
;
foreach
my
$type
(
@sessionTypes
)
{
if
(
my
$tmp
=
$self
->
{
$type
.
'
Storage
'
}
||
$conf
->
{
$type
.
'
Storage
'
}
)
{
$self
->
{
sessionTypes
}
->
{
$type
}
->
{
module
}
=
$tmp
;
$self
->
{
sessionTypes
}
->
{
$type
}
->
{
options
}
=
$self
->
{
$type
.
'
StorageOptions
'
}
||
$conf
->
{
$type
.
'
StorageOptions
'
}
||
{};
$self
->
{
sessionTypes
}
->
{
$type
}
->
{
kind
}
=
(
$type
eq
'
global
'
?
'
SSO
'
:
ucfirst
(
$type
)
);
}
}
}
sub
separator
{
$_
[
0
]
->
{
multiValuesSeparator
}
||
$_
[
0
]
->
conf
->
{
multiValuesSeparator
};
...
...
@@ -30,7 +50,7 @@ sub delSession {
sub
session
{
my
(
$self
,
$req
,
$id
,
$skey
)
=
@_
;
my
(
%h
,
$res
);
return
$self
->
sendError
(
$req
,
'
Bad request
',
400
)
unless
(
$id
);
return
$self
->
sendError
(
$req
,
'
Bad request
',
400
)
unless
(
$id
);
my
$mod
=
$self
->
getMod
(
$req
)
or
return
$self
->
sendError
(
$req
,
undef
,
400
);
...
...
@@ -85,7 +105,7 @@ sub getMod {
$self
->
error
('
Session type is required
');
return
();
}
unless
(
$m
=
$self
->
conf
->
{
$s
}
)
{
unless
(
$m
=
$self
->
sessionTypes
->
{
$s
}
)
{
$self
->
error
('
Unknown (or unconfigured) session type
');
return
();
}
...
...
lemonldap-ng-manager/lib/Lemonldap/NG/Manager/Sessions.pm
View file @
a0ea56a2
...
...
@@ -13,9 +13,8 @@ use Lemonldap::NG::Manager::Constants;
use
feature
'
state
';
extends
'
Lemonldap::NG::Common::Conf::AccessLib
',
'
Lemonldap::NG::Common::Session::REST
';
has
conf
=>
(
is
=>
'
rw
',
isa
=>
'
HashRef
',
default
=>
sub
{
{}
}
);
extends
'
Lemonldap::NG::Common::Conf::AccessLib
',
'
Lemonldap::NG::Common::Session::REST
';
our
$VERSION
=
'
2.0.0
';
...
...
@@ -50,19 +49,7 @@ sub addRoutes {
#
# Return unless configuration is available
return
0
unless
(
$conf
);
foreach
my
$type
(
@sessionTypes
)
{
if
(
my
$tmp
=
$self
->
{
$type
.
'
Storage
'
}
||
$conf
->
{
$type
.
'
Storage
'
}
)
{
$self
->
{
conf
}
->
{
$type
}
->
{
module
}
=
$tmp
;
$self
->
{
conf
}
->
{
$type
}
->
{
options
}
=
$self
->
{
$type
.
'
StorageOptions
'
}
||
$conf
->
{
$type
.
'
StorageOptions
'
}
||
{};
$self
->
{
conf
}
->
{
$type
}
->
{
kind
}
=
(
$type
eq
'
global
'
?
'
SSO
'
:
ucfirst
(
$type
)
);
}
}
$self
->
setTypes
(
$conf
);
$self
->
{
ipField
}
||=
'
ipAddr
';
$self
->
{
multiValuesSeparator
}
||=
'
;
';
...
...
lemonldap-ng-manager/t/jsonfiles/01-base-tree.json
View file @
a0ea56a2
...
...
@@ -1268,19 +1268,6 @@
"_nodes"
:
[{
"id"
:
"customFunctions"
,
"title"
:
"customFunctions"
},
{
"_nodes"
:
[{
"default"
:
0
,
"id"
:
"Soap"
,
"title"
:
"Soap"
,
"type"
:
"bool"
},
{
"id"
:
"exportedAttr"
,
"title"
:
"exportedAttr"
}],
"id"
:
"soap"
,
"title"
:
"soap"
,
"type"
:
"simpleInputContainer"
},
{
"_nodes"
:
[{
"default"
:
1
,
...
...
lemonldap-ng-manager/t/jsonfiles/02-base-tree-all-nodes-opened.json
View file @
a0ea56a2
...
...
@@ -1444,20 +1444,6 @@
"nodes"
:
[{
"id"
:
"customFunctions"
,
"title"
:
"customFunctions"
},
{
"id"
:
"soap"
,
"title"
:
"soap"
,
"type"
:
"simpleInputContainer"
,
"nodes"
:
[{
"default"
:
0
,
"id"
:
"Soap"
,
"title"
:
"Soap"
,
"type"
:
"bool"
,
"data"
:
0
},
{
"id"
:
"exportedAttr"
,
"title"
:
"exportedAttr"
}]
},
{
"id"
:
"loginHistory"
,
"title"
:
"loginHistory"
,
...
...
lemonldap-ng-manager/t/jsonfiles/12-modified.json
View file @
a0ea56a2
...
...
@@ -1455,20 +1455,6 @@
"nodes"
:
[{
"id"
:
"customFunctions"
,
"title"
:
"customFunctions"
},
{
"id"
:
"soap"
,
"title"
:
"soap"
,
"type"
:
"simpleInputContainer"
,
"nodes"
:
[{
"default"
:
0
,
"id"
:
"Soap"
,
"title"
:
"Soap"
,
"type"
:
"bool"
,
"data"
:
0
},
{
"id"
:
"exportedAttr"
,
"title"
:
"exportedAttr"
}]
},
{
"id"
:
"loginHistory"
,
"title"
:
"loginHistory"
,
...
...
lemonldap-ng-manager/t/jsonfiles/14-bad.json
View file @
a0ea56a2
...
...
@@ -1444,20 +1444,6 @@
"nodes"
:
[{
"id"
:
"customFunctions"
,
"title"
:
"customFunctions"
},
{
"id"
:
"soap"
,
"title"
:
"soap"
,
"type"
:
"simpleInputContainer"
,
"nodes"
:
[{
"default"
:
0
,
"id"
:
"Soap"
,
"title"
:
"Soap"
,
"type"
:
"bool"
,
"data"
:
0
},
{
"id"
:
"exportedAttr"
,
"title"
:
"exportedAttr"
}]
},
{
"id"
:
"loginHistory"
,
"title"
:
"loginHistory"
,
...
...
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