Commit Graph

132 Commits

Author SHA1 Message Date
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
2e13bc42a1 Merge branch 'master' into spread-prepare-context-middleware 2018-03-20 11:01:13 +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
Simon Martín
48a7d28aa6 rate limit analysis catalog endpoint 2018-03-14 17:46:19 +01:00
Simon Martín
0e43c54214 Merge branch 'master' into rateLimits 2018-03-13 18:09:44 +01:00
Daniel García Aubert
da18506e41 Follow middleware factory pattern 2018-03-01 18:45:04 +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
e6011287f4 adding middleware to layergroup controller 2018-02-20 11:25:16 +01:00
Daniel García Aubert
dab204ea71 Do not aggregate if rows cout is lower than threshold or the layer's sql has geometries distinct of points 2017-12-11 17:32:06 +01:00
Daniel García Aubert
f376a7cdd5 Use aggregation adapter before the overviews one 2017-12-01 17:05:01 +01:00
Daniel García Aubert
d01857923e Plug aggregation mapconfig adapter 2017-11-30 19:31:00 +01:00
Daniel García Aubert
9ad6d0cbcc Merge branch 'master' into stats-middleware 2017-10-16 15:06:20 +02:00
David Manzanares
d30f710534 Merge remote-tracking branch 'origin/master' into mvt-path-conf 2017-10-10 17:53:28 +02:00
Daniel García Aubert
a81e98995a Merge branch 'middlewarify' into stats-middleware 2017-10-09 17:54:32 +02:00
Simon Martín
06138a82a8 Merge branch 'middlewarify' into res-locals 2017-10-05 17:53:15 +02:00
Simon Martín
2f310a15bd do not overwrite creation of res.locals 2017-10-05 17:23:07 +02:00
Daniel García Aubert
bf637ccd5b Implement stats middleware removing some duplicated code 2017-10-05 17:06:42 +02:00
Daniel García Aubert
b93c09959c Back to use just one router 2017-10-05 12:12:21 +02:00
Simon Martín
21720267cf from req.context to res.locals 2017-10-03 17:47:57 +02:00
David Manzanares
ad1abb28af Add configuration flag to enable/disable direct PgSQL MVT 2017-09-28 12:08:22 +02:00
Daniel García Aubert
4600005a86 Bring ported test back 2017-09-26 17:31:57 +02:00
Daniel García Aubert
4899c7ffef Inject prepare context middleware to controllers 2017-09-25 19:40:27 +02:00
Daniel García Aubert
8fd35849c7 Merge branch 'middlewarify' of github.com:CartoDB/Windshaft-cartodb into middlewarify 2017-09-22 17:15:41 +02:00
Simon
c09899913f finishing integration of lzma middleware 2017-09-22 16:46:39 +02:00
Daniel García Aubert
0bdeee64a7 Use express router to group controllers' enpoints and reuse common middleware for named maps admin controller 2017-09-22 16:45:34 +02:00
Daniel García Aubert
ee8619c470 Use express router to group controllers' enpoints and reuse common middleware for analysis controller 2017-09-22 16:28:52 +02:00
Simon
9d81321d78 Merge branch 'master' into middlewarify 2017-09-22 16:26:56 +02:00
Simon Martín
ca63c2ef1a Merge pull request #721 from CartoDB/lzma-middleware
Implement LZMA query param inflating as middleware
2017-09-22 16:16:36 +02:00
Daniel García Aubert
b0486f9bae Use express router to group enpoints and reuse common middlewares for layergroup controller 2017-09-22 15:44:12 +02:00
Daniel García Aubert
daeae5d95c Implement error-middleware to handle errors at top level 2017-09-21 11:46:42 +02:00
Raul Ochoa
e7c206762d String comparison and regex to match errors instead of indexOf 2017-08-10 16:09:26 +02:00
Daniel García Aubert
14f85abd39 Merge branch 'master' into response-time-limit 2017-08-09 18:48:38 +02:00
Raul Ochoa
399561d076 Implement LZMA query param inflating as middleware
The req2params method is doing too many things,
this is an initial step to do fewer things in that method.
2017-08-04 17:30:46 +02:00
Daniel García Aubert
9258ad7ecc Fix style typo 2017-08-01 12:56:03 +02:00
Daniel García Aubert
4c3e3005aa Apply asset fallback to database timeout errors 2017-08-01 12:52:34 +02:00
Daniel García Aubert
3e12bfe27a Going green: support special numeric values for json responses 2017-06-27 11:53:22 +02:00
Mario de Frutos
c9e6e921cb Merge branch 'master' into 664-layergroup-stats 2017-05-18 13:45:38 +02:00
Daniel García Aubert
53d1b2fbbf Rename mapconfig-named-map-adapter by mapconfig-buffer-size-adapter 2017-05-10 18:16:22 +02:00
Mario de Frutos
daf19c5e27 Stats backend only provides stats not metadata 2017-05-10 17:17:01 +02:00
Mario de Frutos
15c68711aa Create stats backend to decouple stats logic from map controller 2017-05-09 12:31:16 +02:00
Mario de Frutos
525c0f2afa Added rendererCache as dependency for map controller 2017-05-09 11:58:48 +02:00
Mario de Frutos
be58adb1b9 Be able to override buffer-size configuration without placeholders in named maps 2017-04-28 19:20:00 +02:00
Raul Ochoa
cd978d7384 Retrieve analysis limits and pass them into camshaft 2016-10-11 15:46:11 +02:00
Daniel García Aubert
10feea0d48 Pass logger configuration to analysis backend and create a stream based on config 2016-09-23 17:11:04 +02:00
Raul Ochoa
3af340d384 Add controller to list user analyses 2016-07-12 16:08:48 +02:00
Raul Ochoa
863128013d Use psql client instead of pg query runner to use proper params 2016-06-21 12:08:40 +02:00
Raul Ochoa
b10e4c11d9 Warn on application start about non-matching dependencies 2016-06-06 12:07:43 +02:00
Raul Ochoa
f602ea88e2 Convert widgets from layers into dataviews
It also converts filters so full dataviews backend is reusable, that removes
widgets backend dependency.
2016-05-26 19:32:58 +02:00