Rename user limits api by user limits backend

This commit is contained in:
Daniel García Aubert
2018-04-10 10:16:07 +02:00
parent 8519d2724b
commit d1a4057a8d
22 changed files with 108 additions and 108 deletions
@@ -27,7 +27,7 @@ const { RATE_LIMIT_ENDPOINTS_GROUPS } = rateLimit;
* @param {MapBackend} mapBackend
* @param metadataBackend
* @param {SurrogateKeysCache} surrogateKeysCache
* @param {UserLimitsApi} userLimitsApi
* @param {UserLimitsBackend} userLimitsBackend
* @param {LayergroupAffectedTables} layergroupAffectedTables
* @param {MapConfigAdapter} mapConfigAdapter
* @param {StatsBackend} statsBackend
@@ -39,7 +39,7 @@ function NamedMapController (
mapBackend,
metadataBackend,
surrogateKeysCache,
userLimitsApi,
userLimitsBackend,
layergroupAffectedTables,
mapConfigAdapter,
statsBackend,
@@ -51,7 +51,7 @@ function NamedMapController (
this.mapBackend = mapBackend;
this.metadataBackend = metadataBackend;
this.surrogateKeysCache = surrogateKeysCache;
this.userLimitsApi = userLimitsApi;
this.userLimitsBackend = userLimitsBackend;
this.layergroupAffectedTables = layergroupAffectedTables;
this.mapConfigAdapter = mapConfigAdapter;
this.statsBackend = statsBackend;
@@ -84,7 +84,7 @@ NamedMapController.prototype.composeInstantiateTemplateMiddleware = function ()
credentials(),
authorize(this.authBackend),
dbConnSetup(this.pgConnection),
rateLimit(this.userLimitsApi, RATE_LIMIT_ENDPOINTS_GROUPS.NAMED),
rateLimit(this.userLimitsBackend, RATE_LIMIT_ENDPOINTS_GROUPS.NAMED),
cleanUpQueryParams(['aggregation']),
initProfiler(isTemplateInstantiation),
checkJsonContentType(),
@@ -93,13 +93,13 @@ NamedMapController.prototype.composeInstantiateTemplateMiddleware = function ()
this.templateMaps,
this.pgConnection,
this.metadataBackend,
this.userLimitsApi,
this.userLimitsBackend,
this.mapConfigAdapter,
this.layergroupAffectedTables
),
instantiateLayergroup(
this.mapBackend,
this.userLimitsApi,
this.userLimitsBackend,
this.pgConnection,
this.layergroupAffectedTables
),
@@ -145,7 +145,7 @@ function getTemplate (
templateMaps,
pgConnection,
metadataBackend,
userLimitsApi,
userLimitsBackend,
mapConfigAdapter,
affectedTablesCache
) {
@@ -161,7 +161,7 @@ function getTemplate (
templateMaps,
pgConnection,
metadataBackend,
userLimitsApi,
userLimitsBackend,
mapConfigAdapter,
affectedTablesCache,
user,
@@ -186,13 +186,13 @@ function getTemplate (
};
}
function instantiateLayergroup (mapBackend, userLimitsApi, pgConnection, affectedTablesCache) {
function instantiateLayergroup (mapBackend, userLimitsBackend, pgConnection, affectedTablesCache) {
return function instantiateLayergroupMiddleware (req, res, next) {
const { user, mapConfig, rendererParams } = res.locals;
const mapConfigProvider = new CreateLayergroupMapConfigProvider(
mapConfig,
user,
userLimitsApi,
userLimitsBackend,
pgConnection,
affectedTablesCache,
rendererParams