-
-
Notifications
You must be signed in to change notification settings - Fork 196
fix: grant pgsodium functions to service_role #443
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from 1 commit
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
- Loading branch information
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -510,25 +510,6 @@ END; | |
$$; | ||
|
||
|
||
-- | ||
-- Name: key_encrypt_secret(); Type: FUNCTION; Schema: pgsodium; Owner: - | ||
-- | ||
|
||
CREATE FUNCTION pgsodium.key_encrypt_secret() RETURNS trigger | ||
LANGUAGE plpgsql | ||
AS $$ | ||
BEGIN | ||
new.raw_key = CASE WHEN new.raw_key IS NULL THEN NULL ELSE | ||
CASE WHEN new.parent_key IS NULL THEN NULL ELSE | ||
pgsodium.crypto_aead_det_encrypt(new.raw_key::bytea, pg_catalog.convert_to((new.id::text || new.associated_data::text)::text, 'utf8'), | ||
new.parent_key::uuid, | ||
new.raw_key_nonce | ||
) END END; | ||
RETURN new; | ||
END; | ||
$$; | ||
|
||
|
||
-- | ||
-- Name: extension(text); Type: FUNCTION; Schema: storage; Owner: - | ||
-- | ||
|
@@ -754,35 +735,6 @@ CREATE TABLE auth.users ( | |
COMMENT ON TABLE auth.users IS 'Auth: Stores user login data within a secure schema.'; | ||
|
||
|
||
-- | ||
-- Name: decrypted_key; Type: VIEW; Schema: pgsodium; Owner: - | ||
-- | ||
|
||
CREATE VIEW pgsodium.decrypted_key AS | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. @michelp do you know why this got dropped now? If I recreate There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I think I got it - this was fixed in pgsodium 3.1.1 but now this issue is back, so we need to revert the migration. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. (I'll hold off on reverting it until Michel's done with the pgsodium fixes) |
||
SELECT key.id, | ||
key.status, | ||
key.created, | ||
key.expires, | ||
key.key_type, | ||
key.key_id, | ||
key.key_context, | ||
key.name, | ||
key.associated_data, | ||
key.raw_key, | ||
CASE | ||
WHEN (key.raw_key IS NULL) THEN NULL::bytea | ||
ELSE | ||
CASE | ||
WHEN (key.parent_key IS NULL) THEN NULL::bytea | ||
ELSE pgsodium.crypto_aead_det_decrypt(key.raw_key, convert_to(((key.id)::text || key.associated_data), 'utf8'::name), key.parent_key, key.raw_key_nonce) | ||
END | ||
END AS decrypted_raw_key, | ||
key.raw_key_nonce, | ||
key.parent_key, | ||
key.comment | ||
FROM pgsodium.key; | ||
|
||
|
||
-- | ||
-- Name: schema_migrations; Type: TABLE; Schema: public; Owner: - | ||
-- | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The
schema
test has been failing for a while, so I guess this just reflects the latest pgsodium version.There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
https://github.com/michelp/pgsodium/blob/060e27fc93a53999d94c58170627a443f0eb8d0c/sql/pgsodium--3.1.0--3.1.1.sql#L178