Persistent sessions explorer in progress
This commit is contained in:
parent
4194378940
commit
2df6075dfa
2
Makefile
2
Makefile
|
@ -246,7 +246,7 @@ extra_test: all
|
|||
e2e_test: all prepare_test_server start_web_server launch_protractor stop_web_server
|
||||
|
||||
prepare_test_server:
|
||||
@mkdir -p e2e-tests/conf/lock
|
||||
@mkdir -p e2e-tests/conf/lock e2e-tests/conf/persistents/lock
|
||||
@$(MAKE) install_webserver_conf \
|
||||
RCONFDIR=e2e-tests/conf \
|
||||
ERASECONFIG=1 \
|
||||
|
|
|
@ -140,8 +140,8 @@
|
|||
"passwordDB": "Demo",
|
||||
"persistentStorage": "Apache::Session::File",
|
||||
"persistentStorageOptions": {
|
||||
"Directory": "__pwd__/e2e-tests/conf",
|
||||
"LockDirectory": "__pwd__/e2e-tests/conf/lock",
|
||||
"Directory": "__pwd__/e2e-tests/conf/persistents",
|
||||
"LockDirectory": "__pwd__/e2e-tests/conf/persistents/lock",
|
||||
"generateModule": "Lemonldap::NG::Common::Apache::Session::Generate::SHA256"
|
||||
},
|
||||
"portal": "http://auth.example.com:__port__/",
|
||||
|
|
|
@ -55,6 +55,8 @@ sub addRoutes {
|
|||
$self->{ $type . 'StorageOptions' }
|
||||
|| $conf->{ $type . 'StorageOptions' }
|
||||
|| {};
|
||||
$self->{conf}->{kind} =
|
||||
( $type eq 'global' ? 'SSO' : ucfirst($type) );
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -214,7 +216,8 @@ sub sessions {
|
|||
$start ||= 0;
|
||||
$length = 1 if ( $length < 1 );
|
||||
foreach my $k ( keys %$res ) {
|
||||
$r->{ substr $res->{$k}->{$field}, $start, $length }++;
|
||||
$r->{ substr $res->{$k}->{$field}, $start, $length }++
|
||||
if ( $res->{$k}->{$field} );
|
||||
}
|
||||
$group = $field;
|
||||
}
|
||||
|
@ -353,7 +356,7 @@ sub getApacheSession {
|
|||
cacheModule => $tsv->{sessionCacheModule},
|
||||
cacheModuleOptions => $tsv->{sessionCacheOptions},
|
||||
id => $id,
|
||||
kind => "SSO",
|
||||
kind => $mod->{kind},
|
||||
}
|
||||
);
|
||||
if ( $apacheSession->error ) {
|
||||
|
|
|
@ -6,47 +6,44 @@
|
|||
'use strict';
|
||||
var schemes = {
|
||||
"_whatToTrace": [
|
||||
function(t, v) {
|
||||
return "groupBy=substr(" + t + ",1)";
|
||||
},
|
||||
function(t, v) {
|
||||
return t + "=" + v + "*&groupBy=" + t;
|
||||
},
|
||||
function(t, v) {
|
||||
return t + "=" + v;
|
||||
}
|
||||
],
|
||||
function(t, v) {
|
||||
return "groupBy=substr(" + t + ",1)";
|
||||
},
|
||||
function(t, v) {
|
||||
return t + "=" + v + "*&groupBy=" + t;
|
||||
},
|
||||
function(t, v) {
|
||||
return t + "=" + v;
|
||||
}],
|
||||
"ipAddr": [
|
||||
function(t, v) {
|
||||
return "groupBy=net4(" + t + ",1)";
|
||||
},
|
||||
function(t, v) {
|
||||
return "groupBy=net4(" + t + ",2)";
|
||||
},
|
||||
function(t, v) {
|
||||
return "groupBy=net4(" + t + ",3)";
|
||||
},
|
||||
function(t, v) {
|
||||
return "groupBy=net4(" + t + ",4)";
|
||||
},
|
||||
function(t, v) {
|
||||
return t + "=" + v + '&groupBy=_whatToTrace';
|
||||
},
|
||||
function(t, v, q) {
|
||||
return q.replace(/\&groupBy.*$/, '') + "&_whatToTrace=" + v;
|
||||
}
|
||||
],
|
||||
function(t, v) {
|
||||
return "groupBy=net4(" + t + ",1)";
|
||||
},
|
||||
function(t, v) {
|
||||
return "groupBy=net4(" + t + ",2)";
|
||||
},
|
||||
function(t, v) {
|
||||
return "groupBy=net4(" + t + ",3)";
|
||||
},
|
||||
function(t, v) {
|
||||
return "groupBy=net4(" + t + ",4)";
|
||||
},
|
||||
function(t, v) {
|
||||
return t + "=" + v + '&groupBy=_whatToTrace';
|
||||
},
|
||||
function(t, v, q) {
|
||||
return q.replace(/\&groupBy.*$/, '') + "&_whatToTrace=" + v;
|
||||
}],
|
||||
"doubleIp": [
|
||||
function(t, v) {
|
||||
return t;
|
||||
},
|
||||
function(t, v) {
|
||||
return '_whatToTrace=' + v + '&groupBy=ipAddr';
|
||||
},
|
||||
function(t, v, q) {
|
||||
return q.replace(/\&groupBy.*$/, '') + "&ipAddr=" + v;
|
||||
}
|
||||
]
|
||||
function(t, v) {
|
||||
return t;
|
||||
},
|
||||
function(t, v) {
|
||||
return '_whatToTrace=' + v + '&groupBy=ipAddr';
|
||||
},
|
||||
function(t, v, q) {
|
||||
return q.replace(/\&groupBy.*$/, '') + "&ipAddr=" + v;
|
||||
}]
|
||||
};
|
||||
var hiddenAttributes = '_password';
|
||||
var categories = [
|
||||
|
@ -57,8 +54,7 @@
|
|||
['saml', ['_idp', '_idpConfKey', '_samlToken', '_lassoSessionDump', '_lassoIdentityDump']],
|
||||
['groups', ['groups', 'hGroups']],
|
||||
['ldap', ['dn']],
|
||||
['BrowserID', ['_browserIdAnswer', '_browserIdAnswerRaw']]
|
||||
];
|
||||
['BrowserID', ['_browserIdAnswer', '_browserIdAnswerRaw']]];
|
||||
var menu = {
|
||||
'session': [{
|
||||
'title': 'deleteSession',
|
||||
|
@ -88,6 +84,7 @@
|
|||
$scope.translateTitle = function(node) {
|
||||
return $translator.translateField(node, 'title');
|
||||
};
|
||||
var sessionType = 'global';
|
||||
|
||||
/* Manage form menu clicks */
|
||||
$scope.menuClick = function(button) {
|
||||
|
@ -97,14 +94,14 @@
|
|||
if (!button.action) button.action = button.title;
|
||||
//try {
|
||||
switch (typeof button.action) {
|
||||
case 'function':
|
||||
button.action($scope.currentNode, $scope);
|
||||
break;
|
||||
case 'string':
|
||||
$scope[button.action]();
|
||||
break;
|
||||
default:
|
||||
console.log(typeof button.action);
|
||||
case 'function':
|
||||
button.action($scope.currentNode, $scope);
|
||||
break;
|
||||
case 'string':
|
||||
$scope[button.action]();
|
||||
break;
|
||||
default:
|
||||
console.log(typeof button.action);
|
||||
};
|
||||
//} catch (e) {
|
||||
// alert("Error: " + e.message);
|
||||
|
@ -115,7 +112,7 @@
|
|||
|
||||
$scope.deleteSession = function() {
|
||||
$scope.waiting = true;
|
||||
$http.delete(scriptname + "sessions/global/" + $scope.currentSession.id).success(function(data) {
|
||||
$http.delete(scriptname + "sessions/" + sessionType + "/" + $scope.currentSession.id).success(function(data) {
|
||||
$scope.currentSession = null;
|
||||
$scope.currentScope.remove();
|
||||
$scope.waiting = false;
|
||||
|
@ -188,8 +185,8 @@
|
|||
/* 2.1 Classified attributes */
|
||||
categories.forEach(function(t) {
|
||||
var subres = [],
|
||||
category = t[0],
|
||||
attrs = t[1];
|
||||
category = t[0],
|
||||
attrs = t[1];
|
||||
attrs.forEach(function(attr) {
|
||||
if (session[attr]) {
|
||||
subres.push({
|
||||
|
@ -259,7 +256,7 @@
|
|||
|
||||
$scope.currentScope = scope;
|
||||
var sessionId = scope.$modelValue.session;
|
||||
$http.get(scriptname + "sessions/global/" + sessionId).success(function(data) {
|
||||
$http.get(scriptname + "sessions/" + sessionType + "/" + sessionId).success(function(data) {
|
||||
$scope.currentSession = transformSession(data);
|
||||
});
|
||||
}
|
||||
|
@ -286,8 +283,12 @@
|
|||
*/
|
||||
var pathEvent = function(event, next, current) {
|
||||
var n = next.match(/#\/(\w+)/);
|
||||
sessionType = 'global';
|
||||
if (n === null) {
|
||||
$scope.type = '_whatToTrace';
|
||||
} else if (n[1].match(/^(persistent)$/)) {
|
||||
sessionType = RegExp.$1;
|
||||
$scope.type = 'decode';
|
||||
} else {
|
||||
$scope.type = n[1];
|
||||
}
|
||||
|
@ -306,7 +307,7 @@
|
|||
}
|
||||
query = scheme[level]($scope.type, value, currentQuery);
|
||||
|
||||
$http.get(scriptname + "sessions/global?" + query).success(function(data) {
|
||||
$http.get(scriptname + "sessions/" + sessionType + "?" + query).success(function(data) {
|
||||
if (data.result) {
|
||||
data.values.forEach(function(n) {
|
||||
autoId++;
|
||||
|
@ -330,17 +331,15 @@
|
|||
$scope.waiting = true;
|
||||
$scope.data = [];
|
||||
$q.all([
|
||||
$translator.init($scope.lang),
|
||||
$scope.updateTree('', $scope.data, 0)
|
||||
])
|
||||
.then(function() {
|
||||
$scope.waiting = false;
|
||||
}, function(j, e) {
|
||||
$scope.waiting = false;
|
||||
});
|
||||
$translator.init($scope.lang), $scope.updateTree('', $scope.data, 0)]).then(function() {
|
||||
$scope.waiting = false;
|
||||
},
|
||||
function(j, e) {
|
||||
$scope.waiting = false;
|
||||
});
|
||||
};
|
||||
|
||||
var c = $location.path().match(/^\/(\w+)/);
|
||||
$scope.type = c ? c[1] : '_whatToTrace';
|
||||
}]);
|
||||
})();
|
||||
})();
|
|
@ -18,6 +18,7 @@
|
|||
<li><a id="a-users" href="#"><i class="glyphicon glyphicon-user"></i> {{translate('users')}}</a></li>
|
||||
<li><a id="a-ip" href="#/ipAddr"><i class="glyphicon glyphicon-sort-by-order"></i> {{translate('ipAddresses')}}</a></li>
|
||||
<li><a id="a-multi" href="#/doubleIp"><i class="glyphicon glyphicon-exclamation-sign"></i> {{translate('multiIp')}}</a></li>
|
||||
<li><a id="a-multi" href="#/persistent"><i class="glyphicon glyphicon-exclamation-sign"></i> {{translate('persistent')}}</a></li>
|
||||
</ul>
|
||||
</div>
|
||||
</div>
|
||||
|
|
|
@ -2077,8 +2077,7 @@ sub setPersistentSessionInfo {
|
|||
foreach my $k ( keys %{ $persistentSession->data } ) {
|
||||
|
||||
# Do not restore some parameters
|
||||
next if $k =~ /^_session_id$/;
|
||||
next if $k =~ /^_session_kind$/;
|
||||
next if $k =~ /^_session_(?:(?:u)id|kind)$/;
|
||||
$self->lmLog( "Restore persistent parameter $k", 'debug' );
|
||||
$self->{sessionInfo}->{$k} = $persistentSession->data->{$k};
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue