diff --git a/lemonldap-ng-manager/lib/Lemonldap/NG/Manager/Attributes.pm b/lemonldap-ng-manager/lib/Lemonldap/NG/Manager/Attributes.pm index daeab2cc0..0e002527c 100644 --- a/lemonldap-ng-manager/lib/Lemonldap/NG/Manager/Attributes.pm +++ b/lemonldap-ng-manager/lib/Lemonldap/NG/Manager/Attributes.pm @@ -8,12 +8,12 @@ sub types { 'authParamsText' => { 'test' => sub { 1; - } + } }, 'blackWhiteList' => { 'test' => sub { 1; - } + } }, 'bool' => { 'msgFail' => '__notABoolean__', @@ -36,17 +36,17 @@ sub types { split( /\n/, $@, 0 ) ) ); return $err ? ( 1, "__badExpression__: $err" ) : 1; - } + } }, 'catAndAppList' => { 'test' => sub { 1; - } + } }, 'file' => { 'test' => sub { 1; - } + } }, 'hostname' => { 'form' => 'text', @@ -80,48 +80,48 @@ qr/^(?:(?:(?:(?:(?:(?:[a-zA-Z0-9][-a-zA-Z0-9]*)?[a-zA-Z0-9])[.])*(?:[a-zA-Z][-a- if $_ =~ /exportedvars$/i and defined $conf->{$_}{$val}; } return 1, "__unknownAttrOrMacro__: $val"; - } + } }, 'longtext' => { 'test' => sub { 1; - } + } }, 'menuApp' => { 'test' => sub { 1; - } + } }, 'menuCat' => { 'test' => sub { 1; - } + } }, 'oidcmetadatajson' => { 'test' => sub { 1; - } + } }, 'oidcmetadatajwks' => { 'test' => sub { 1; - } + } }, 'oidcOPMetaDataNode' => { 'test' => sub { 1; - } + } }, 'oidcRPMetaDataNode' => { 'test' => sub { 1; - } + } }, 'password' => { 'msgFail' => '__malformedValue__', 'test' => sub { 1; - } + } }, 'pcre' => { 'form' => 'text', @@ -132,7 +132,7 @@ qr/^(?:(?:(?:(?:(?:(?:[a-zA-Z0-9][-a-zA-Z0-9]*)?[a-zA-Z0-9])[.])*(?:[a-zA-Z][-a- } }; return $@ ? ( 0, "__badRegexp__: $@" ) : 1; - } + } }, 'PerlModule' => { 'form' => 'text', @@ -142,17 +142,17 @@ qr/^(?:(?:(?:(?:(?:(?:[a-zA-Z0-9][-a-zA-Z0-9]*)?[a-zA-Z0-9])[.])*(?:[a-zA-Z][-a- 'portalskin' => { 'test' => sub { 1; - } + } }, 'portalskinbackground' => { 'test' => sub { 1; - } + } }, 'post' => { 'test' => sub { 1; - } + } }, 'RSAPrivateKey' => { 'test' => sub { @@ -160,7 +160,7 @@ qr/^(?:(?:(?:(?:(?:(?:[a-zA-Z0-9][-a-zA-Z0-9]*)?[a-zA-Z0-9])[.])*(?:[a-zA-Z][-a- m[^(?:(?:\-+\s*BEGIN\s+(?:RSA\s+)?PRIVATE\s+KEY\s*\-+\r?\n)?[a-zA-Z0-9/\+\r\n]+={0,2}(?:\r?\n\-+\s*END\s+(?:RSA\s+)PRIVATE\s+KEY\s*\-+)?[\r\n]*)?$]s ? 1 : ( 1, '__badPemEncoding__' ); - } + } }, 'RSAPublicKey' => { 'test' => sub { @@ -168,7 +168,7 @@ m[^(?:(?:\-+\s*BEGIN\s+(?:RSA\s+)?PRIVATE\s+KEY\s*\-+\r?\n)?[a-zA-Z0-9/\+\r\n]+= m[^(?:(?:\-+\s*BEGIN\s+PUBLIC\s+KEY\s*\-+\r?\n)?[a-zA-Z0-9/\+\r\n]+={0,2}(?:\r?\n\-+\s*END\s+PUBLIC\s+KEY\s*\-+)?[\r\n]*)?$]s ? 1 : ( 1, '__badPemEncoding__' ); - } + } }, 'RSAPublicKeyOrCertificate' => { 'test' => sub { @@ -176,37 +176,37 @@ m[^(?:(?:\-+\s*BEGIN\s+PUBLIC\s+KEY\s*\-+\r?\n)?[a-zA-Z0-9/\+\r\n]+={0,2}(?:\r?\ m[^(?:(?:\-+\s*BEGIN\s+(?:PUBLIC\s+KEY|CERTIFICATE)\s*\-+\r?\n)?[a-zA-Z0-9/\+\r\n]+={0,2}(?:\r?\n\-+\s*END\s+(?:PUBLIC\s+KEY|CERTIFICATE)\s*\-+)?[\r\n]*)?$]s ? 1 : ( 1, '__badPemEncoding__' ); - } + } }, 'rule' => { 'test' => sub { 1; - } + } }, 'samlAssertion' => { 'test' => sub { 1; - } + } }, 'samlAttribute' => { 'test' => sub { 1; - } + } }, 'samlIDPMetaDataNode' => { 'test' => sub { 1; - } + } }, 'samlService' => { 'test' => sub { 1; - } + } }, 'samlSPMetaDataNode' => { 'test' => sub { 1; - } + } }, 'select' => { 'test' => sub { @@ -216,19 +216,19 @@ m[^(?:(?:\-+\s*BEGIN\s+(?:PUBLIC\s+KEY|CERTIFICATE)\s*\-+\r?\n)?[a-zA-Z0-9/\+\r\ return $test ? 1 : ( 1, "Invalid value '$_[0]' for this select" ); - } + } }, 'subContainer' => { 'keyTest' => qr/\w/, 'test' => sub { 1; - } + } }, 'text' => { 'msgFail' => '__malformedValue__', 'test' => sub { 1; - } + } }, 'trool' => { 'msgFail' => '__authorizedValues__: -1, 0, 1', @@ -1035,7 +1035,7 @@ qr/^(?:\*\.)?(?:(?:(?:(?:[a-zA-Z0-9][-a-zA-Z0-9]*)?[a-zA-Z0-9])[.])*(?:[a-zA-Z][ split( /\n/, $@, 0 ) ) ); return $err ? ( 1, "__badExpression__: $err" ) : 1; - } + } }, 'type' => 'keyTextContainer' }, @@ -1210,7 +1210,7 @@ qr/^(?:(?:(?:(?:[a-zA-Z0-9][-a-zA-Z0-9]*)?[a-zA-Z0-9])[.])*(?:[a-zA-Z][-a-zA-Z0- and defined $conf->{$_}{$val}; } return 1, "__unknownAttrOrMacro__: $val"; - } + } }, 'type' => 'doubleHash' }, @@ -1498,7 +1498,7 @@ qr/^(?:\*\.)?(?:(?:(?:(?:[a-zA-Z0-9][-a-zA-Z0-9]*)?[a-zA-Z0-9])[.])*(?:[a-zA-Z][ split( /\n/, $@, 0 ) ) ); return $err ? ( 1, "__badExpression__: $err" ) : 1; - } + } }, 'type' => 'ruleContainer' }, @@ -3004,19 +3004,19 @@ qr/(?:(?:https?):\/\/(?:(?:(?:(?:(?:(?:[a-zA-Z0-9][-a-zA-Z0-9]*)?[a-zA-Z0-9])[.] 'default' => 0, 'select' => [ { - 'k' => '0', + 'k' => 0, 'v' => 'unsecuredCookie' }, { - 'k' => '1', + 'k' => 1, 'v' => 'securedCookie' }, { - 'k' => '2', + 'k' => 2, 'v' => 'doubleCookie' }, { - 'k' => '3', + 'k' => 3, 'v' => 'doubleCookieForSingleSession' } ], diff --git a/lemonldap-ng-manager/site/coffee/sessions.coffee b/lemonldap-ng-manager/site/coffee/sessions.coffee index b66c0e944..fe8ee2ad4 100644 --- a/lemonldap-ng-manager/site/coffee/sessions.coffee +++ b/lemonldap-ng-manager/site/coffee/sessions.coffee @@ -1,5 +1,5 @@ ### -# Session explorer +# Sessions explorer ### # Max number of session to display (see overScheme) @@ -207,8 +207,7 @@ llapp.controller 'SessionsExplorerCtrl', ['$scope', '$translator', '$location', # 2. Push session keys in result, grouped by categories for category, attrs of categories subres = [] - for attr in attrs - + for attr in attrs if session[attr] and session[attr].match(/\w+/) if session[attr].match(/"type":\s*"(?:TOTP|U2F|UBK)"/) subres.push @@ -235,6 +234,8 @@ llapp.controller 'SessionsExplorerCtrl', ['$scope', '$translator', '$location', value: session[attr] epoch: '' delete session[attr] + else + delete session[attr] if subres.length >0 res.push title: "__#{category}__" diff --git a/lemonldap-ng-manager/site/htdocs/static/js/sessions.js b/lemonldap-ng-manager/site/htdocs/static/js/sessions.js index acad4a0b5..5d65862b2 100644 --- a/lemonldap-ng-manager/site/htdocs/static/js/sessions.js +++ b/lemonldap-ng-manager/site/htdocs/static/js/sessions.js @@ -1,7 +1,7 @@ // Generated by CoffeeScript 1.9.3 /* - * Session explorer + * Sessions explorer */ (function() { @@ -277,6 +277,8 @@ }); delete session[attr]; } + } else { + delete session[attr]; } } if (subres.length > 0) { diff --git a/lemonldap-ng-manager/site/htdocs/static/js/sessions.min.js b/lemonldap-ng-manager/site/htdocs/static/js/sessions.min.js index b9a47b1cd..b52f276e0 100644 --- a/lemonldap-ng-manager/site/htdocs/static/js/sessions.min.js +++ b/lemonldap-ng-manager/site/htdocs/static/js/sessions.min.js @@ -1 +1 @@ -(function(){var c,e,d,b,g,f,a;b=25;a={_whatToTrace:[function(i,h){return"groupBy=substr("+i+",1)"},function(i,h){return i+"="+h+"*&groupBy="+i},function(i,h){return i+"="+h}],ipAddr:[function(i,h){return"groupBy=net("+i+",16,1)"},function(i,h){if(!h.match(/:/)){h=h+"."}return i+"="+h+"*&groupBy=net("+i+",32,2)"},function(i,h){if(!h.match(/:/)){h=h+"."}return i+"="+h+"*&groupBy=net("+i+",48,3)"},function(i,h){if(!h.match(/:/)){h=h+"."}return i+"="+h+"*&groupBy=net("+i+",128,4)"},function(i,h){return i+"="+h+"&groupBy=_whatToTrace"},function(i,h,j){return j.replace(/\&groupBy.*$/,"")+("&_whatToTrace="+h)}],_startTime:[function(i,h){return"groupBy=substr("+i+",8)"},function(i,h){return i+"="+h+"*&groupBy=substr("+i+",10)"},function(i,h){return i+"="+h+"*&groupBy=substr("+i+",11)"},function(i,h){return i+"="+h+"*&groupBy=substr("+i+",12)"},function(i,h){return i+"="+h+"*&groupBy=_whatToTrace"},function(i,h,j){console.log(i);console.log(h);console.log(j);return j.replace(/\&groupBy.*$/,"")+("&_whatToTrace="+h)}],doubleIp:[function(i,h){return i},function(i,h){return"_whatToTrace="+h+"&groupBy=ipAddr"},function(i,h,j){return j.replace(/\&groupBy.*$/,"")+("&ipAddr="+h)}]};f={_whatToTrace:function(i,h,k,j){if(k===1){return i+"="+h+"*&groupBy=substr("+i+","+(k+j+1)+")"}else{return null}},ipAddr:function(i,h,k,j){if(k>0&&k<4){return i+"="+h+"*&groupBy=net("+i+","+(16*k+4*(j+1))+",2)"}else{return null}}};e="_password";c={dateTitle:["_utime","_startTime","_updateTime","_lastAuthnUTime","_lastSeen"],connectionTitle:["ipAddr","_timezone","_url"],authenticationTitle:["_session_id","_user","_password","authenticationLevel"],modulesTitle:["_auth","_userDB","_passwordDB","_issuerDB","_authChoice","_authMulti","_userDBMulti"],saml:["_idp","_idpConfKey","_samlToken","_lassoSessionDump","_lassoIdentityDump"],groups:["groups","hGroups"],ldap:["dn"],BrowserID:["_browserIdAnswer","_browserIdAnswerRaw"],OpenIDConnect:["_oidc_id_token","_oidc_OP","_oidc_access_token"],sfaTitle:["_2fDevices"]};g={session:[{title:"deleteSession",icon:"trash"}],home:[]};d=angular.module("llngSessionsExplorer",["ui.tree","ui.bootstrap","llApp"]);d.controller("SessionsExplorerCtrl",["$scope","$translator","$location","$q","$http",function(p,h,i,j,m){var n,l,k,o;p.links=links;p.menulinks=menulinks;p.staticPrefix=staticPrefix;p.scriptname=scriptname;p.formPrefix=formPrefix;p.availableLanguages=availableLanguages;p.waiting=true;p.showM=false;p.showT=true;p.data=[];p.currentScope=null;p.currentSession=null;p.menu=g;p.translateP=h.translateP;p.translate=h.translate;p.translateTitle=function(q){return h.translateField(q,"title")};o="global";p.menuClick=function(q){if(q.popup){window.open(q.popup)}else{if(!q.action){q.action=q.title}switch(typeof q.action){case"function":q.action(p.currentNode,p);break;case"string":p[q.action]();break;default:console.log(typeof q.action)}}return p.showM=false};p.deleteSession=function(){p.waiting=true;return m["delete"](scriptname+"sessions/"+o+"/"+p.currentSession.id).then(function(q){p.currentSession=null;p.currentScope.remove();return p.waiting=false},function(q){p.currentSession=null;p.currentScope.remove();return p.waiting=false})};p.stoggle=function(q){var r;r=q.$modelValue;if(r.nodes.length===0){p.updateTree(r.value,r.nodes,r.level,r.over,r.query,r.count)}return q.toggle()};p.displaySession=function(r){var s,q;q=function(t){var B,E,y,z,J,G,L,S,O,F,N,M,X,K,P,A,x,w,I,W,Q,u,D,V,C,T,v,U,R,H;E=function(Y){return Y};B=function(ab,ad){var Z,aa,Y,ac;Y=[];aa=new RegExp(ab);for(Z in t){ac=t[Z];if(Z.match(aa)&&ac){Y.push({title:Z,value:ac});delete t[Z]}}if(Y.length>0){return V.push({title:ad,nodes:Y})}};v=t._utime;F=t._session_id;for(X in t){H=t[X];if(!H){delete t[X]}else{if(typeof t==="string"&&H.match(/; /)){t[X]=H.split("; ")}if(typeof t[X]!=="object"){if(e.match(new RegExp("\b"+X+"\b"))){t[X]="********"}else{if(X.match(/^(_utime|_lastAuthnUTime|_lastSeen|notification)$/)){t[X]=p.localeDate(H)}else{if(X.match(/^(_startTime|_updateTime)$/)){Q=/^(\d{4})(\d{2})(\d{2})(\d{2})(\d{2})(\d{2})$/;z=H.match(Q);t[X]=z[3]+"/"+z[2]+"/"+z[1]+" à "+z[4]+":"+z[5]+":"+z[6]}}}}}}V=[];for(L in c){G=c[L];T=[];for(O=0,P=G.length;O0){V.push({title:"__"+L+"__",nodes:T})}}B("^openid","OpenID");B("^notification_(.+)","__notificationsDone__");if(t._loginHistory){R=[];if(t._loginHistory.successLogin){u=t._loginHistory.successLogin;for(M=0,x=u.length;MY.title){return 1}else{if(Z.titleb&&f[p.type]){if(t=f[p.type](p.type,y,q,v,x)){v++;w=t;q=q-1}else{v=0}}else{v=0}return m.get(scriptname+"sessions/"+o+"?"+w).then(function(A){var D,B,z,E,C;D=A.data;if(D.result){C=D.values;for(B=0,z=C.length;B0&&k<4){return i+"="+h+"*&groupBy=net("+i+","+(16*k+4*(j+1))+",2)"}else{return null}}};e="_password";c={dateTitle:["_utime","_startTime","_updateTime","_lastAuthnUTime","_lastSeen"],connectionTitle:["ipAddr","_timezone","_url"],authenticationTitle:["_session_id","_user","_password","authenticationLevel"],modulesTitle:["_auth","_userDB","_passwordDB","_issuerDB","_authChoice","_authMulti","_userDBMulti"],saml:["_idp","_idpConfKey","_samlToken","_lassoSessionDump","_lassoIdentityDump"],groups:["groups","hGroups"],ldap:["dn"],BrowserID:["_browserIdAnswer","_browserIdAnswerRaw"],OpenIDConnect:["_oidc_id_token","_oidc_OP","_oidc_access_token"],sfaTitle:["_2fDevices"]};g={session:[{title:"deleteSession",icon:"trash"}],home:[]};d=angular.module("llngSessionsExplorer",["ui.tree","ui.bootstrap","llApp"]);d.controller("SessionsExplorerCtrl",["$scope","$translator","$location","$q","$http",function(p,h,i,j,m){var n,l,k,o;p.links=links;p.menulinks=menulinks;p.staticPrefix=staticPrefix;p.scriptname=scriptname;p.formPrefix=formPrefix;p.availableLanguages=availableLanguages;p.waiting=true;p.showM=false;p.showT=true;p.data=[];p.currentScope=null;p.currentSession=null;p.menu=g;p.translateP=h.translateP;p.translate=h.translate;p.translateTitle=function(q){return h.translateField(q,"title")};o="global";p.menuClick=function(q){if(q.popup){window.open(q.popup)}else{if(!q.action){q.action=q.title}switch(typeof q.action){case"function":q.action(p.currentNode,p);break;case"string":p[q.action]();break;default:console.log(typeof q.action)}}return p.showM=false};p.deleteSession=function(){p.waiting=true;return m["delete"](scriptname+"sessions/"+o+"/"+p.currentSession.id).then(function(q){p.currentSession=null;p.currentScope.remove();return p.waiting=false},function(q){p.currentSession=null;p.currentScope.remove();return p.waiting=false})};p.stoggle=function(q){var r;r=q.$modelValue;if(r.nodes.length===0){p.updateTree(r.value,r.nodes,r.level,r.over,r.query,r.count)}return q.toggle()};p.displaySession=function(r){var s,q;q=function(t){var B,E,y,z,J,G,L,S,O,F,N,M,X,K,P,A,x,w,I,W,Q,u,D,V,C,T,v,U,R,H;E=function(Y){return Y};B=function(ab,ad){var Z,aa,Y,ac;Y=[];aa=new RegExp(ab);for(Z in t){ac=t[Z];if(Z.match(aa)&&ac){Y.push({title:Z,value:ac});delete t[Z]}}if(Y.length>0){return V.push({title:ad,nodes:Y})}};v=t._utime;F=t._session_id;for(X in t){H=t[X];if(!H){delete t[X]}else{if(typeof t==="string"&&H.match(/; /)){t[X]=H.split("; ")}if(typeof t[X]!=="object"){if(e.match(new RegExp("\b"+X+"\b"))){t[X]="********"}else{if(X.match(/^(_utime|_lastAuthnUTime|_lastSeen|notification)$/)){t[X]=p.localeDate(H)}else{if(X.match(/^(_startTime|_updateTime)$/)){Q=/^(\d{4})(\d{2})(\d{2})(\d{2})(\d{2})(\d{2})$/;z=H.match(Q);t[X]=z[3]+"/"+z[2]+"/"+z[1]+" à "+z[4]+":"+z[5]+":"+z[6]}}}}}}V=[];for(L in c){G=c[L];T=[];for(O=0,P=G.length;O0){V.push({title:"__"+L+"__",nodes:T})}}B("^openid","OpenID");B("^notification_(.+)","__notificationsDone__");if(t._loginHistory){R=[];if(t._loginHistory.successLogin){u=t._loginHistory.successLogin;for(M=0,x=u.length;MY.title){return 1}else{if(Z.titleb&&f[p.type]){if(t=f[p.type](p.type,y,q,v,x)){v++;w=t;q=q-1}else{v=0}}else{v=0}return m.get(scriptname+"sessions/"+o+"?"+w).then(function(A){var D,B,z,E,C;D=A.data;if(D.result){C=D.values;for(B=0,z=C.length;B