|
|
|
@ -424,8 +424,6 @@ module.exports = function(redisPool) {
|
|
|
|
|
return;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
_.extend(req.params, { _authorizedByApiKey: true });
|
|
|
|
|
|
|
|
|
|
// authorized by api key, login as the given username and stop
|
|
|
|
|
pgConnection.setDBAuth(user, req.params, function(err) {
|
|
|
|
|
callback(err, true); // authorized (or error)
|
|
|
|
@ -433,13 +431,6 @@ module.exports = function(redisPool) {
|
|
|
|
|
},
|
|
|
|
|
function checkSignAuthorized(err, signed_by){
|
|
|
|
|
assert.ifError(err);
|
|
|
|
|
if (req.profiler) {
|
|
|
|
|
if ( req.params._authorizedByApiKey ) {
|
|
|
|
|
req.profiler.done('setDBAuth');
|
|
|
|
|
} else {
|
|
|
|
|
req.profiler.done('authorizedBySigner');
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
if ( ! signed_by ) {
|
|
|
|
|
// request not authorized by signer.
|
|
|
|
@ -457,8 +448,6 @@ module.exports = function(redisPool) {
|
|
|
|
|
return;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
// Authorized by "signed_by" !
|
|
|
|
|
_.extend(req.params, { _authorizedBySigner: signed_by });
|
|
|
|
|
pgConnection.setDBAuth(signed_by, req.params, function(err) {
|
|
|
|
|
if (req.profiler) {
|
|
|
|
|
req.profiler.done('setDBAuth');
|
|
|
|
|