CR suggestions (remove appname)

This commit is contained in:
antoniocarlon
2018-09-10 12:54:37 +02:00
parent 5ea1a4ca6b
commit 4b6b4e92e8
41 changed files with 184 additions and 194 deletions

View File

@@ -1,7 +1,6 @@
CREATE TYPE cdb_dataservices_client._entity_config AS (
username text,
organization_name text,
application_name text,
apikey_permissions json
);
@@ -37,7 +36,6 @@ BEGIN
END IF;
result.username = username;
result.organization_name = organization_name;
result.application_name = apikey_config->'application';
result.apikey_permissions = apikey_config->'permissions';
RETURN result;
END;

View File

@@ -15,13 +15,12 @@ DECLARE
temp_table_name text;
username text;
orgname text;
appname text;
apikey_permissions json;
BEGIN
IF session_user = 'publicuser' OR session_user ~ 'cartodb_publicuser_*' THEN
RAISE EXCEPTION 'The api_key must be provided';
END IF;
SELECT u, o, a, p INTO username, orgname, appname, apikey_permissions FROM cdb_dataservices_client._cdb_entity_config() AS (u text, o text, a text, p json);
SELECT u, o, p INTO username, orgname, apikey_permissions FROM cdb_dataservices_client._cdb_entity_config() AS (u text, o text, p json);
IF apikey_permissions IS NULL OR NOT apikey_permissions::jsonb ? 'geocoding' THEN
RAISE EXCEPTION 'Geocoding is not allowed';
END IF;