Daniel García Aubert
730b29c9cc
Remove defined dependecies but never used
2018-04-11 18:51:44 +02:00
Daniel García Aubert
e06d3200c3
Use a better API to define public routes
2018-04-11 12:33:07 +02:00
Daniel García Aubert
c0943a7c58
Use config to define base path for express routers
2018-04-10 20:26:36 +02:00
Daniel García Aubert
ac615b4a25
Merge branch 'separate-routers' into improve-folder-structure
2018-04-10 16:15:49 +02:00
Daniel García Aubert
d1a4057a8d
Rename user limits api by user limits backend
2018-04-10 10:16:07 +02:00
Daniel García Aubert
8519d2724b
Rename tables extent api by tables extent backend
2018-04-10 09:40:09 +02:00
Daniel García Aubert
ba36a47228
Rename overviews metadata api by overviews metadata backend
2018-04-09 19:47:43 +02:00
Daniel García Aubert
e0d8dc0334
Rename filter stats api by filter stats backend
2018-04-09 18:56:01 +02:00
Daniel García Aubert
8dec4814a9
Rename AuthAppi by AuthBackend
2018-04-09 18:08:56 +02:00
Daniel García Aubert
6167562758
Meet application logic and folder struture
2018-04-09 16:18:30 +02:00
Daniel García Aubert
25aa967146
Forbid access to named map admin resources for everyone but master
2018-04-06 15:26:11 +02:00
Daniel García Aubert
f76606bc26
Do not use locals middleware in layergroup controller
2018-03-23 14:13:27 +01:00
Simon Martín
0e43c54214
Merge branch 'master' into rateLimits
2018-03-13 18:09:44 +01:00
Simon Martín
9bc9fc46ff
using cartodb-redis for rate limit
2018-03-03 14:46:39 +01:00
Simon Martín
a2bf235553
Merge branch 'master' into rateLimits
2018-03-02 21:21:10 +01:00
Simon Martín
4dd404771e
refactoring user_limits_api
2018-03-02 16:07:42 +01:00
Simon Martín
136c6fa70b
new redis keys
2018-03-01 15:50:40 +01:00
Daniel García Aubert
62deda6470
Improve naming
2018-02-28 19:13:49 +01:00
Simon Martín
335d91b42d
separate rate limit logic from middleware and EVALSHA
2018-02-28 13:11:18 +01:00
Daniel García Aubert
603ef4044c
Reduce cyclomatic complexity
2018-02-19 18:48:02 +01:00
Daniel García Aubert
2e3abfb2cd
Catch "name not found" errors from metadata backend and set http code status 404
2018-02-19 18:28:58 +01:00
Eneko Lakasta
7e14247ea9
remove cause of unreachable code/dead code. Not necessary because carto redis assures at least the default api key
2018-02-19 17:06:59 +01:00
Eneko Lakasta
7b21bd26d0
Merge branch 'project-auth-api' into project-auth-api-fallback
2018-02-16 11:29:36 +01:00
Eneko Lakasta
4ac224688c
in fallback mode, use default api key if api key token doesnt exist
2018-02-16 11:20:04 +01:00
Eneko Lakasta
cda2616a8a
get and check api key credentials from api key: username and token
2018-02-15 17:49:47 +01:00
Eneko Lakasta
fc420c2c0f
use for compatibility res.locals.api_key instead of res.locals.apikeyToken
2018-02-15 15:19:09 +01:00
Eneko Lakasta
5db0e9c8d8
add middleware for apikeyToken
2018-02-15 12:50:42 +01:00
Eneko Lakasta
963737d3fb
create lib for getting api key token from request
2018-02-15 11:36:42 +01:00
Eneko Lakasta
890f0d1ef6
add fallback for using metadata fallback
2018-02-14 17:31:05 +01:00
Eneko Lakasta
e1a2ee2381
control API access grants
2018-02-08 13:07:25 +01:00
Eneko Lakasta
6ebf51ce45
let select apikey type in setDBAuth: regular, default, master
2018-02-08 11:29:17 +01:00
Eneko Lakasta
41f3606572
return unauthorized error when api key not found
2018-02-07 19:12:14 +01:00
Eneko Lakasta
ea0542dcb1
remove use of step
2018-02-07 18:48:59 +01:00
Eneko Lakasta
a4dbc1bac2
remove step and check existance of proper api key
2018-02-07 18:20:56 +01:00
Eneko Lakasta
95538707c9
add parameter asMaster to setDBAuth
2018-02-07 17:14:13 +01:00
Simon Martín
9083fc2e20
fix forgotten comment
2017-10-05 12:44:03 +02:00
Simon Martín
1f03a6b181
using res.locals instead of params in AuthApi
2017-10-05 11:28:41 +02:00
Simon Martín
ec8fcc7302
change param name and comments updated
2017-10-04 12:50:27 +02:00
Simon Martín
21720267cf
from req.context to res.locals
2017-10-03 17:47:57 +02:00
Simon Martín
3ce10690d6
send res.locals instead of res when possible
2017-10-03 13:06:12 +02:00
Simon Martín
b4d03c074a
not move db params to res.locals.db
2017-09-29 11:07:11 +02:00
Simon Martín
4a2cc6a5f8
res.locals in auth_api
2017-09-28 11:55:36 +02:00
Raul Ochoa
23edf78a67
Remove unnecessary step
2017-08-10 15:58:25 +02:00
Daniel García Aubert
3574700c2d
Remove tiler render limit
2017-08-02 11:07:44 +02:00
Daniel García Aubert
ab879e2634
Use new version of getUserTimeoutRenderLimits
2017-08-01 19:13:55 +02:00
Daniel García Aubert
669707b26c
Fix typo
2017-07-18 11:56:54 +02:00
Daniel García Aubert
0684c1b9d3
Work in progress: get timeout from redis
2017-07-05 19:08:19 +02:00
Raul Ochoa
cad02bfad7
Remove all conditional branches to call req.profiler
...
req.profiler is created in a middleware for all requests.
2017-03-30 20:31:53 +02:00
Raul Ochoa
c539d4fbbd
Change camshaft naming from filters
2016-07-06 21:11:39 +02:00
Javier Goizueta
48415fb1f3
Merge branch 'master' into overviews-widgets-2
2016-05-18 13:58:55 +02:00
Javier Goizueta
e1aa0bc7ae
Use JSON format for EXPLAIN
2016-05-18 13:09:55 +02:00
Javier Goizueta
7f7204df6c
Add filter stats information to query rewriter data
2016-05-17 15:41:31 +02:00
Raul Ochoa
8fb35571fe
Adds support for mapnik substitution token at turbo-carto level
...
Goes green and fixes #455
2016-05-17 15:00:18 +02:00
Raul Ochoa
3e4f71d873
Nicer error message when missing sql from layer options
...
Fixes #446
2016-05-11 18:24:47 +02:00
Javier Goizueta
084b3e94a6
Remove unneeded variable
2016-04-20 18:01:34 +02:00
Javier Goizueta
a0445b5cdd
💄 Fix indentation
...
2 spaces were used instead of 4 in some places
2016-04-20 17:47:43 +02:00
Javier Goizueta
ecbae52abe
Refactor: use reduce for collecting overviews metadata
2016-04-20 17:24:16 +02:00
Javier Goizueta
57cba3d511
Fix comment
2016-04-20 14:30:13 +02:00
Javier Goizueta
7902b276ad
Support unneeded schema names in overviews queries
...
Fixes #420
Keep table schema of overviews base tables and use it
to support queries that use the schema name when not
strictly needed.
2016-04-19 22:50:05 +02:00
Raul Ochoa
94c7bc41be
Merge branch 'master' into new_querytables_library
2016-03-03 19:30:51 +01:00
Javier Goizueta
f0a1e7a0e0
Simplify error passing
2016-02-23 18:15:14 +01:00
Javier Goizueta
21f3c8a387
Change error messages when getting overviews metadata fails
...
Remove the detail that the error occurred trying to get overviews
metadata from the error message. This should be less confusing
to the user.
2016-02-23 11:45:26 +01:00
Alejandro Martínez
2d6ee93448
Delete query_tables_api.js, wrap shrinkwrap
2016-02-22 13:40:20 +00:00
Alejandro Martínez
cf06ff86c2
Use node-cartodb-query-tables library
2016-02-22 11:40:25 +01:00
Alejandro Martínez
9e7b288f44
Merge remote-tracking branch 'origin/master' into new_querytables
2016-02-15 11:47:29 +00:00
Alejandro Martínez
b7ff554209
Use new _Updated_At function and new names
2016-02-11 11:45:09 +01:00
Alejandro Martínez
95ab99be4d
Use new CDB_QueryTablesUpdatedAt function
2016-02-09 19:06:34 +01:00
Javier Goizueta
0a218da835
Implement an Overviews query rewriter
...
Use the Windshaft query-rewriter interface to adapt queries so
they use available overview tables.
This requires a version of Windshaft that implements the query-rewriter
interface (package.json/npm-shrinkwap.json have yet to be updated)
2016-02-04 10:26:31 +01:00
Javier Goizueta
3b6abb5c9f
Refactor construction of OverviewsApi
2016-01-26 11:49:41 +01:00
Javier Goizueta
ef9e9f8c78
Adapt to changes in CDB_Overviews SQL function
...
Now data for multiple tables is obtained in one call, simplifying the
use of this function. Also base table is returned as an oid, so we
now have the overview base table names with schema only when needed.
2016-01-26 11:38:21 +01:00
Javier Goizueta
8d691b2048
Refactor OverviewsApi
...
Separate metadata processing into collecting each layer's information (map)
and then organizing metadata per tables/zoom levels (reduce).
2016-01-22 11:03:01 +01:00
Javier Goizueta
62cc53228c
OverviewApi: skip tables with no overlays in result
2016-01-21 13:35:56 +01:00
Javier Goizueta
09568050d6
Fix for changes in pgQueryRunner
2016-01-20 13:13:02 +01:00
Javier Goizueta
2f2f6114e8
Refactor coding style
...
Hide the fact that we define functions in a loop from jshint!
2016-01-20 12:42:43 +01:00
Javier Goizueta
8a49e46626
Accept minor jshint suggestions
2016-01-20 11:51:46 +01:00
Javier Goizueta
9feae66173
Bugfixes
2016-01-20 11:49:17 +01:00
Javier Goizueta
6aa9515fd1
Merge branch 'master' into overviews-work
2016-01-20 10:19:27 +01:00
Javier Goizueta
54854f0984
Avoid wrapper-functions to capture looping variable values
...
Use async-queue defer additional parameters
2016-01-20 10:07:19 +01:00
Javier Goizueta
89590d32df
Sketch of vector overviews support
2016-01-19 19:31:43 +01:00
Raul Ochoa
76cbc2f863
Improve PgQueryRunner public run method
...
Last param is callback function, receiving err + result, no need to
keep passing two functions, the query handler and the final callback.
It should be easier to understand now as query handler was in a position
where it had to know about receiving a callback, that was exposing an
implementation detail of PgQueryRunner.
2015-12-30 17:44:49 +01:00
Raul Ochoa
57284a9398
style
2015-09-23 13:05:35 +02:00
Raul Ochoa
9c6c63c167
More strict jshint
2015-07-15 15:03:28 +02:00
Raul Ochoa
d426702213
Merge branch 'master' into standalone-server
2015-07-14 16:24:39 +02:00
Raul Ochoa
e8b5845174
Shared cache for affected tables in layergroup and map controllers
2015-07-14 13:40:41 +02:00
Raul Ochoa
b05701be61
Authentication/Authorization moves to its own entity
2015-07-13 15:05:03 +02:00
Raul Ochoa
f9554ec761
Re-enable render limits
2015-07-10 19:10:55 +02:00
Rafa de la Torre
90d0b23441
Use CDB_QueryTablesText instead of CDB_QueryTables
...
This avoids trouble with len(schema.table_name) > 63
See https://github.com/CartoDB/cartodb-postgresql/issues/86
2015-06-24 15:43:04 +02:00
Raul Ochoa
8503a5c7c9
Tables extent API: returns estimated bounds for a list of tables
2015-04-27 12:55:20 +02:00
Raul Ochoa
2de0e5d52b
Extracts psql query run to its own class to be reusable
2015-04-27 12:48:34 +02:00
Raul Ochoa
07297f6bda
Remove cdbQueryTablesFromPostgres option, now uses it by default
2015-03-23 14:44:42 +01:00
Raul Ochoa
8c09dfd230
No capitalize step
2015-03-16 00:21:55 +01:00
Raul Ochoa
fda8afdaf2
jshint: fix Bad line breaking
2015-03-15 23:44:45 +01:00
Raul Ochoa
90b22b2718
QueryTables and last updated_at retrieved with user
...
Move setDBAuth and setDBConn to PgConnection entity
- It uses cartodb-redis to retrieve datasource configuration
Start using it in ServerOptions, TemplateMaps and QueryTablesApi
QueryTablesApi don't receive anymore the connection/credentials
- It will always use an authenticated query to retrieve last update
- That will allow to query affected private tables last update
2015-02-09 14:46:52 +01:00
Raul Ochoa
09527b6808
Remove no longer needed method from query_tables_api
2015-02-05 17:08:20 +01:00
Raul Ochoa
774104b34e
Defaults resultSet to object if undefined in QueryTablesApi
2014-10-13 15:24:14 +02:00
Raul Ochoa
65e0364d37
Removes duplicated code in query_tables_api
2014-08-22 12:52:05 +02:00
Raul Ochoa
965e1cd0c4
Supports !scale_denominator!
dynamic param in SQL queries
2014-08-22 10:16:39 +02:00
Raul Ochoa
5cf79c82bb
Configurable QueryTablesAPI to call directly postgresql using cartodb-psql
...
or to keep using a request to the SQL API
2014-08-06 21:48:08 +02:00
Raul Ochoa
d1373bec66
Improves SQL query for affected tables and last updated time
2014-08-04 17:48:59 +02:00
Raul Ochoa
507a6a8979
CDB-3686 Style changes
2014-08-04 01:32:49 +02:00