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
258
Issues
258
List
Boards
Labels
Service Desk
Milestones
Merge Requests
5
Merge Requests
5
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
d18918b0
Commit
d18918b0
authored
Dec 26, 2015
by
Yadd
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Move files that should be used only by jsongenerator.pl in Manager/Build
parent
e477e4d6
Changes
12
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
12 changed files
with
3857 additions
and
2084 deletions
+3857
-2084
Makefile
Makefile
+2
-2
lemonldap-ng-manager/MANIFEST
lemonldap-ng-manager/MANIFEST
+3
-2
lemonldap-ng-manager/TODO.md
lemonldap-ng-manager/TODO.md
+0
-12
lemonldap-ng-manager/lib/Lemonldap/NG/Manager.pm
lemonldap-ng-manager/lib/Lemonldap/NG/Manager.pm
+2
-2
lemonldap-ng-manager/lib/Lemonldap/NG/Manager/Attributes.pm
lemonldap-ng-manager/lib/Lemonldap/NG/Manager/Attributes.pm
+1635
-2039
lemonldap-ng-manager/lib/Lemonldap/NG/Manager/Build/Attributes.pm
...p-ng-manager/lib/Lemonldap/NG/Manager/Build/Attributes.pm
+2151
-0
lemonldap-ng-manager/lib/Lemonldap/NG/Manager/Build/CTrees.pm
...nldap-ng-manager/lib/Lemonldap/NG/Manager/Build/CTrees.pm
+2
-2
lemonldap-ng-manager/lib/Lemonldap/NG/Manager/Build/Tree.pm
lemonldap-ng-manager/lib/Lemonldap/NG/Manager/Build/Tree.pm
+2
-2
lemonldap-ng-manager/scripts/jsongenerator.pl
lemonldap-ng-manager/scripts/jsongenerator.pl
+47
-10
lemonldap-ng-manager/site/static/forms/README.md
lemonldap-ng-manager/site/static/forms/README.md
+2
-2
lemonldap-ng-manager/t/03-HTML-forms.t
lemonldap-ng-manager/t/03-HTML-forms.t
+6
-6
lemonldap-ng-manager/t/90-translations.t
lemonldap-ng-manager/t/90-translations.t
+5
-5
No files found.
Makefile
View file @
d18918b0
...
...
@@ -120,8 +120,8 @@ ERASECONFIG=1 # Set to 0 if you do not want to replace your configuration
# GENERATED SRC FILESlemonldap-ng-common/lib/Lemonldap/NG/Common/Conf/DefaultValues.pm
MANAGERJSONSRC
=
$(SRCMANAGERDIR)
/scripts/jsongenerator.pl
\
$(SRCMANAGERDIR)
/lib/Lemonldap/NG/Manager/Attributes.pm
\
$(SRCMANAGERDIR)
/lib/Lemonldap/NG/Manager/Tree.pm
$(SRCMANAGERDIR)
/lib/Lemonldap/NG/Manager/
Build/
Attributes.pm
\
$(SRCMANAGERDIR)
/lib/Lemonldap/NG/Manager/
Build/
Tree.pm
MANAGERJSONDST
=
$(SRCMANAGERDIR)
/site/static/struct.json
\
$(SRCMANAGERDIR)
/site/static/js/conftree.js
\
$(SRCMANAGERDIR)
/lib/Lemonldap/NG/Manager/Constants.pm
\
...
...
lemonldap-ng-manager/MANIFEST
View file @
d18918b0
...
...
@@ -7,15 +7,16 @@ eg/manager-server.psgi
KINEMATIC.md
lib/Lemonldap/NG/Manager.pm
lib/Lemonldap/NG/Manager/Attributes.pm
lib/Lemonldap/NG/Manager/Build/Attributes.pm
lib/Lemonldap/NG/Manager/Build/CTrees.pm
lib/Lemonldap/NG/Manager/Build/Tree.pm
lib/Lemonldap/NG/Manager/Conf.pm
lib/Lemonldap/NG/Manager/Conf/Tests.pm
lib/Lemonldap/NG/Manager/ConfParser.pm
lib/Lemonldap/NG/Manager/Constants.pm
lib/Lemonldap/NG/Manager/CTrees.pm
lib/Lemonldap/NG/Manager/Lib.pm
lib/Lemonldap/NG/Manager/Notifications.pm
lib/Lemonldap/NG/Manager/Sessions.pm
lib/Lemonldap/NG/Manager/Tree.pm
Makefile.PL
MANIFEST This list of files
META.yml
...
...
lemonldap-ng-manager/TODO.md
View file @
d18918b0
...
...
@@ -2,11 +2,6 @@
*
Check for eval with SAML
*
Icon picker for application logo
*
Change documentation lang when changing language
## Bugs
*
SAML IDP/SP exported attributes not working
## Configuration management
...
...
@@ -15,10 +10,8 @@
### Struct & datas
*
Tests for new confs
*
default values: TODO, deliver a "0" conf when no conf is available
*
Forms:
*
file: load from URL + download
*
Grant session rule
*
OpenID white/black list
*
POST replay fields
...
...
@@ -31,11 +24,6 @@
## Sessions explorer
## Optimization
*
Use JSON to store datas:
*
sessions: new Apache::Session::Serialize::JSON module
## Doc
*
Wiki doc
...
...
lemonldap-ng-manager/lib/Lemonldap/NG/Manager.pm
View file @
d18918b0
...
...
@@ -121,8 +121,8 @@ Lemonldap::NG Manager contains 4 parts:
=head2 Generation of static files
The `scripts/jsongenerator.pl` file uses Lemonldap::NG::Manager::Attributes,
Lemonldap::NG::Manager::
Tree and Lemonldap::NG::Manager
::CTrees to generate
The `scripts/jsongenerator.pl` file uses Lemonldap::NG::Manager::
Build::
Attributes,
Lemonldap::NG::Manager::
Build::Tree and Lemonldap::NG::Manager::Build
::CTrees to generate
=over
...
...
lemonldap-ng-manager/lib/Lemonldap/NG/Manager/Attributes.pm
View file @
d18918b0
This diff is collapsed.
Click to expand it.
lemonldap-ng-manager/lib/Lemonldap/NG/Manager/Build/Attributes.pm
0 → 100644
View file @
d18918b0
This diff is collapsed.
Click to expand it.
lemonldap-ng-manager/lib/Lemonldap/NG/Manager/CTrees.pm
→
lemonldap-ng-manager/lib/Lemonldap/NG/Manager/
Build/
CTrees.pm
View file @
d18918b0
...
...
@@ -8,11 +8,11 @@
#
# Conf parameters are just strings in the `nodes` array
#
# All other ideas have to be set in
Common/Conf
/Attributes.pm !
# All other ideas have to be set in
Manager/Build
/Attributes.pm !
# DON'T FORGET TO RUN jsongenerator.pl AFTER EACH CHANGE
package
Lemonldap::NG::Manager::
CTrees
;
package
Lemonldap::NG::Manager::
Build::
CTrees
;
sub
cTrees
{
return
{
...
...
lemonldap-ng-manager/lib/Lemonldap/NG/Manager/Tree.pm
→
lemonldap-ng-manager/lib/Lemonldap/NG/Manager/
Build/
Tree.pm
View file @
d18918b0
...
...
@@ -7,11 +7,11 @@
#
# Conf parameters are just strings in the `nodes` array
#
# All other ideas have to be set in
Common/Conf
/Attributes.pm !
# All other ideas have to be set in
Manager/Build
/Attributes.pm !
# DON'T FORGET TO RUN jsongenerator.pl AFTER EACH CHANGE
package
Lemonldap::NG::Manager::
Tree
;
package
Lemonldap::NG::Manager::
Build::
Tree
;
our
$VERSION
=
'
1.9.0
';
...
...
lemonldap-ng-manager/scripts/jsongenerator.pl
View file @
d18918b0
...
...
@@ -2,9 +2,9 @@
use
strict
;
use
Lemonldap::NG::Manager::
Attributes
;
use
Lemonldap::NG::Manager::
Tree
;
use
Lemonldap::NG::Manager::
CTrees
;
use
Lemonldap::NG::Manager::
Build::
Attributes
;
use
Lemonldap::NG::Manager::
Build::
Tree
;
use
Lemonldap::NG::Manager::
Build::
CTrees
;
#use Lemonldap::NG::Manager;
use
Data::
Dumper
;
...
...
@@ -29,6 +29,7 @@ my $confTreeFile = "site/static/js/conftree.js";
my
$managerConstants
=
"
lib/Lemonldap/NG/Manager/Constants.pm
";
my
$defaultValuesFile
=
"
../lemonldap-ng-common/lib/Lemonldap/NG/Common/Conf/DefaultValues.pm
";
my
$managerAttributesFile
=
'
lib/Lemonldap/NG/Manager/Attributes.pm
';
my
@simpleHashKeys
;
my
@sessionTypes
;
my
@cnodesKeys
;
...
...
@@ -51,7 +52,7 @@ $Data::Dumper::Sortkeys = sub {
];
};
my
$attributes
=
Lemonldap::NG::Manager::Attributes::
attributes
();
my
$attributes
=
Lemonldap::NG::Manager::
Build::
Attributes::
attributes
();
my
$jsonEnc
=
JSON
->
new
()
->
allow_nonref
;
my
$mainTree
;
my
@ignoreKeys
;
...
...
@@ -62,7 +63,7 @@ $jsonEnc->canonical(1);
# 1. confTree.js
unless
(
$opts
{
f
}
)
{
$mainTree
=
Lemonldap::NG::Manager::CTrees::
cTrees
();
$mainTree
=
Lemonldap::NG::Manager::
Build::
CTrees::
cTrees
();
my
$script
=
'
function templates(tpl,key){
'
...
...
@@ -75,7 +76,7 @@ unless ( $opts{f} ) {
.
'
switch(tpl){
';
# To build confTree.js, each special node is scanned from
# Lemonldap::NG::Manager::CTrees
# Lemonldap::NG::Manager::
Build::
CTrees
foreach
my
$node
(
sort
keys
$mainTree
)
{
@cnodesKeys
=
();
my
$jsonTree
=
[]
;
...
...
@@ -111,7 +112,7 @@ unless ( $opts{f} ) {
}
# 2. struct.json
$mainTree
=
Lemonldap::NG::Manager::Tree::
tree
();
$mainTree
=
Lemonldap::NG::Manager::
Build::
Tree::
tree
();
my
$jsonTree
=
[]
;
&scanTree
(
$mainTree
,
$jsonTree
,
'',
''
);
my
$script
=
'
function setScopeVars(scope){
';
...
...
@@ -144,7 +145,7 @@ use strict;
use Exporter 'import';
use base qw(Exporter);
our \$VERSION = '$Lemonldap::NG::Manager::Attributes::VERSION';
our \$VERSION = '$Lemonldap::NG::Manager::
Build::
Attributes::VERSION';
our %EXPORT_TAGS = ( 'all' => [qw($exportedVars)] );
our \@EXPORT_OK = ( \@{ \$EXPORT_TAGS{'all'} } );
...
...
@@ -183,11 +184,35 @@ my $defaultValues = {
}
keys
(
%$attributes
)
};
my
$defaultAttr
=
Dumper
(
$defaultValues
);
my
$managerAttr
=
{
map
{
my
@r
;
foreach
my
$f
(
qw(keyTest type test msgFail default)
)
{
push
@r
,
$f
,
$attributes
->
{
$_
}
->
{
$f
}
if
(
defined
$attributes
->
{
$_
}
->
{
$f
}
);
}
(
$_
=>
{
@r
}
);
}
keys
(
%$attributes
)
};
$managerAttr
=
Dumper
(
$managerAttr
);
$managerAttr
=~
s/^\$VAR1\s*=/sub attributes {\n return/
;
my
$managerTypes
=
Dumper
(
Lemonldap::NG::Manager::Build::Attributes::
types
());
$managerTypes
=~
s/^\$VAR1\s*=/sub types {\n return/
;
$managerAttr
=
"
# This file is generated by $0. Don't modify it by hand
package Lemonldap::NG::Manager::Attributes;
our
\$
VERSION = '
$Lemonldap
::NG::Manager::Build::Attributes::VERSION';
$managerTypes
}
$managerAttr
}
";
$defaultAttr
=~
s/^\$VAR1\s*=/sub defaultValues {\n return/
;
$defaultAttr
=
"
# This file is generated by $0. Don't modify it by hand
package Lemonldap::NG::Common::Conf::DefaultValues;
our
\$
VERSION = '
$Lemonldap
::NG::Manager::Attributes::VERSION';
our
\$
VERSION = '
$Lemonldap
::NG::Manager::
Build::
Attributes::VERSION';
$defaultAttr
}
...
...
@@ -198,6 +223,17 @@ my $dst;
eval
{
require
Perl::
Tidy
;
Perl::Tidy::
perltidy
(
source
=>
IO::
String
->
new
(
$managerAttr
),
destination
=>
\
$dst
);
};
$dst
=
$managerAttr
if
(
$@
);
open
(
F
,
"
>
$managerAttributesFile
"
)
or
die
(
$!
);
print
F
$dst
;
close
F
;
eval
{
Perl::Tidy::
perltidy
(
source
=>
IO::
String
->
new
(
$defaultAttr
),
destination
=>
\
$dst
...
...
@@ -273,7 +309,8 @@ sub scanTree {
if
(
$leaf
=~
s/^\*//
)
{
push
@angularScopeVars
,
[
$leaf
,
"
$path
._nodes[
$ord
]
"
];
}
push
@sessionTypes
,
$
1
if
(
$leaf
=~
/^(.*)(?<!notification)StorageOptions$/
);
push
@sessionTypes
,
$
1
if
(
$leaf
=~
/^(.*)(?<!notification)StorageOptions$/
);
my
$attr
=
$attributes
->
{
$leaf
}
or
die
("
Missing attribute
$leaf
");
$jleaf
=
{
id
=>
"
$prefix$leaf
",
title
=>
$leaf
};
unless
(
$attr
->
{
type
}
)
{
...
...
lemonldap-ng-manager/site/static/forms/README.md
View file @
d18918b0
...
...
@@ -3,10 +3,10 @@
This files contains the form used to expose configuration attributes. The form
is chosen by looking at the
*type*
property of the current data.
This property is defined in
`Lemonldap::NG::Manager::Attributes`
package.
This property is defined in
`Lemonldap::NG::Manager::
Build::
Attributes`
package.
By default, it is set to
*text*
.
`Lemonldap::NG::Manager::Attributes`
is compiled into JSON/JS files by
`Lemonldap::NG::Manager::
Build::
Attributes`
is compiled into JSON/JS files by
`jsongenerator.pl`
script.
## 1. Form file architecture
...
...
lemonldap-ng-manager/t/03-HTML-forms.t
View file @
d18918b0
...
...
@@ -7,9 +7,9 @@ use 5.10.0;
my
$formDir
=
'
site/static/forms
';
my
$count
=
0
;
use_ok
('
Lemonldap::NG::Manager::Tree
');
use_ok
('
Lemonldap::NG::Manager::CTrees
');
use_ok
('
Lemonldap::NG::Manager::Attributes
');
use_ok
('
Lemonldap::NG::Manager::
Build::
Tree
');
use_ok
('
Lemonldap::NG::Manager::
Build::
CTrees
');
use_ok
('
Lemonldap::NG::Manager::
Build::
Attributes
');
$count
+=
3
;
ok
(
opendir
(
D
,
$formDir
),
'
Found forms dir
'
);
...
...
@@ -20,9 +20,9 @@ delete $forms{white};
delete
$forms
{
restore
};
my
(
@types
,
$attr
,
$tree
,
$ctrees
);
ok
(
$tree
=
Lemonldap::NG::Manager::Tree::
tree
(),
'
Get tree
'
);
ok
(
$ctrees
=
Lemonldap::NG::Manager::CTrees::
cTrees
(),
'
Get cTrees
'
);
ok
(
$attr
=
Lemonldap::NG::Manager::Attributes::
attributes
(),
ok
(
$tree
=
Lemonldap::NG::Manager::
Build::
Tree::
tree
(),
'
Get tree
'
);
ok
(
$ctrees
=
Lemonldap::NG::Manager::
Build::
CTrees::
cTrees
(),
'
Get cTrees
'
);
ok
(
$attr
=
Lemonldap::NG::Manager::
Build::
Attributes::
attributes
(),
'
Get attributes
'
);
$count
+=
4
;
...
...
lemonldap-ng-manager/t/90-translations.t
View file @
d18918b0
...
...
@@ -8,9 +8,9 @@ use 5.10.0;
my
$langDir
=
'
site/static/languages
';
my
$count
=
0
;
use_ok
('
Lemonldap::NG::Manager::Tree
');
use_ok
('
Lemonldap::NG::Manager::CTrees
');
use_ok
('
Lemonldap::NG::Manager::Attributes
');
use_ok
('
Lemonldap::NG::Manager::
Build::
Tree
');
use_ok
('
Lemonldap::NG::Manager::
Build::
CTrees
');
use_ok
('
Lemonldap::NG::Manager::
Build::
Attributes
');
$count
+=
3
;
ok
(
opendir
(
D
,
$langDir
),
'
Found languages dir
'
);
...
...
@@ -60,7 +60,7 @@ foreach my $lang (@langs) {
}
my
$tree
;
ok
(
$tree
=
Lemonldap::NG::Manager::Tree::
tree
(),
'
Get tree
'
);
ok
(
$tree
=
Lemonldap::NG::Manager::
Build::
Tree::
tree
(),
'
Get tree
'
);
my
@nodes
=
@
{
getNodes
(
$tree
)
};
my
@unTr
;
...
...
@@ -75,7 +75,7 @@ $count += 2;
my
(
$type
,
$ctrees
);
@unTr
=
();
ok
(
$ctrees
=
Lemonldap::NG::Manager::CTrees::
cTrees
(),
'
Get cTrees
'
);
ok
(
$ctrees
=
Lemonldap::NG::Manager::
Build::
CTrees::
cTrees
(),
'
Get cTrees
'
);
while
(
(
$type
,
$tree
)
=
each
%$ctrees
)
{
@nodes
=
@
{
getNodes
(
$tree
)
};
foreach
(
@nodes
)
{
...
...
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