removing hardcoded user
This commit is contained in:
parent
90418b204e
commit
f03ee4b836
@ -26,11 +26,12 @@ function rateLimitMiddleware(metadataBackend, endpointGroup = null) {
|
|||||||
return next();
|
return next();
|
||||||
}
|
}
|
||||||
|
|
||||||
const user = 'cdb';
|
const user = res.locals.user;
|
||||||
// const user = res.locals.user;
|
|
||||||
if (!endpointGroup) {
|
// TODO: remove comments to move it to global
|
||||||
endpointGroup = getEndpointGroup();
|
// if (!endpointGroup) {
|
||||||
}
|
// endpointGroup = getEndpointGroup();
|
||||||
|
// }
|
||||||
|
|
||||||
if (!endpointGroup || !isRateLimitEnabledByEndpoint(endpointGroup)) {
|
if (!endpointGroup || !isRateLimitEnabledByEndpoint(endpointGroup)) {
|
||||||
return next();
|
return next();
|
||||||
|
@ -12,7 +12,7 @@ const {
|
|||||||
let redisClient;
|
let redisClient;
|
||||||
let testClient;
|
let testClient;
|
||||||
let keysToDelete = ['user:localhost:mapviews:global'];
|
let keysToDelete = ['user:localhost:mapviews:global'];
|
||||||
const user = 'cdb';
|
const user = 'localhost';
|
||||||
|
|
||||||
const query = `
|
const query = `
|
||||||
SELECT
|
SELECT
|
||||||
|
@ -13,7 +13,7 @@ const {
|
|||||||
|
|
||||||
let redisClient;
|
let redisClient;
|
||||||
let rateLimit;
|
let rateLimit;
|
||||||
const user = 'cdb';
|
const user = 'localhost';
|
||||||
let keysToDelete = [];
|
let keysToDelete = [];
|
||||||
|
|
||||||
function setLimit(count, period, burst) {
|
function setLimit(count, period, burst) {
|
||||||
|
Loading…
Reference in New Issue
Block a user