WIP - Hidden ConfTree PK (#1661)

This commit is contained in:
Christophe Maudoux 2019-03-13 22:56:16 +01:00
parent bc40d48a14
commit bfa7482a1f
6 changed files with 44 additions and 12 deletions

View File

@ -296,6 +296,7 @@ sub defaultValues {
'useRedirectOnError' => 1,
'useSafeJail' => 1,
'utotp2fActivation' => 0,
'viewerHiddenPK' => 'virtualHosts',
'webIDAuthnLevel' => 1,
'webIDExportedVars' => {},
'whatToTrace' => 'uid',

View File

@ -3558,6 +3558,10 @@ qr/^(?:(?:(?:(?:(?:(?:[a-zA-Z0-9][-a-zA-Z0-9]*)?[a-zA-Z0-9])[.])*(?:[a-zA-Z][-a-
],
'type' => 'select'
},
'viewerHiddenPK' => {
'default' => 'virtualHosts',
'type' => 'text'
},
'virtualHosts' => {
'type' => 'virtualHostContainer'
},

View File

@ -915,6 +915,14 @@ sub attributes {
flags => 'hp',
},
# Viewer
viewerHiddenPK => {
type => 'text',
default => 'virtualHosts',
documentation => 'ConfTree hidden primary keys',
flags => 'm',
},
# Notification
oldNotifFormat => {
type => 'bool',

View File

@ -19,7 +19,7 @@ use feature 'state';
extends 'Lemonldap::NG::Common::Conf::RESTServer';
our $VERSION = '2.0.2';
our $VERSION = '2.0.3';
#############################
# I. INITIALIZATION METHODS #
@ -33,20 +33,40 @@ sub addRoutes {
my ( $self, $conf ) = @_;
$self->ua( Lemonldap::NG::Common::UserAgent->new($conf) );
my @enabledPK = ();
my @keys = qw(virtualHosts samlIDPMetaDataNodes samlSPMetaDataNodes
applicationList oidcOPMetaDataNodes oidcRPMetaDataNodes
casSrvMetaDataNodes casAppMetaDataNodes
authChoiceModules grantSessionRules combModules
openIdIDPList);
foreach (@keys) {
# Ignore hidden ConfTree Primary Keys
push @enabledPK, $_
unless ( $conf->{viewerHiddenPK} =~ /\b$_\b/ );
}
# HTML template
$self->addRoute( 'viewer.html', undef, ['GET'] )
# READ
# Special keys
# ->addRoute(
# view => {
# ':cfgNum' => [
# qw(virtualHosts samlIDPMetaDataNodes samlSPMetaDataNodes
# applicationList oidcOPMetaDataNodes oidcRPMetaDataNodes
# casSrvMetaDataNodes casAppMetaDataNodes
# authChoiceModules grantSessionRules combModules
# openIdIDPList)
# ]
# },
# ['GET']
# )
->addRoute(
view => {
':cfgNum' => [
qw(virtualHosts samlIDPMetaDataNodes samlSPMetaDataNodes
applicationList oidcOPMetaDataNodes oidcRPMetaDataNodes
casSrvMetaDataNodes casAppMetaDataNodes
authChoiceModules grantSessionRules combModules
openIdIDPList)
]
':cfgNum' => \@enabledPK
},
['GET']
)
@ -56,7 +76,7 @@ sub addRoutes {
# Difference between confs
->addRoute( diff => { ':conf1' => { ':conf2' => 'diff' } } )
->addRoute( 'diff.html', undef, ['GET'] )
->addRoute( 'diff.html', undef, ['GET'] );
}
##@method public PSGI-JSON-response prx()
@ -94,7 +114,6 @@ sub prx {
# - getConfByNum: override SUPER method to be able to use Zero
sub getConfByNum {
my ( $self, $cfgNum, @args ) = @_;
unless ( %{ $self->currentConf }

View File

@ -1,5 +1,5 @@
###
LemonLDAP::NG Manager client
LemonLDAP::NG Viewer client
This is the main app file. Other are:
- struct.json and js/confTree.js that contains the full tree

View File

@ -1,7 +1,7 @@
// Generated by CoffeeScript 1.12.7
/*
LemonLDAP::NG Manager client
LemonLDAP::NG Viewer client
This is the main app file. Other are:
- struct.json and js/confTree.js that contains the full tree