Create pgcrypto extension into auth schema

Will only be used there, no need to be in public, and this way i can
limit the search_path for security definer functions.
This commit is contained in:
jordi fita mas 2023-01-17 13:12:18 +01:00
parent 45439c8559
commit 8fd22672c7
3 changed files with 4 additions and 4 deletions

View File

@ -1,8 +1,8 @@
-- Deploy numerus:extension_pgcrypto to pg
-- requires: schema_public
-- requires: schema_auth
begin;
create extension if not exists pgcrypto;
create extension if not exists pgcrypto with schema auth;
commit;

View File

@ -10,7 +10,7 @@ extension_citext [schema_public] 2023-01-12T23:03:33Z jordi fita i mas <jfita@in
email [schema_numerus extension_citext] 2023-01-12T23:09:59Z jordi fita i mas <jfita@infoblitz.com> # Add email domain
user [roles schema_auth email] 2023-01-12T23:44:03Z jordi fita i mas <jfita@infoblitz.com> # Create user table
ensure_role_exists [schema_auth user] 2023-01-12T23:57:59Z jordi fita i mas <jfita@infoblitz.com> # Add trigger to ensure the users role exists
extension_pgcrypto [schema_public] 2023-01-13T00:11:50Z jordi fita i mas <jfita@infoblitz.com> # Add pgcrypto extension
extension_pgcrypto [schema_auth] 2023-01-13T00:11:50Z jordi fita i mas <jfita@infoblitz.com> # Add pgcrypto extension
encrypt_password [schema_auth user extension_pgcrypto] 2023-01-13T00:14:30Z jordi fita i mas <jfita@infoblitz.com> # Add trigger to encrypt users password
find_user_role [schema_auth user email] 2023-01-13T00:22:34Z jordi fita i mas <jfita@infoblitz.com> # Add function to find a users role given its email and password
login [roles schema_numerus email user find_user_role] 2023-01-13T00:32:32Z jordi fita i mas <jfita@infoblitz.com> # Add function to login

View File

@ -7,7 +7,7 @@ begin;
select plan(12);
set search_path to numerus, public;
set search_path to numerus, auth, public;
select has_function('login');
select function_lang_is('login', array ['email', 'text'], 'plpgsql');