Tidy middlewares up: cleanUpQeuryParams
This commit is contained in:
parent
3b1fd05940
commit
4cba4c7a1f
@ -25,12 +25,12 @@ AnalysesController.prototype.register = function (app) {
|
|||||||
app.get(
|
app.get(
|
||||||
`${mapconfigBasePath}/analyses/catalog`,
|
`${mapconfigBasePath}/analyses/catalog`,
|
||||||
cors(),
|
cors(),
|
||||||
cleanUpQueryParams(),
|
|
||||||
user(),
|
user(),
|
||||||
rateLimit(this.userLimitsApi, RATE_LIMIT_ENDPOINTS_GROUPS.ANALYSIS_CATALOG),
|
rateLimit(this.userLimitsApi, RATE_LIMIT_ENDPOINTS_GROUPS.ANALYSIS_CATALOG),
|
||||||
credentials(),
|
credentials(),
|
||||||
authorize(this.authApi),
|
authorize(this.authApi),
|
||||||
dbConnSetup(this.pgConnection),
|
dbConnSetup(this.pgConnection),
|
||||||
|
cleanUpQueryParams(),
|
||||||
createPGClient(),
|
createPGClient(),
|
||||||
getDataFromQuery({ queryTemplate: catalogQueryTpl, key: 'catalog' }),
|
getDataFromQuery({ queryTemplate: catalogQueryTpl, key: 'catalog' }),
|
||||||
getDataFromQuery({ queryTemplate: tablesQueryTpl, key: 'tables' }),
|
getDataFromQuery({ queryTemplate: tablesQueryTpl, key: 'tables' }),
|
||||||
|
@ -89,13 +89,13 @@ LayergroupController.prototype.register = function(app) {
|
|||||||
app.get(
|
app.get(
|
||||||
`${mapConfigBasePath}/:token/:z/:x/:y@:scale_factor?x.:format`,
|
`${mapConfigBasePath}/:token/:z/:x/:y@:scale_factor?x.:format`,
|
||||||
cors(),
|
cors(),
|
||||||
cleanUpQueryParams(),
|
|
||||||
user(),
|
user(),
|
||||||
rateLimit(this.userLimitsApi, RATE_LIMIT_ENDPOINTS_GROUPS.TILE),
|
rateLimit(this.userLimitsApi, RATE_LIMIT_ENDPOINTS_GROUPS.TILE),
|
||||||
layergroupToken(),
|
layergroupToken(),
|
||||||
credentials(),
|
credentials(),
|
||||||
authorize(this.authApi),
|
authorize(this.authApi),
|
||||||
dbConnSetup(this.pgConnection),
|
dbConnSetup(this.pgConnection),
|
||||||
|
cleanUpQueryParams(),
|
||||||
createMapStoreMapConfigProvider(
|
createMapStoreMapConfigProvider(
|
||||||
this.mapStore,
|
this.mapStore,
|
||||||
this.userLimitsApi,
|
this.userLimitsApi,
|
||||||
@ -117,13 +117,13 @@ LayergroupController.prototype.register = function(app) {
|
|||||||
app.get(
|
app.get(
|
||||||
`${mapConfigBasePath}/:token/:z/:x/:y.:format`,
|
`${mapConfigBasePath}/:token/:z/:x/:y.:format`,
|
||||||
cors(),
|
cors(),
|
||||||
cleanUpQueryParams(),
|
|
||||||
user(),
|
user(),
|
||||||
rateLimit(this.userLimitsApi, RATE_LIMIT_ENDPOINTS_GROUPS.TILE),
|
rateLimit(this.userLimitsApi, RATE_LIMIT_ENDPOINTS_GROUPS.TILE),
|
||||||
layergroupToken(),
|
layergroupToken(),
|
||||||
credentials(),
|
credentials(),
|
||||||
authorize(this.authApi),
|
authorize(this.authApi),
|
||||||
dbConnSetup(this.pgConnection),
|
dbConnSetup(this.pgConnection),
|
||||||
|
cleanUpQueryParams(),
|
||||||
createMapStoreMapConfigProvider(
|
createMapStoreMapConfigProvider(
|
||||||
this.mapStore,
|
this.mapStore,
|
||||||
this.userLimitsApi,
|
this.userLimitsApi,
|
||||||
@ -146,13 +146,13 @@ LayergroupController.prototype.register = function(app) {
|
|||||||
`${mapConfigBasePath}/:token/:layer/:z/:x/:y.(:format)`,
|
`${mapConfigBasePath}/:token/:layer/:z/:x/:y.(:format)`,
|
||||||
distinguishLayergroupFromStaticRoute(),
|
distinguishLayergroupFromStaticRoute(),
|
||||||
cors(),
|
cors(),
|
||||||
cleanUpQueryParams(),
|
|
||||||
user(),
|
user(),
|
||||||
rateLimit(this.userLimitsApi, RATE_LIMIT_ENDPOINTS_GROUPS.TILE),
|
rateLimit(this.userLimitsApi, RATE_LIMIT_ENDPOINTS_GROUPS.TILE),
|
||||||
layergroupToken(),
|
layergroupToken(),
|
||||||
credentials(),
|
credentials(),
|
||||||
authorize(this.authApi),
|
authorize(this.authApi),
|
||||||
dbConnSetup(this.pgConnection),
|
dbConnSetup(this.pgConnection),
|
||||||
|
cleanUpQueryParams(),
|
||||||
createMapStoreMapConfigProvider(
|
createMapStoreMapConfigProvider(
|
||||||
this.mapStore,
|
this.mapStore,
|
||||||
this.userLimitsApi,
|
this.userLimitsApi,
|
||||||
@ -174,13 +174,13 @@ LayergroupController.prototype.register = function(app) {
|
|||||||
app.get(
|
app.get(
|
||||||
`${mapConfigBasePath}/:token/:layer/attributes/:fid`,
|
`${mapConfigBasePath}/:token/:layer/attributes/:fid`,
|
||||||
cors(),
|
cors(),
|
||||||
cleanUpQueryParams(),
|
|
||||||
user(),
|
user(),
|
||||||
rateLimit(this.userLimitsApi, RATE_LIMIT_ENDPOINTS_GROUPS.ATTRIBUTES),
|
rateLimit(this.userLimitsApi, RATE_LIMIT_ENDPOINTS_GROUPS.ATTRIBUTES),
|
||||||
layergroupToken(),
|
layergroupToken(),
|
||||||
credentials(),
|
credentials(),
|
||||||
authorize(this.authApi),
|
authorize(this.authApi),
|
||||||
dbConnSetup(this.pgConnection),
|
dbConnSetup(this.pgConnection),
|
||||||
|
cleanUpQueryParams(),
|
||||||
createMapStoreMapConfigProvider(
|
createMapStoreMapConfigProvider(
|
||||||
this.mapStore,
|
this.mapStore,
|
||||||
this.userLimitsApi,
|
this.userLimitsApi,
|
||||||
@ -200,13 +200,13 @@ LayergroupController.prototype.register = function(app) {
|
|||||||
app.get(
|
app.get(
|
||||||
`${mapConfigBasePath}/static/center/:token/:z/:lat/:lng/:width/:height.:format`,
|
`${mapConfigBasePath}/static/center/:token/:z/:lat/:lng/:width/:height.:format`,
|
||||||
cors(),
|
cors(),
|
||||||
cleanUpQueryParams(['layer']),
|
|
||||||
user(),
|
user(),
|
||||||
rateLimit(this.userLimitsApi, RATE_LIMIT_ENDPOINTS_GROUPS.STATIC),
|
rateLimit(this.userLimitsApi, RATE_LIMIT_ENDPOINTS_GROUPS.STATIC),
|
||||||
layergroupToken(),
|
layergroupToken(),
|
||||||
credentials(),
|
credentials(),
|
||||||
authorize(this.authApi),
|
authorize(this.authApi),
|
||||||
dbConnSetup(this.pgConnection),
|
dbConnSetup(this.pgConnection),
|
||||||
|
cleanUpQueryParams(['layer']),
|
||||||
createMapStoreMapConfigProvider(
|
createMapStoreMapConfigProvider(
|
||||||
this.mapStore,
|
this.mapStore,
|
||||||
this.userLimitsApi,
|
this.userLimitsApi,
|
||||||
@ -225,13 +225,13 @@ LayergroupController.prototype.register = function(app) {
|
|||||||
app.get(
|
app.get(
|
||||||
`${mapConfigBasePath}/static/bbox/:token/:west,:south,:east,:north/:width/:height.:format`,
|
`${mapConfigBasePath}/static/bbox/:token/:west,:south,:east,:north/:width/:height.:format`,
|
||||||
cors(),
|
cors(),
|
||||||
cleanUpQueryParams(['layer']),
|
|
||||||
user(),
|
user(),
|
||||||
rateLimit(this.userLimitsApi, RATE_LIMIT_ENDPOINTS_GROUPS.STATIC),
|
rateLimit(this.userLimitsApi, RATE_LIMIT_ENDPOINTS_GROUPS.STATIC),
|
||||||
layergroupToken(),
|
layergroupToken(),
|
||||||
credentials(),
|
credentials(),
|
||||||
authorize(this.authApi),
|
authorize(this.authApi),
|
||||||
dbConnSetup(this.pgConnection),
|
dbConnSetup(this.pgConnection),
|
||||||
|
cleanUpQueryParams(['layer']),
|
||||||
createMapStoreMapConfigProvider(
|
createMapStoreMapConfigProvider(
|
||||||
this.mapStore,
|
this.mapStore,
|
||||||
this.userLimitsApi,
|
this.userLimitsApi,
|
||||||
@ -253,13 +253,13 @@ LayergroupController.prototype.register = function(app) {
|
|||||||
app.get(
|
app.get(
|
||||||
`${mapConfigBasePath}/:token/dataview/:dataviewName`,
|
`${mapConfigBasePath}/:token/dataview/:dataviewName`,
|
||||||
cors(),
|
cors(),
|
||||||
cleanUpQueryParams(ALLOWED_DATAVIEW_QUERY_PARAMS),
|
|
||||||
user(),
|
user(),
|
||||||
rateLimit(this.userLimitsApi, RATE_LIMIT_ENDPOINTS_GROUPS.DATAVIEW),
|
rateLimit(this.userLimitsApi, RATE_LIMIT_ENDPOINTS_GROUPS.DATAVIEW),
|
||||||
layergroupToken(),
|
layergroupToken(),
|
||||||
credentials(),
|
credentials(),
|
||||||
authorize(this.authApi),
|
authorize(this.authApi),
|
||||||
dbConnSetup(this.pgConnection),
|
dbConnSetup(this.pgConnection),
|
||||||
|
cleanUpQueryParams(ALLOWED_DATAVIEW_QUERY_PARAMS),
|
||||||
createMapStoreMapConfigProvider(
|
createMapStoreMapConfigProvider(
|
||||||
this.mapStore,
|
this.mapStore,
|
||||||
this.userLimitsApi,
|
this.userLimitsApi,
|
||||||
@ -277,13 +277,13 @@ LayergroupController.prototype.register = function(app) {
|
|||||||
app.get(
|
app.get(
|
||||||
`${mapConfigBasePath}/:token/:layer/widget/:dataviewName`,
|
`${mapConfigBasePath}/:token/:layer/widget/:dataviewName`,
|
||||||
cors(),
|
cors(),
|
||||||
cleanUpQueryParams(ALLOWED_DATAVIEW_QUERY_PARAMS),
|
|
||||||
user(),
|
user(),
|
||||||
rateLimit(this.userLimitsApi, RATE_LIMIT_ENDPOINTS_GROUPS.DATAVIEW),
|
rateLimit(this.userLimitsApi, RATE_LIMIT_ENDPOINTS_GROUPS.DATAVIEW),
|
||||||
layergroupToken(),
|
layergroupToken(),
|
||||||
credentials(),
|
credentials(),
|
||||||
authorize(this.authApi),
|
authorize(this.authApi),
|
||||||
dbConnSetup(this.pgConnection),
|
dbConnSetup(this.pgConnection),
|
||||||
|
cleanUpQueryParams(ALLOWED_DATAVIEW_QUERY_PARAMS),
|
||||||
createMapStoreMapConfigProvider(
|
createMapStoreMapConfigProvider(
|
||||||
this.mapStore,
|
this.mapStore,
|
||||||
this.userLimitsApi,
|
this.userLimitsApi,
|
||||||
@ -301,13 +301,13 @@ LayergroupController.prototype.register = function(app) {
|
|||||||
app.get(
|
app.get(
|
||||||
`${mapConfigBasePath}/:token/dataview/:dataviewName/search`,
|
`${mapConfigBasePath}/:token/dataview/:dataviewName/search`,
|
||||||
cors(),
|
cors(),
|
||||||
cleanUpQueryParams(ALLOWED_DATAVIEW_QUERY_PARAMS),
|
|
||||||
user(),
|
user(),
|
||||||
rateLimit(this.userLimitsApi, RATE_LIMIT_ENDPOINTS_GROUPS.DATAVIEW_SEARCH),
|
rateLimit(this.userLimitsApi, RATE_LIMIT_ENDPOINTS_GROUPS.DATAVIEW_SEARCH),
|
||||||
layergroupToken(),
|
layergroupToken(),
|
||||||
credentials(),
|
credentials(),
|
||||||
authorize(this.authApi),
|
authorize(this.authApi),
|
||||||
dbConnSetup(this.pgConnection),
|
dbConnSetup(this.pgConnection),
|
||||||
|
cleanUpQueryParams(ALLOWED_DATAVIEW_QUERY_PARAMS),
|
||||||
createMapStoreMapConfigProvider(
|
createMapStoreMapConfigProvider(
|
||||||
this.mapStore,
|
this.mapStore,
|
||||||
this.userLimitsApi,
|
this.userLimitsApi,
|
||||||
@ -325,13 +325,13 @@ LayergroupController.prototype.register = function(app) {
|
|||||||
app.get(
|
app.get(
|
||||||
`${mapConfigBasePath}/:token/:layer/widget/:dataviewName/search`,
|
`${mapConfigBasePath}/:token/:layer/widget/:dataviewName/search`,
|
||||||
cors(),
|
cors(),
|
||||||
cleanUpQueryParams(ALLOWED_DATAVIEW_QUERY_PARAMS),
|
|
||||||
user(),
|
user(),
|
||||||
rateLimit(this.userLimitsApi, RATE_LIMIT_ENDPOINTS_GROUPS.DATAVIEW_SEARCH),
|
rateLimit(this.userLimitsApi, RATE_LIMIT_ENDPOINTS_GROUPS.DATAVIEW_SEARCH),
|
||||||
layergroupToken(),
|
layergroupToken(),
|
||||||
credentials(),
|
credentials(),
|
||||||
authorize(this.authApi),
|
authorize(this.authApi),
|
||||||
dbConnSetup(this.pgConnection),
|
dbConnSetup(this.pgConnection),
|
||||||
|
cleanUpQueryParams(ALLOWED_DATAVIEW_QUERY_PARAMS),
|
||||||
createMapStoreMapConfigProvider(
|
createMapStoreMapConfigProvider(
|
||||||
this.mapStore,
|
this.mapStore,
|
||||||
this.userLimitsApi,
|
this.userLimitsApi,
|
||||||
@ -349,13 +349,13 @@ LayergroupController.prototype.register = function(app) {
|
|||||||
app.get(
|
app.get(
|
||||||
`${mapConfigBasePath}/:token/analysis/node/:nodeId`,
|
`${mapConfigBasePath}/:token/analysis/node/:nodeId`,
|
||||||
cors(),
|
cors(),
|
||||||
cleanUpQueryParams(),
|
|
||||||
user(),
|
user(),
|
||||||
rateLimit(this.userLimitsApi, RATE_LIMIT_ENDPOINTS_GROUPS.ANALYSIS),
|
rateLimit(this.userLimitsApi, RATE_LIMIT_ENDPOINTS_GROUPS.ANALYSIS),
|
||||||
layergroupToken(),
|
layergroupToken(),
|
||||||
credentials(),
|
credentials(),
|
||||||
authorize(this.authApi),
|
authorize(this.authApi),
|
||||||
dbConnSetup(this.pgConnection),
|
dbConnSetup(this.pgConnection),
|
||||||
|
cleanUpQueryParams(),
|
||||||
analysisNodeStatus(this.analysisStatusBackend),
|
analysisNodeStatus(this.analysisStatusBackend),
|
||||||
sendResponse()
|
sendResponse()
|
||||||
);
|
);
|
||||||
|
@ -100,12 +100,12 @@ MapController.prototype.composeCreateMapMiddleware = function (endpointGroup, us
|
|||||||
|
|
||||||
return [
|
return [
|
||||||
cors(),
|
cors(),
|
||||||
cleanUpQueryParams(['aggregation']),
|
|
||||||
user(),
|
user(),
|
||||||
rateLimit(this.userLimitsApi, endpointGroup),
|
rateLimit(this.userLimitsApi, endpointGroup),
|
||||||
credentials(),
|
credentials(),
|
||||||
authorize(this.authApi),
|
authorize(this.authApi),
|
||||||
dbConnSetup(this.pgConnection),
|
dbConnSetup(this.pgConnection),
|
||||||
|
cleanUpQueryParams(['aggregation']),
|
||||||
initProfiler(isTemplateInstantiation),
|
initProfiler(isTemplateInstantiation),
|
||||||
checkJsonContentType(),
|
checkJsonContentType(),
|
||||||
this.getCreateMapMiddlewares(useTemplate),
|
this.getCreateMapMiddlewares(useTemplate),
|
||||||
|
@ -55,12 +55,12 @@ NamedMapsController.prototype.register = function(app) {
|
|||||||
app.get(
|
app.get(
|
||||||
`${templateBasePath}/:template_id/:layer/:z/:x/:y.(:format)`,
|
`${templateBasePath}/:template_id/:layer/:z/:x/:y.(:format)`,
|
||||||
cors(),
|
cors(),
|
||||||
cleanUpQueryParams(),
|
|
||||||
user(),
|
user(),
|
||||||
rateLimit(this.userLimitsApi, RATE_LIMIT_ENDPOINTS_GROUPS.NAMED_TILES),
|
rateLimit(this.userLimitsApi, RATE_LIMIT_ENDPOINTS_GROUPS.NAMED_TILES),
|
||||||
credentials(),
|
credentials(),
|
||||||
authorize(this.authApi),
|
authorize(this.authApi),
|
||||||
dbConnSetup(this.pgConnection),
|
dbConnSetup(this.pgConnection),
|
||||||
|
cleanUpQueryParams(),
|
||||||
getNamedMapProvider({
|
getNamedMapProvider({
|
||||||
namedMapProviderCache: this.namedMapProviderCache,
|
namedMapProviderCache: this.namedMapProviderCache,
|
||||||
label: 'NAMED_MAP_TILE'
|
label: 'NAMED_MAP_TILE'
|
||||||
@ -81,12 +81,12 @@ NamedMapsController.prototype.register = function(app) {
|
|||||||
app.get(
|
app.get(
|
||||||
`${mapconfigBasePath}/static/named/:template_id/:width/:height.:format`,
|
`${mapconfigBasePath}/static/named/:template_id/:width/:height.:format`,
|
||||||
cors(),
|
cors(),
|
||||||
cleanUpQueryParams(['layer', 'zoom', 'lon', 'lat', 'bbox']),
|
|
||||||
user(),
|
user(),
|
||||||
rateLimit(this.userLimitsApi, RATE_LIMIT_ENDPOINTS_GROUPS.STATIC_NAMED),
|
rateLimit(this.userLimitsApi, RATE_LIMIT_ENDPOINTS_GROUPS.STATIC_NAMED),
|
||||||
credentials(),
|
credentials(),
|
||||||
authorize(this.authApi),
|
authorize(this.authApi),
|
||||||
dbConnSetup(this.pgConnection),
|
dbConnSetup(this.pgConnection),
|
||||||
|
cleanUpQueryParams(['layer', 'zoom', 'lon', 'lat', 'bbox']),
|
||||||
getNamedMapProvider({
|
getNamedMapProvider({
|
||||||
namedMapProviderCache: this.namedMapProviderCache,
|
namedMapProviderCache: this.namedMapProviderCache,
|
||||||
label: 'STATIC_VIZ_MAP', forcedFormat: 'png'
|
label: 'STATIC_VIZ_MAP', forcedFormat: 'png'
|
||||||
|
Loading…
Reference in New Issue
Block a user