diff --git a/lemonldap-ng-common/lib/Lemonldap/NG/Common/Conf/Constants.pm b/lemonldap-ng-common/lib/Lemonldap/NG/Common/Conf/Constants.pm index 8bafc6629..a3fa051a1 100644 --- a/lemonldap-ng-common/lib/Lemonldap/NG/Common/Conf/Constants.pm +++ b/lemonldap-ng-common/lib/Lemonldap/NG/Common/Conf/Constants.pm @@ -23,7 +23,7 @@ use constant HANDLERSECTION => "handler"; use constant MANAGERSECTION => "manager"; use constant SESSIONSEXPLORERSECTION => "sessionsExplorer"; use constant APPLYSECTION => "apply"; -our $hashParameters = qr/^(?:(?:l(?:o(?:ca(?:lSessionStorageOption|tionRule)|goutService)|dapExportedVar|wpSslOpt)|(?:(?:d(?:emo|bi)|facebook|webID)ExportedVa|exported(?:Heade|Va))r|g(?:r(?:antSessionRule|oup)|lobalStorageOption)|n(?:otificationStorageOption|ginxCustomHandler)|re(?:moteGlobalStorageOption|loadUrl)|CAS_proxiedService|macro)s|o(?:idc(?:RPMetaData(?:(?:Option(?:sExtraClaim)?|ExportedVar)s|Node)|OPMetaData(?:(?:ExportedVar|Option)s|J(?:SON|WKS)|Node)|S(?:erviceMetaDataAuthnContext|torageOptions))|penIdExportedVars)|s(?:aml(?:S(?:PMetaData(?:(?:ExportedAttribute|Option)s|Node|XML)|torageOptions)|IDPMetaData(?:(?:ExportedAttribute|Option)s|Node|XML))|essionDataToRemember|laveExportedVars)|c(?:as(?:StorageOption|Attribute)s|omb(?:Modules|Over))|p(?:ersistentStorageOptions|o(?:rtalSkinRules|st))|a(?:uthChoiceModules|pplicationList)|v(?:hostOptions|irtualHost))$/; +our $hashParameters = qr/^(?:(?:l(?:o(?:ca(?:lSessionStorageOption|tionRule)|goutService)|dapExportedVar|wpSslOpt)|(?:(?:d(?:emo|bi)|facebook|webID)ExportedVa|exported(?:Heade|Va))r|g(?:r(?:antSessionRule|oup)|lobalStorageOption)|n(?:otificationStorageOption|ginxCustomHandler)|c(?:as(?:StorageOption|Attribute)|ombModule)|re(?:moteGlobalStorageOption|loadUrl)|CAS_proxiedService|macro)s|o(?:idc(?:RPMetaData(?:(?:Option(?:sExtraClaim)?|ExportedVar)s|Node)|OPMetaData(?:(?:ExportedVar|Option)s|J(?:SON|WKS)|Node)|S(?:erviceMetaDataAuthnContext|torageOptions))|penIdExportedVars)|s(?:aml(?:S(?:PMetaData(?:(?:ExportedAttribute|Option)s|Node|XML)|torageOptions)|IDPMetaData(?:(?:ExportedAttribute|Option)s|Node|XML))|essionDataToRemember|laveExportedVars)|p(?:ersistentStorageOptions|o(?:rtalSkinRules|st))|a(?:uthChoiceModules|pplicationList)|v(?:hostOptions|irtualHost))$/; our @sessionTypes = ( 'remoteGlobal', 'cas', 'global', 'localSession', 'persistent', 'saml', 'oidc' ); diff --git a/lemonldap-ng-common/lib/Lemonldap/NG/Common/Conf/ReConstants.pm b/lemonldap-ng-common/lib/Lemonldap/NG/Common/Conf/ReConstants.pm index b8c5a4631..f3c5b3341 100644 --- a/lemonldap-ng-common/lib/Lemonldap/NG/Common/Conf/ReConstants.pm +++ b/lemonldap-ng-common/lib/Lemonldap/NG/Common/Conf/ReConstants.pm @@ -20,7 +20,7 @@ our $specialNodeHash = { }; our $doubleHashKeys = 'issuerDBGetParameters'; -our $simpleHashKeys = '(?:(?:l(?:o(?:calSessionStorageOption|goutService)|dapExportedVar|wpSslOpt)|(?:(?:d(?:emo|bi)|facebook|webID)E|e)xportedVar|g(?:r(?:antSessionRule|oup)|lobalStorageOption)|n(?:otificationStorageOption|ginxCustomHandler)|p(?:ersistentStorageOption|ortalSkinRule)|re(?:moteGlobalStorageOption|loadUrl)|CAS_proxiedService|macro)s|o(?:idcS(?:erviceMetaDataAuthnContext|torageOptions)|penIdExportedVars)|s(?:(?:amlStorageOption|laveExportedVar)s|essionDataToRemember)|c(?:as(?:StorageOption|Attribute)s|omb(?:Modules|Over))|a(?:uthChoiceModules|pplicationList))'; +our $simpleHashKeys = '(?:(?:l(?:o(?:calSessionStorageOption|goutService)|dapExportedVar|wpSslOpt)|(?:(?:d(?:emo|bi)|facebook|webID)E|e)xportedVar|g(?:r(?:antSessionRule|oup)|lobalStorageOption)|n(?:otificationStorageOption|ginxCustomHandler)|c(?:as(?:StorageOption|Attribute)|ombModule)|p(?:ersistentStorageOption|ortalSkinRule)|re(?:moteGlobalStorageOption|loadUrl)|CAS_proxiedService|macro)s|o(?:idcS(?:erviceMetaDataAuthnContext|torageOptions)|penIdExportedVars)|s(?:(?:amlStorageOption|laveExportedVar)s|essionDataToRemember)|a(?:uthChoiceModules|pplicationList))'; our $specialNodeKeys = '(?:(?:saml(?:ID|S)|oidc[OR])PMetaDataNode|virtualHost)s'; our $oidcOPMetaDataNodeKeys = 'oidcOPMetaData(?:Options(?:C(?:lient(?:Secret|ID)|heckJWTSignature|onfigurationURI)|TokenEndpointAuthMethod|(?:JWKSTimeou|Promp)t|I(?:DTokenMaxAge|con)|S(?:toreIDToken|cope)|U(?:iLocales|seNonce)|Display(?:Name)?|AcrValues|MaxAge)|ExportedVars|J(?:SON|WKS))'; our $oidcRPMetaDataNodeKeys = 'oidcRPMetaData(?:Options(?:I(?:DToken(?:Expiration|SignAlg)|con)|(?:RedirectUri|ExtraClaim)s|AccessTokenExpiration|Client(?:Secret|ID)|BypassConsent|DisplayName|UserIDAttr)|ExportedVars)'; @@ -33,7 +33,7 @@ our $authParameters = { apacheParams => [qw(apacheAuthnLevel)], casParams => [qw(CAS_authnLevel CAS_url CAS_CAFile CAS_renew CAS_gateway CAS_pgtFile CAS_proxiedServices)], choiceParams => [qw(authChoiceParam authChoiceModules)], - combinationParams => [qw(combination combModules combOver)], + combinationParams => [qw(combination combModules)], dbiParams => [qw(dbiAuthnLevel dbiExportedVars dbiAuthChain dbiAuthUser dbiAuthPassword dbiUserChain dbiUserUser dbiUserPassword dbiAuthTable dbiUserTable dbiAuthLoginCol dbiAuthPasswordCol dbiPasswordMailCol userPivot dbiAuthPasswordHash)], demoParams => [qw(demoExportedVars)], facebookParams => [qw(facebookAuthnLevel facebookExportedVars facebookAppId facebookAppSecret)], diff --git a/lemonldap-ng-manager/lib/Lemonldap/NG/Manager/Attributes.pm b/lemonldap-ng-manager/lib/Lemonldap/NG/Manager/Attributes.pm index 5dc92c091..67d10dfb1 100644 --- a/lemonldap-ng-manager/lib/Lemonldap/NG/Manager/Attributes.pm +++ b/lemonldap-ng-manager/lib/Lemonldap/NG/Manager/Attributes.pm @@ -658,10 +658,11 @@ qr/(?:(?:https?):\/\/(?:(?:(?:(?:(?:(?:[a-zA-Z0-9][-a-zA-Z0-9]*)?[a-zA-Z0-9])[.] 'type' => 'text' }, 'combModules' => { - 'type' => 'keyTextContainer' - }, - 'combOver' => { - 'type' => 'keyTextContainer' + 'keyTest' => qr/^\w+$/, + 'test' => sub { + 1; + }, + 'type' => 'cmbModuleContainer' }, 'confirmFormMethod' => { 'default' => 'post', diff --git a/lemonldap-ng-manager/lib/Lemonldap/NG/Manager/Build/Attributes.pm b/lemonldap-ng-manager/lib/Lemonldap/NG/Manager/Build/Attributes.pm index 597e8e349..bcd1f037a 100644 --- a/lemonldap-ng-manager/lib/Lemonldap/NG/Manager/Build/Attributes.pm +++ b/lemonldap-ng-manager/lib/Lemonldap/NG/Manager/Build/Attributes.pm @@ -2270,14 +2270,13 @@ m{^(?:ldapi://[^/]*/?|\w[\w\-\.]*(?::\d{1,5})?|ldap(?:s|\+tls)?://\w[\w\-\.]*(?: # Combination combination => { type => 'text', + documentation => 'Combination rule' }, combModules => { - type => 'keyTextContainer', - }, - combOver => { - - #TODO: create new type - type => 'keyTextContainer', + type => 'cmbModuleContainer', + keyTest => qr/^\w+$/, + test => sub {1}, + documentation => 'Combination module description' }, # Yubikey diff --git a/lemonldap-ng-manager/lib/Lemonldap/NG/Manager/Build/Tree.pm b/lemonldap-ng-manager/lib/Lemonldap/NG/Manager/Build/Tree.pm index 440906515..c5623036f 100644 --- a/lemonldap-ng-manager/lib/Lemonldap/NG/Manager/Build/Tree.pm +++ b/lemonldap-ng-manager/lib/Lemonldap/NG/Manager/Build/Tree.pm @@ -253,7 +253,7 @@ sub tree { title => 'combinationParams', help => 'authcombination.html', nodes => - [ 'combination', 'combModules', 'combOver' ] + [ 'combination', 'combModules' ] }, { title => 'nullParams', diff --git a/lemonldap-ng-manager/site/coffee/manager.coffee b/lemonldap-ng-manager/site/coffee/manager.coffee index 83c8938b1..ccba5902c 100644 --- a/lemonldap-ng-manager/site/coffee/manager.coffee +++ b/lemonldap-ng-manager/site/coffee/manager.coffee @@ -298,6 +298,21 @@ llapp.controller 'TreeCtrl', [ logo: "network.png" display: "auto" + # Combination module + $scope.newCmbMod = -> + node = $scope._findContainer() + node.nodes.push + id: "#{node.id}/n#{id++}" + title: 'new' + type: 'cmbModule' + data: + type: 'LDAP' + for: 0 + over: {} + + $scope.newCmbOver = -> + $scope.currentNode.data.over.set "new#{id++}", '' + # Add host $scope.addHost = (cn,scope) -> cn.data=[] unless cn.data diff --git a/lemonldap-ng-manager/site/static/forms/cmbModule.html b/lemonldap-ng-manager/site/static/forms/cmbModule.html new file mode 100644 index 000000000..3a48cf482 --- /dev/null +++ b/lemonldap-ng-manager/site/static/forms/cmbModule.html @@ -0,0 +1,57 @@ +
+
+

{{currentNode.title}}

+
+ + + + + + + + + + + + + + + +
+
+ + + + + +
+ + + + + + +
+ + + + + + +
+
+ diff --git a/lemonldap-ng-manager/site/static/forms/cmbModuleContainer.html b/lemonldap-ng-manager/site/static/forms/cmbModuleContainer.html new file mode 100644 index 000000000..9b262b46f --- /dev/null +++ b/lemonldap-ng-manager/site/static/forms/cmbModuleContainer.html @@ -0,0 +1,44 @@ +
+
+

{{translateTitle(currentNode)}}

+
+ + + + + + + + + + + + + + + + +
+
+ + + + + + + + +
+
+ diff --git a/lemonldap-ng-manager/site/static/js/manager.js b/lemonldap-ng-manager/site/static/js/manager.js index 650599906..e97f83e9e 100644 --- a/lemonldap-ng-manager/site/static/js/manager.js +++ b/lemonldap-ng-manager/site/static/js/manager.js @@ -348,6 +348,23 @@ This file contains: } }); }; + $scope.newCmbMod = function() { + var node; + node = $scope._findContainer(); + return node.nodes.push({ + id: node.id + "/n" + (id++), + title: 'new', + type: 'cmbModule', + data: { + type: 'LDAP', + "for": 0, + over: {} + } + }); + }; + $scope.newCmbOver = function() { + return $scope.currentNode.data.over.set("new" + (id++), ''); + }; $scope.addHost = function(cn, scope) { if (!cn.data) { cn.data = []; @@ -850,9 +867,7 @@ This file contains: $scope.showModal('message.html'); } $scope.form = 'home'; - console.log('OK', $scope.waiting); - $scope.waiting = false; - console.log('OK', $scope.waiting); + return $scope.waiting = false; }, readError); }; c = $location.path().match(new RegExp('^/confs/(latest|[0-9]+)')); diff --git a/lemonldap-ng-manager/site/static/js/manager.min.js b/lemonldap-ng-manager/site/static/js/manager.min.js index fe1db9f3d..adacdf7fe 100644 --- a/lemonldap-ng-manager/site/static/js/manager.min.js +++ b/lemonldap-ng-manager/site/static/js/manager.min.js @@ -1 +1 @@ -(function(){var a;a=angular.module("llngManager",["ui.tree","ui.bootstrap","llApp","ngCookies"]);a.controller("TreeCtrl",["$scope","$http","$location","$q","$uibModal","$translator","$cookies","$htmlParams",function(q,m,i,j,f,e,g,r){var h,d,p,o,l,b,k,s,n;q.links=window.links;q.menu=r.menu;q.menulinks=window.menulinks;q.staticPrefix=window.staticPrefix;q.formPrefix=window.formPrefix;q.availableLanguages=window.availableLanguages;q.waiting=true;q.showM=false;q.showT=false;q.form="home";q.currentCfg={};q.confPrefix=window.confPrefix;q.message={};q.result="";q.translateTitle=function(c){return e.translateField(c,"title")};q.translateP=e.translateP;q.translate=e.translate;q.helpUrl="start.html#configuration";q.setShowHelp=function(t){var c;if(t==null){t=!q.showH}q.showH=t;c=new Date(Date.now());c.setFullYear(c.getFullYear()+1);return g.put("showhelp",(t?"true":"false"),{expires:c})};q.showH=g.get("showhelp")==="false"?false:true;if(q.showH==null){q.setShowHelp(true)}s=function(c){var u,t;u=c.status;t=c.statusLine;q.waiting=false;if(u===403){q.message={title:"forbidden",message:"",items:[]}}else{if(u===401){console.log("Authentication needed");q.message={title:"authenticationNeeded",message:"__waitOrF5__",items:[]}}else{if(u===400){q.message={title:"badRequest",message:t,items:[]}}else{if(u>0){q.message={title:"badRequest",message:t,items:[]}}else{q.message={title:"networkProblem",message:"",items:[]}}}}}return q.showModal("message.html")};q.showModal=function(t,v){var u,c;c=f.open({templateUrl:t,controller:"ModalInstanceCtrl",size:"lg",resolve:{elem:function(){return function(w){return q[w]}},set:function(){return function(x,w){return q[x]=w}},init:function(){return v}}});u=j.defer();c.result.then(function(w){q.message={title:"",message:"",items:[]};return u.resolve(w)},function(w){q.message={title:"",message:"",items:[]};return u.reject(w)});return u.promise};q.menuClick=function(c){if(c.popup){window.open(c.popup)}else{if(!c.action){c.action=c.title}switch(typeof c.action){case"function":c.action(q.currentNode,q);break;case"string":q[c.action]();break;default:console.log(typeof c.action)}}return q.showM=false};q.home=function(){q.form="home";return q.showM=false};h=function(t){var c;q.message={title:"",message:"",items:[]};if(t.message==="__needConfirmation__"){q.confirmNeeded=true}if(t.message){q.message.message=t.message}if(t.details){for(c in t.details){if(c!=="__changes__"){q.message.items.push({message:c,items:t.details[c]})}}}q.waiting=false;if(t.result===1){i.path("/confs/");q.message.title="successfullySaved"}else{q.message.title="saveReport"}return q.showModal("message.html")};q.downlaodConf=function(u,t){return window.open(t.confPrefix+t.currentCfg.cfgNum+"?full")};q.save=function(){q.showModal("save.html").then(function(){q.waiting=true;q.data.push({id:"cfgLog",title:"cfgLog",data:q.result?q.result:""});return m.post(window.confPrefix+"?cfgNum="+q.currentCfg.cfgNum+(q.forceSave?"&force=1":""),q.data).then(function(c){q.data.pop();return h(c.data)},function(c){s(c);return q.data.pop()})},function(){return console.log("Saving canceled")});return q.showM=false};q.saveRawConf=function(c){q.waiting=true;return m.post(window.confPrefix+"/raw",c).then(function(t){return h(t.data)},s)};q.restore=function(){q.currentNode=null;return q.form="restore"};q.cancel=function(){q.currentNode.data=null;return q.getKey(q.currentNode)};b=1;q._findContainer=function(){return q._findScopeContainer().$modelValue};q._findScopeContainer=function(){var c;c=q.currentScope;while(!c.$modelValue.type.match(/Container$/)){c=c.$parentNodeScope}return c};q._findScopeByKey=function(c){var t;t=q.currentScope;while(!(t.$modelValue.title===c)){t=t.$parentNodeScope}return t};q.newGrantRule=function(){var c,u,t;t=q._findContainer();c=t.nodes.length;u=c>0?c-1:0;return t.nodes.splice(u,0,{id:t.id+"/n"+(b++),title:"New rule",re:"1",comment:"New rule",data:"Message",type:"grant"})};q.newRule=function(){var c,u,t;t=q._findContainer();c=t.nodes.length;u=c>0?c-1:0;return t.nodes.splice(u,0,{id:t.id+"/n"+(b++),title:"New rule",re:"^/new",comment:"New rule",data:"accept",type:"rule"})};q.newPost=function(){var c;c=q._findContainer();return c.nodes.push({id:c.id+"/n"+(b++),title:"/absolute/path/to/form",data:{},type:"post"})};q.newPostVar=function(){if(q.currentNode.data.vars==null){q.currentNode.data.vars=[]}return q.currentNode.data.vars.push(["var1","$uid"])};q.newAuthChoice=function(){var c;c=q._findContainer();c.nodes.push({id:c.id+"/n"+(b++),title:"1_Key",data:["Null","Null","Null"],type:"authChoice"});return q.execFilters(q._findScopeByKey("authParams"))};q.newHashEntry=function(){var c;c=q._findContainer();return c.nodes.push({id:c.id+"/n"+(b++),title:"new",data:"",type:"keyText"})};q.newCat=function(){var c;c=q.currentScope;if(c.$modelValue.type==="menuApp"){c=c.$parentNodeScope}return c.$modelValue.nodes.push({id:c.$modelValue.id+"/n"+(b++),title:"New category",type:"menuCat",nodes:[]})};q.newApp=function(){var c;c=q.currentScope;if(c.$modelValue.type==="menuApp"){c=c.$parentNodeScope}return c.$modelValue.nodes.push({id:c.$modelValue.id+"/n"+(b++),title:"New application",type:"menuApp",data:{description:"New app description",uri:"https://test.example.com/",logo:"network.png",display:"auto"}})};q.addHost=function(t,c){if(!t.data){t.data=[]}return t.data.push({k:"newHost",h:[{k:"key",v:"uid"}]})};q.addSamlAttribute=function(){var c;c=q._findContainer();return c.nodes.push({id:c.id+"/n"+(b++),title:"new",type:"samlAttribute",data:[0,"New","",""]})};q.addVhost=function(){var c;c=q.domain?"."+q.domain.data:".example.com";q.message={title:"virtualHostName",field:"hostname"};return q.showModal("prompt.html",c).then(function(){var u,t;u=q.result;if(u){t=q.addTemplateNode(u,"virtualHost");delete t.nodes[0].cnodes;return t.nodes[0].nodes=[{id:"virtualHosts/new__"+u+"/locationRules/default",type:"rule",title:"default",comment:"",re:"default",data:"deny"}]}})};q.duplicateVhost=function(){var c;c=q.domain?"."+q.domain.data:".example.com";q.message={title:"virtualHostName",field:"hostname"};return q.showModal("prompt.html",c).then(function(){var t;t=q.result;return q.duplicateNode(t,"virtualHost",q.currentNode.title)})};q.addSamlIDP=function(){return q.newTemplateNode("samlIDPMetaDataNode","samlPartnerName","idp-example")};q.addSamlSP=function(){return q.newTemplateNode("samlSPMetaDataNode","samlPartnerName","sp-example")};q.addOidcOp=function(){return q.newTemplateNode("oidcOPMetaDataNode","oidcOPName","op-example")};q.addOidcRp=function(){return q.newTemplateNode("oidcRPMetaDataNode","oidcRPName","rp-example")};q.newTemplateNode=function(c,u,t){q.message={title:u,field:"name"};return q.showModal("prompt.html",t).then(function(){var v;v=q.result;if(v){return q.addTemplateNode(v,c)}})};q.addTemplateNode=function(c,w){var v,u;v=q.currentScope;while(v.$modelValue.title!==(w+"s")){v=v.$parentNodeScope}u={id:w+"s/new__"+c,title:c,type:w,nodes:templates(w,"new__"+c)};v.$modelValue.nodes.push(u);v.expand();return u};p=function(t){var u,c;u=j.defer();c=j.defer();if(t._nodes){o(t);u.resolve()}else{if(t.cnodes){d(t).then(function(){return u.resolve()})}else{if(t.nodes||t.data){u.resolve()}else{q.getKey(t).then(function(){return u.resolve()})}}}u.promise.then(function(){var v,z,y,x,w;w=[];if(t.nodes){x=t.nodes;for(y=0,v=x.length;y0){t=x.nodes[w];x.nodes[w]=x.nodes[w-1];x.nodes[w-1]=t}return w};q.inSelect=function(u){var c,w,v,t;t=q.currentNode.select;for(v=0,c=t.length;v0?c.comment:c.re};q.filters={};q.execFilters=function(t){var c,v,u;t=t?t:q;u=q.filters;for(c in u){v=u[c];if(q.filters.hasOwnProperty(c)){return filterFunctions[c](t,j,v)}}return false};q.stoggle=function(c){var t;t=c.$modelValue;o(t);return c.toggle()};o=function(x){var D,B,z,y,w,u,t,c,v,C,A;v=["nodes","nodes_cond"];for(u=0,B=v.length;u0){q.message={title:"badRequest",message:t,items:[]}}else{q.message={title:"networkProblem",message:"",items:[]}}}}}return q.showModal("message.html")};q.showModal=function(t,v){var u,c;c=f.open({templateUrl:t,controller:"ModalInstanceCtrl",size:"lg",resolve:{elem:function(){return function(w){return q[w]}},set:function(){return function(x,w){return q[x]=w}},init:function(){return v}}});u=j.defer();c.result.then(function(w){q.message={title:"",message:"",items:[]};return u.resolve(w)},function(w){q.message={title:"",message:"",items:[]};return u.reject(w)});return u.promise};q.menuClick=function(c){if(c.popup){window.open(c.popup)}else{if(!c.action){c.action=c.title}switch(typeof c.action){case"function":c.action(q.currentNode,q);break;case"string":q[c.action]();break;default:console.log(typeof c.action)}}return q.showM=false};q.home=function(){q.form="home";return q.showM=false};h=function(t){var c;q.message={title:"",message:"",items:[]};if(t.message==="__needConfirmation__"){q.confirmNeeded=true}if(t.message){q.message.message=t.message}if(t.details){for(c in t.details){if(c!=="__changes__"){q.message.items.push({message:c,items:t.details[c]})}}}q.waiting=false;if(t.result===1){i.path("/confs/");q.message.title="successfullySaved"}else{q.message.title="saveReport"}return q.showModal("message.html")};q.downlaodConf=function(u,t){return window.open(t.confPrefix+t.currentCfg.cfgNum+"?full")};q.save=function(){q.showModal("save.html").then(function(){q.waiting=true;q.data.push({id:"cfgLog",title:"cfgLog",data:q.result?q.result:""});return m.post(window.confPrefix+"?cfgNum="+q.currentCfg.cfgNum+(q.forceSave?"&force=1":""),q.data).then(function(c){q.data.pop();return h(c.data)},function(c){s(c);return q.data.pop()})},function(){return console.log("Saving canceled")});return q.showM=false};q.saveRawConf=function(c){q.waiting=true;return m.post(window.confPrefix+"/raw",c).then(function(t){return h(t.data)},s)};q.restore=function(){q.currentNode=null;return q.form="restore"};q.cancel=function(){q.currentNode.data=null;return q.getKey(q.currentNode)};b=1;q._findContainer=function(){return q._findScopeContainer().$modelValue};q._findScopeContainer=function(){var c;c=q.currentScope;while(!c.$modelValue.type.match(/Container$/)){c=c.$parentNodeScope}return c};q._findScopeByKey=function(c){var t;t=q.currentScope;while(!(t.$modelValue.title===c)){t=t.$parentNodeScope}return t};q.newGrantRule=function(){var c,u,t;t=q._findContainer();c=t.nodes.length;u=c>0?c-1:0;return t.nodes.splice(u,0,{id:t.id+"/n"+(b++),title:"New rule",re:"1",comment:"New rule",data:"Message",type:"grant"})};q.newRule=function(){var c,u,t;t=q._findContainer();c=t.nodes.length;u=c>0?c-1:0;return t.nodes.splice(u,0,{id:t.id+"/n"+(b++),title:"New rule",re:"^/new",comment:"New rule",data:"accept",type:"rule"})};q.newPost=function(){var c;c=q._findContainer();return c.nodes.push({id:c.id+"/n"+(b++),title:"/absolute/path/to/form",data:{},type:"post"})};q.newPostVar=function(){if(q.currentNode.data.vars==null){q.currentNode.data.vars=[]}return q.currentNode.data.vars.push(["var1","$uid"])};q.newAuthChoice=function(){var c;c=q._findContainer();c.nodes.push({id:c.id+"/n"+(b++),title:"1_Key",data:["Null","Null","Null"],type:"authChoice"});return q.execFilters(q._findScopeByKey("authParams"))};q.newHashEntry=function(){var c;c=q._findContainer();return c.nodes.push({id:c.id+"/n"+(b++),title:"new",data:"",type:"keyText"})};q.newCat=function(){var c;c=q.currentScope;if(c.$modelValue.type==="menuApp"){c=c.$parentNodeScope}return c.$modelValue.nodes.push({id:c.$modelValue.id+"/n"+(b++),title:"New category",type:"menuCat",nodes:[]})};q.newApp=function(){var c;c=q.currentScope;if(c.$modelValue.type==="menuApp"){c=c.$parentNodeScope}return c.$modelValue.nodes.push({id:c.$modelValue.id+"/n"+(b++),title:"New application",type:"menuApp",data:{description:"New app description",uri:"https://test.example.com/",logo:"network.png",display:"auto"}})};q.newCmbMod=function(){var c;c=q._findContainer();return c.nodes.push({id:c.id+"/n"+(b++),title:"new",type:"cmbModule",data:{type:"LDAP","for":0,over:{}}})};q.newCmbOver=function(){return q.currentNode.data.over.set("new"+(b++),"")};q.addHost=function(t,c){if(!t.data){t.data=[]}return t.data.push({k:"newHost",h:[{k:"key",v:"uid"}]})};q.addSamlAttribute=function(){var c;c=q._findContainer();return c.nodes.push({id:c.id+"/n"+(b++),title:"new",type:"samlAttribute",data:[0,"New","",""]})};q.addVhost=function(){var c;c=q.domain?"."+q.domain.data:".example.com";q.message={title:"virtualHostName",field:"hostname"};return q.showModal("prompt.html",c).then(function(){var u,t;u=q.result;if(u){t=q.addTemplateNode(u,"virtualHost");delete t.nodes[0].cnodes;return t.nodes[0].nodes=[{id:"virtualHosts/new__"+u+"/locationRules/default",type:"rule",title:"default",comment:"",re:"default",data:"deny"}]}})};q.duplicateVhost=function(){var c;c=q.domain?"."+q.domain.data:".example.com";q.message={title:"virtualHostName",field:"hostname"};return q.showModal("prompt.html",c).then(function(){var t;t=q.result;return q.duplicateNode(t,"virtualHost",q.currentNode.title)})};q.addSamlIDP=function(){return q.newTemplateNode("samlIDPMetaDataNode","samlPartnerName","idp-example")};q.addSamlSP=function(){return q.newTemplateNode("samlSPMetaDataNode","samlPartnerName","sp-example")};q.addOidcOp=function(){return q.newTemplateNode("oidcOPMetaDataNode","oidcOPName","op-example")};q.addOidcRp=function(){return q.newTemplateNode("oidcRPMetaDataNode","oidcRPName","rp-example")};q.newTemplateNode=function(c,u,t){q.message={title:u,field:"name"};return q.showModal("prompt.html",t).then(function(){var v;v=q.result;if(v){return q.addTemplateNode(v,c)}})};q.addTemplateNode=function(c,w){var v,u;v=q.currentScope;while(v.$modelValue.title!==(w+"s")){v=v.$parentNodeScope}u={id:w+"s/new__"+c,title:c,type:w,nodes:templates(w,"new__"+c)};v.$modelValue.nodes.push(u);v.expand();return u};p=function(t){var u,c;u=j.defer();c=j.defer();if(t._nodes){o(t);u.resolve()}else{if(t.cnodes){d(t).then(function(){return u.resolve()})}else{if(t.nodes||t.data){u.resolve()}else{q.getKey(t).then(function(){return u.resolve()})}}}u.promise.then(function(){var v,z,y,x,w;w=[];if(t.nodes){x=t.nodes;for(y=0,v=x.length;y0){t=x.nodes[w];x.nodes[w]=x.nodes[w-1];x.nodes[w-1]=t}return w};q.inSelect=function(u){var c,w,v,t;t=q.currentNode.select;for(v=0,c=t.length;v0?c.comment:c.re};q.filters={};q.execFilters=function(t){var c,v,u;t=t?t:q;u=q.filters;for(c in u){v=u[c];if(q.filters.hasOwnProperty(c)){return filterFunctions[c](t,j,v)}}return false};q.stoggle=function(c){var t;t=c.$modelValue;o(t);return c.toggle()};o=function(x){var D,B,z,y,w,u,t,c,v,C,A;v=["nodes","nodes_cond"];for(u=0,B=v.length;u