Skip to content

Commit

Permalink
fix: update pgsodium extension scripts (#1397)
Browse files Browse the repository at this point in the history
* fix: pgsodium after-create script

* chore: bump version
  • Loading branch information
soedirgo authored Jan 20, 2025
1 parent 80161e4 commit 66fb5c1
Show file tree
Hide file tree
Showing 3 changed files with 34 additions and 2 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 $$;
4 changes: 2 additions & 2 deletions ansible/vars.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,8 @@ postgres_major:

# Full version strings for each major version
postgres_release:
postgresorioledb-17: "17.0.1.019-orioledb"
postgres15: "15.8.1.029"
postgresorioledb-17: "17.0.1.020-orioledb"
postgres15: "15.8.1.030"

# Non Postgres Extensions
pgbouncer_release: "1.19.0"
Expand Down

0 comments on commit 66fb5c1

Please sign in to comment.