Skip to content

Commit

Permalink
Merge branch 'develop' into sam/postgis-tiger-fix
Browse files Browse the repository at this point in the history
  • Loading branch information
samrose authored Jan 21, 2025
2 parents 2e2fab6 + 66fb5c1 commit 0d0eb2f
Show file tree
Hide file tree
Showing 2 changed files with 32 additions and 0 deletions.
Original file line number Diff line number Diff line change
@@ -1,3 +1,26 @@
grant execute on function pgsodium.crypto_aead_det_decrypt(bytea, bytea, uuid, bytea) to service_role;
grant execute on function pgsodium.crypto_aead_det_encrypt(bytea, bytea, uuid, bytea) to service_role;
grant execute on function pgsodium.crypto_aead_det_keygen to service_role;

CREATE OR REPLACE FUNCTION pgsodium.mask_role(masked_role regrole, source_name text, view_name text)
RETURNS void
LANGUAGE plpgsql
SECURITY DEFINER
SET search_path TO ''
AS $function$
BEGIN
EXECUTE format(
'GRANT SELECT ON pgsodium.key TO %s',
masked_role);

EXECUTE format(
'GRANT pgsodium_keyiduser, pgsodium_keyholder TO %s',
masked_role);

EXECUTE format(
'GRANT ALL ON %I TO %s',
view_name,
masked_role);
RETURN;
END
$function$;
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
do $$
declare
_extversion text := @extversion@;
_r record;
begin
if _extversion is not null and _extversion != '3.1.8' then
raise exception 'only pgsodium 3.1.8 is supported';
end if;
end $$;

0 comments on commit 0d0eb2f

Please sign in to comment.