Configure extra allowed params per endpoint via middleware

Instead of making all params available in all endpoints, we control
what endpoints allow what extra params.

Dataviews endpoints should be migrated to this.
This commit is contained in:
Raul Ochoa
2017-04-03 12:16:24 +02:00
parent 1b510f05ac
commit e2c2e06d65
4 changed files with 19 additions and 5 deletions
@@ -0,0 +1,6 @@
module.exports = function allowQueryParams(params) {
return function allowQueryParamsMiddleware(req, res, next) {
req.context.allowedQueryParams = params;
next();
};
};