cartodb as dependency and use its config table #37

in the client.
This commit is contained in:
Rafa de la Torre
2015-11-17 12:01:18 +01:00
parent 7cba8fd679
commit b977277052
7 changed files with 14 additions and 52 deletions

View File

@@ -1,12 +1,15 @@
-- Install dependencies
CREATE EXTENSION postgis;
CREATE EXTENSION schema_triggers;
CREATE EXTENSION plpythonu;
CREATE EXTENSION cartodb;
CREATE EXTENSION plproxy;
-- Install the extension
CREATE EXTENSION cdb_geocoder_client;
-- Mock the server connection to point to this very test db
SELECT cdb_geocoder_client._config_set('db_server_config', '{"connection_str": "dbname=contrib_regression host=127.0.0.1 user=postgres"}');
_config_set
-------------
SELECT cartodb.cdb_conf_setconf('geocoder_server_config', '{"connection_str": "dbname=contrib_regression host=127.0.0.1 user=postgres"}');
cdb_conf_setconf
------------------
(1 row)

View File

@@ -75,7 +75,7 @@ PL/pgSQL function cdb_geocoder_client.geocode_postalcode_point(text,text) line 5
(1 row)
SELECT cdb_geocoder_client.geocode_ip('8.8.8.8');
NOTICE: cdb_geocoder_client._geocode_ip(3): [contrib_regression] REMOTE NOTICE: cbd_geocoder_server.geocode_namedplace_point invoked with params (postgres, some_transaction_id, 8.8.8.8)
NOTICE: cdb_geocoder_client._geocode_ip(3): [contrib_regression] REMOTE NOTICE: cbd_geocoder_server.geocode_ip invoked with params (postgres, some_transaction_id, 8.8.8.8)
CONTEXT: SQL statement "SELECT cdb_geocoder_client._geocode_ip(session_user, txid_current(), ip_address)"
PL/pgSQL function cdb_geocoder_client.geocode_ip(text) line 5 at SQL statement
geocode_ip
@@ -102,6 +102,3 @@ SELECT cdb_geocoder_client._geocode_postalcode_point('evil_user', 666, '66666',
ERROR: permission denied for function _geocode_postalcode_point
SELECT cdb_geocoder_client._geocode_ip('evil_user', 666, '8.8.8.8');
ERROR: permission denied for function _geocode_ip
-- Check the regular user cannot look into config table
SELECT * from cdb_geocoder_client._config;
ERROR: permission denied for relation _config