Secured configuration access

This commit is contained in:
Juan Ignacio Sánchez Lara 2015-08-19 11:20:06 +02:00
parent e1dde3c36c
commit 70fe432102
2 changed files with 11 additions and 2 deletions

View File

@ -1,3 +1,10 @@
----------------------------------
-- CONF MANAGEMENT FUNCTIONS
--
-- Meant to be used by superadmin user.
-- Functions needing reading configuration should use SECURITY DEFINER.
----------------------------------
-- This will trigger NOTICE if CDB_CONF already exists
DO LANGUAGE 'plpgsql' $$
BEGIN
@ -32,7 +39,7 @@ BEGIN
EXECUTE 'select cartodb._CDB_Conf_Cache(''get'', $1) as conf;' INTO conf USING param;
RETURN conf;
END
$$ LANGUAGE PLPGSQL STABLE SECURITY DEFINER;
$$ LANGUAGE PLPGSQL STABLE;
-- Single cache function allowing SD private dict usage
CREATE OR REPLACE

View File

@ -66,6 +66,8 @@ $$ LANGUAGE 'plpythonu' VOLATILE;
DO LANGUAGE 'plpgsql' $$
BEGIN
-- Needed for dropping type
DROP FUNCTION IF EXISTS cartodb._CDB_Group_API_Conf();
DROP TYPE IF EXISTS _CDB_Group_API_Params;
END
$$;
@ -136,4 +138,4 @@ $$
raise last_err
return None
$$ LANGUAGE 'plpythonu' VOLATILE;
$$ LANGUAGE 'plpythonu' VOLATILE SECURITY DEFINER;