removing hardcoded user

This commit is contained in:
Simon Martín 2018-02-26 11:20:31 +01:00
parent 90418b204e
commit f03ee4b836
3 changed files with 8 additions and 7 deletions

View File

@ -26,11 +26,12 @@ function rateLimitMiddleware(metadataBackend, endpointGroup = null) {
return next();
}
const user = 'cdb';
// const user = res.locals.user;
if (!endpointGroup) {
endpointGroup = getEndpointGroup();
}
const user = res.locals.user;
// TODO: remove comments to move it to global
// if (!endpointGroup) {
// endpointGroup = getEndpointGroup();
// }
if (!endpointGroup || !isRateLimitEnabledByEndpoint(endpointGroup)) {
return next();

View File

@ -12,7 +12,7 @@ const {
let redisClient;
let testClient;
let keysToDelete = ['user:localhost:mapviews:global'];
const user = 'cdb';
const user = 'localhost';
const query = `
SELECT

View File

@ -13,7 +13,7 @@ const {
let redisClient;
let rateLimit;
const user = 'cdb';
const user = 'localhost';
let keysToDelete = [];
function setLimit(count, period, burst) {