107 lines
9.1 KiB
Plaintext
107 lines
9.1 KiB
Plaintext
-- Use regular user role
|
|
SET ROLE test_regular_user;
|
|
-- Add to the search path the schema
|
|
SET search_path TO "$user",public,cartodb,cdb_geocoder_client;
|
|
-- Exercise the public function
|
|
-- it is public, it shall work
|
|
SELECT cdb_geocode_admin0_polygon('Spain');
|
|
NOTICE: cdb_geocoder_client._cdb_geocode_admin0_polygon(4): [contrib_regression] REMOTE NOTICE: cdb_geocoder_server.cdb_geocode_admin0_polygon invoked with params (postgres, {"is_organization": false, "entity_name": "test_user"}, {"street_geocoder_provider": "nokia","nokia_monthly_quota": 100, "nokia_soft_geocoder_limit": false}, Spain)
|
|
CONTEXT: SQL statement "SELECT cdb_geocoder_client._cdb_geocode_admin0_polygon(session_user, user_config, geocoder_config, country_name)"
|
|
PL/pgSQL function cdb_geocode_admin0_polygon(text) line 12 at SQL statement
|
|
cdb_geocode_admin0_polygon
|
|
----------------------------
|
|
|
|
(1 row)
|
|
|
|
SELECT cdb_geocode_admin1_polygon('California');
|
|
NOTICE: cdb_geocoder_client._cdb_geocode_admin1_polygon(4): [contrib_regression] REMOTE NOTICE: cdb_geocoder_server.cdb_geocode_admin1_polygon invoked with params (postgres, {"is_organization": false, "entity_name": "test_user"}, {"street_geocoder_provider": "nokia","nokia_monthly_quota": 100, "nokia_soft_geocoder_limit": false}, California)
|
|
CONTEXT: SQL statement "SELECT cdb_geocoder_client._cdb_geocode_admin1_polygon(session_user, user_config, geocoder_config, admin1_name)"
|
|
PL/pgSQL function cdb_geocode_admin1_polygon(text) line 12 at SQL statement
|
|
cdb_geocode_admin1_polygon
|
|
----------------------------
|
|
|
|
(1 row)
|
|
|
|
SELECT cdb_geocode_admin1_polygon('California', 'United States');
|
|
NOTICE: cdb_geocoder_client._cdb_geocode_admin1_polygon(5): [contrib_regression] REMOTE NOTICE: cdb_geocoder_server.cdb_geocode_admin1_polygon invoked with params (postgres, {"is_organization": false, "entity_name": "test_user"}, {"street_geocoder_provider": "nokia","nokia_monthly_quota": 100, "nokia_soft_geocoder_limit": false}, California, United States)
|
|
CONTEXT: SQL statement "SELECT cdb_geocoder_client._cdb_geocode_admin1_polygon(session_user, user_config, geocoder_config, admin1_name, country_name)"
|
|
PL/pgSQL function cdb_geocode_admin1_polygon(text,text) line 12 at SQL statement
|
|
cdb_geocode_admin1_polygon
|
|
----------------------------
|
|
|
|
(1 row)
|
|
|
|
SELECT cdb_geocode_namedplace_point('Elx');
|
|
NOTICE: cdb_geocoder_client._cdb_geocode_namedplace_point(4): [contrib_regression] REMOTE NOTICE: cdb_geocoder_server.cdb_geocode_namedplace_point invoked with params (postgres, {"is_organization": false, "entity_name": "test_user"}, {"street_geocoder_provider": "nokia","nokia_monthly_quota": 100, "nokia_soft_geocoder_limit": false}, Elx)
|
|
CONTEXT: SQL statement "SELECT cdb_geocoder_client._cdb_geocode_namedplace_point(session_user, user_config, geocoder_config, city_name)"
|
|
PL/pgSQL function cdb_geocode_namedplace_point(text) line 12 at SQL statement
|
|
cdb_geocode_namedplace_point
|
|
------------------------------
|
|
|
|
(1 row)
|
|
|
|
SELECT cdb_geocode_namedplace_point('Elx', 'Valencia');
|
|
NOTICE: cdb_geocoder_client._cdb_geocode_namedplace_point(5): [contrib_regression] REMOTE NOTICE: cdb_geocoder_server.cdb_geocode_namedplace_point invoked with params (postgres, {"is_organization": false, "entity_name": "test_user"}, {"street_geocoder_provider": "nokia","nokia_monthly_quota": 100, "nokia_soft_geocoder_limit": false}, Elx, Valencia)
|
|
CONTEXT: SQL statement "SELECT cdb_geocoder_client._cdb_geocode_namedplace_point(session_user, user_config, geocoder_config, city_name, country_name)"
|
|
PL/pgSQL function cdb_geocode_namedplace_point(text,text) line 12 at SQL statement
|
|
cdb_geocode_namedplace_point
|
|
------------------------------
|
|
|
|
(1 row)
|
|
|
|
SELECT cdb_geocode_namedplace_point('Elx', 'Valencia', 'Spain');
|
|
NOTICE: cdb_geocoder_client._cdb_geocode_namedplace_point(6): [contrib_regression] REMOTE NOTICE: cdb_geocoder_server.cdb_geocode_namedplace_point invoked with params (postgres, {"is_organization": false, "entity_name": "test_user"}, {"street_geocoder_provider": "nokia","nokia_monthly_quota": 100, "nokia_soft_geocoder_limit": false}, Elx, Valencia, Spain)
|
|
CONTEXT: SQL statement "SELECT cdb_geocoder_client._cdb_geocode_namedplace_point(session_user, user_config, geocoder_config, city_name, admin1_name, country_name)"
|
|
PL/pgSQL function cdb_geocode_namedplace_point(text,text,text) line 12 at SQL statement
|
|
cdb_geocode_namedplace_point
|
|
------------------------------
|
|
|
|
(1 row)
|
|
|
|
SELECT cdb_geocode_postalcode_polygon('03204', 'Spain');
|
|
NOTICE: cdb_geocoder_client._cdb_geocode_postalcode_polygon(5): [contrib_regression] REMOTE NOTICE: cdb_geocoder_server.cdb_geocode_postalcode_polygon invoked with params (postgres, {"is_organization": false, "entity_name": "test_user"}, {"street_geocoder_provider": "nokia","nokia_monthly_quota": 100, "nokia_soft_geocoder_limit": false}, 03204, Spain)
|
|
CONTEXT: SQL statement "SELECT cdb_geocoder_client._cdb_geocode_postalcode_polygon(session_user, user_config, geocoder_config, postal_code, country_name)"
|
|
PL/pgSQL function cdb_geocode_postalcode_polygon(text,text) line 12 at SQL statement
|
|
cdb_geocode_postalcode_polygon
|
|
--------------------------------
|
|
|
|
(1 row)
|
|
|
|
SELECT cdb_geocode_postalcode_point('03204', 'Spain');
|
|
NOTICE: cdb_geocoder_client._cdb_geocode_postalcode_point(5): [contrib_regression] REMOTE NOTICE: cdb_geocoder_server.cdb_geocode_postalcode_point invoked with params (postgres, {"is_organization": false, "entity_name": "test_user"}, {"street_geocoder_provider": "nokia","nokia_monthly_quota": 100, "nokia_soft_geocoder_limit": false}, 03204, Spain)
|
|
CONTEXT: SQL statement "SELECT cdb_geocoder_client._cdb_geocode_postalcode_point(session_user, user_config, geocoder_config, postal_code, country_name)"
|
|
PL/pgSQL function cdb_geocode_postalcode_point(text,text) line 12 at SQL statement
|
|
cdb_geocode_postalcode_point
|
|
------------------------------
|
|
|
|
(1 row)
|
|
|
|
SELECT cdb_geocode_ipaddress_point('8.8.8.8');
|
|
NOTICE: cdb_geocoder_client._cdb_geocode_ipaddress_point(4): [contrib_regression] REMOTE NOTICE: cdb_geocoder_server.cdb_geocode_ipaddress_point invoked with params (postgres, {"is_organization": false, "entity_name": "test_user"}, {"street_geocoder_provider": "nokia","nokia_monthly_quota": 100, "nokia_soft_geocoder_limit": false}, 8.8.8.8)
|
|
CONTEXT: SQL statement "SELECT cdb_geocoder_client._cdb_geocode_ipaddress_point(session_user, user_config, geocoder_config, ip_address)"
|
|
PL/pgSQL function cdb_geocode_ipaddress_point(text) line 12 at SQL statement
|
|
cdb_geocode_ipaddress_point
|
|
-----------------------------
|
|
|
|
(1 row)
|
|
|
|
-- Check the regular user has no permissions on private functions
|
|
SELECT _cdb_geocode_admin0_polygon('evil_user', '{"is_organization": false, "entity_name": "test_user"}', '{"street_geocoder_provider": "nokia","nokia_monthly_quota": 100, "nokia_soft_geocoder_limit": false}', 'Hell');
|
|
ERROR: permission denied for function _cdb_geocode_admin0_polygon
|
|
SELECT _cdb_geocode_admin1_polygon('evil_user', '{"is_organization": false, "entity_name": "test_user"}', '{"street_geocoder_provider": "nokia","nokia_monthly_quota": 100, "nokia_soft_geocoder_limit": false}', 'Hell');
|
|
ERROR: permission denied for function _cdb_geocode_admin1_polygon
|
|
SELECT _cdb_geocode_admin1_polygon('evil_user', '{"is_organization": false, "entity_name": "test_user"}', '{"street_geocoder_provider": "nokia","nokia_monthly_quota": 100, "nokia_soft_geocoder_limit": false}', 'Sheol', 'Hell');
|
|
ERROR: permission denied for function _cdb_geocode_admin1_polygon
|
|
SELECT _cdb_geocode_namedplace_point('evil_user', '{"is_organization": false, "entity_name": "test_user"}', '{"street_geocoder_provider": "nokia","nokia_monthly_quota": 100, "nokia_soft_geocoder_limit": false}', 'Sheol');
|
|
ERROR: permission denied for function _cdb_geocode_namedplace_point
|
|
SELECT _cdb_geocode_namedplace_point('evil_user', '{"is_organization": false, "entity_name": "test_user"}', '{"street_geocoder_provider": "nokia","nokia_monthly_quota": 100, "nokia_soft_geocoder_limit": false}', 'Sheol', 'Hell');
|
|
ERROR: permission denied for function _cdb_geocode_namedplace_point
|
|
SELECT _cdb_geocode_namedplace_point('evil_user', '{"is_organization": false, "entity_name": "test_user"}', '{"street_geocoder_provider": "nokia","nokia_monthly_quota": 100, "nokia_soft_geocoder_limit": false}', 'Sheol', 'Hell', 'Ugly world');
|
|
ERROR: permission denied for function _cdb_geocode_namedplace_point
|
|
SELECT _cdb_geocode_postalcode_polygon('evil_user', '{"is_organization": false, "entity_name": "test_user"}', '{"street_geocoder_provider": "nokia","nokia_monthly_quota": 100, "nokia_soft_geocoder_limit": false}', '66666', 'Hell');
|
|
ERROR: permission denied for function _cdb_geocode_postalcode_polygon
|
|
SELECT _cdb_geocode_postalcode_point('evil_user', '{"is_organization": false, "entity_name": "test_user"}', '{"street_geocoder_provider": "nokia","nokia_monthly_quota": 100, "nokia_soft_geocoder_limit": false}', '66666', 'Hell');
|
|
ERROR: permission denied for function _cdb_geocode_postalcode_point
|
|
SELECT _cdb_geocode_ipaddress_point('evil_user', '{"is_organization": false, "entity_name": "test_user"}', '{"street_geocoder_provider": "nokia","nokia_monthly_quota": 100, "nokia_soft_geocoder_limit": false}', '8.8.8.8');
|
|
ERROR: permission denied for function _cdb_geocode_ipaddress_point
|