Commit Graph
144 Commits
Author SHA1 Message Date
Daniel García Aubert d5c591317b Add coordinates validation to specific endpoints 2018-04-16 18:55:42 +02:00
Simon Martín c94d782037 calling to new createAffectedTables 2018-04-06 13:00:12 +02:00
Daniel García Aubert d3e2707fce Tidy middlewares up: put rate limit middleware after authorization 2018-03-23 17:55:41 +01:00
Daniel García Aubert 4cba4c7a1f Tidy middlewares up: cleanUpQeuryParams 2018-03-23 17:37:06 +01:00
Daniel García Aubert 3b1fd05940 Use layergroup token middleware where it's actually needed 2018-03-23 17:24:56 +01:00
Daniel García Aubert 5fc801f8a6 Do not use locals middleware in named maps controller 2018-03-23 16:38:55 +01:00
Daniel García Aubert d3c9da6d5f Fix layer filter by query params 2018-03-23 11:57:28 +01:00
Daniel García Aubert 97a49fab2f Remove function defined but nerver used 2018-03-23 11:33:40 +01:00
Daniel García Aubert 10ead27676 Pass only needed properties to named map provider cache (static endpoint) 2018-03-23 11:23:19 +01:00
Daniel García Aubert 8be7ea5cc1 Pass only needed properties to named map provider cache 2018-03-23 11:01:36 +01:00
Daniel García Aubert e542d38ec7 Reorder middleware 2018-03-22 11:38:33 +01:00
Daniel García Aubert 72c4a7abd6 Extract cache control header middleware 2018-03-21 16:38:37 +01:00
Daniel García Aubert a142620b70 Make generic middlewares to calculate surrogate key and cache channel headers:
- In controllers: all reference to map config are now camelized, for instance: mapconfig -> mapConfig or mapconfigProvider -> mapConfigProvider
 - In controllers: all map config providers created in req/res cycle are saved into `res.locals` and `mapConfigProvider` as key.
 - In map-config-providers: all of them implement `.getAffectedTables()`, in order to calculate the tables involved for a given map-config. For that, `pgConnection` and `affectedTablesCache` are injected as constructor argument.
 - Named Map Provider: rename references from `affectedTablesAndLastUpdate` to `affectedTables`.
 - Named Map Provider Cache: In order to create new named map providers, needs affectedTablesCache.
 - Extract locals middlewares (surrogate-key and cache-channel) from controllers and create an unified version of them.
 - Extract last-modified middleware from named maps controller (draft).
2018-03-21 14:11:54 +01:00
Daniel García Aubert df999e040c Merge branch 'spread-prepare-context-middleware' into unify-middlewares 2018-03-20 11:06:31 +01:00
Daniel García Aubert 2e13bc42a1 Merge branch 'master' into spread-prepare-context-middleware 2018-03-20 11:01:13 +01:00
Daniel García Aubert 9211fa065b Extract sendResponse middleware 2018-03-19 19:48:14 +01:00
Simon Martín a830eb4ea0 Merge branch 'master' into rateLimits 2018-03-19 11:25:13 +01:00
Daniel García Aubert e52cd28f1e User res.body as placeholder of the response's body 2018-03-16 17:13:48 +01:00
Daniel García Aubert 313fc75ec8 Rename middleware 2018-03-16 16:28:50 +01:00
Daniel García Aubert 639a69a639 Reorder middlewares to optimize workflow 2018-03-16 16:12:36 +01:00
Daniel García Aubert 0aa8d63a6e Unifiy allowQueryParams and cleanUpQueryParams middlewares 2018-03-16 14:03:59 +01:00
Daniel García Aubert 071a5a4bdf Rename base paths 2018-03-16 13:04:42 +01:00
Daniel García Aubert 7ff7b0c2d1 Extract rest of the middlewares from prepare contex 2018-03-15 19:38:11 +01:00
Daniel García Aubert 30dab7df9f Extract authorize middeware form prepareContext 2018-03-15 18:48:29 +01:00
Daniel García Aubert afff06c7e6 Extract db-conn-setup middleware for prepare-context 2018-03-15 15:33:20 +01:00
Daniel García Aubert 04146f897d Use template strings 2018-03-14 17:33:54 +01:00
Daniel García Aubert f078713d28 typo 2018-03-14 17:15:50 +01:00
Daniel García Aubert a8d31d52cf Pass only required params 2018-03-14 17:08:04 +01:00
Daniel García Aubert 091efe52fc Extract sendResponse middleware from context 2018-03-14 13:32:43 +01:00
Daniel García Aubert a5c508733a Extract setContentTypeHeader middleware from controller's context 2018-03-14 13:31:39 +01:00
Daniel García Aubert ce944d9a7d Extract setCacheControlHeader from controller's context 2018-03-14 13:30:27 +01:00
Daniel García Aubert 8321b5adba Extract setLastModifiedHeader from controller's context 2018-03-14 13:27:56 +01:00
Daniel García Aubert 667c972308 Extract setCacheChannelHeader and setSurrogateKeyHeader from controller's context 2018-03-14 13:25:42 +01:00
Daniel García Aubert 3dbe05be3a Extarct setCacheChannelHeader middleware from controller's context 2018-03-14 13:19:56 +01:00
Daniel García Aubert 2d4ce19250 Extract incrementMapViews middleware from controllers middleware 2018-03-14 13:18:37 +01:00
Daniel García Aubert 3b3e0c0acd Extract getImage middleware from controller's context 2018-03-14 13:15:38 +01:00
Daniel García Aubert c3ddb933bb Extract getStaticImageOptions middleware from controller's context 2018-03-14 13:11:17 +01:00
Daniel García Aubert 6aae60ece7 Extract getTile middleware from controller's context 2018-03-14 13:07:40 +01:00
Daniel García Aubert 6b3dc8ece0 Extract prepareLayerFilterFromPreviewLayers middleware from controller's context 2018-03-14 13:05:05 +01:00
Daniel García Aubert 7dd231a8c9 Extract getTemplate middleware form controller's context 2018-03-14 13:02:49 +01:00
Daniel García Aubert 35a3219012 Extract getAffectedTables middleware from controller's context 2018-03-14 13:01:07 +01:00
Daniel García Aubert 7598e6ab4b Extract getNamedMapProvider middleware from controller's context 2018-03-14 12:58:56 +01:00
Simon Martín 0e43c54214 Merge branch 'master' into rateLimits 2018-03-13 18:09:44 +01:00
Daniel 8509796743 Merge pull request #882 from CartoDB/middleware-refactor
Middleware refactor
2018-03-07 15:19:04 +01:00
Daniel García Aubert 5de8c4f9c3 Make explicit that forceFormat is optional 2018-03-05 11:19:17 +01:00
Daniel García Aubert 6331bebb30 Going green: be able to request defaul named tiles in vector format 2018-03-02 18:25:23 +01:00
Daniel García Aubert b0c924ca03 Follow middleware pattern, should return a function as the actual middleware 2018-03-01 15:42:03 +01:00
Simon Martín 335d91b42d separate rate limit logic from middleware and EVALSHA 2018-02-28 13:11:18 +01:00
Simon Martín 254991c56c changing endpoint groups constant keys 2018-02-27 17:57:25 +01:00
Simon Martín b0d63b2ec0 changing module exports and middleware name 2018-02-27 16:52:27 +01:00