-
Notifications
You must be signed in to change notification settings - Fork 5
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
#3625 Moved request_file_access from admin support api to disseminati… (
#4249) * #3625 Moved request_file_access function from admin support to dissemination * Missed to rename these references * #3625 Updated code to match recent change in main
- Loading branch information
Showing
9 changed files
with
717 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
DO | ||
$do$ | ||
BEGIN | ||
IF EXISTS ( | ||
SELECT FROM pg_catalog.pg_roles | ||
WHERE rolname = 'authenticator') THEN | ||
RAISE NOTICE 'Role "authenticator" already exists. Skipping.'; | ||
ELSE | ||
CREATE ROLE authenticator LOGIN NOINHERIT NOCREATEDB NOCREATEROLE NOSUPERUSER; | ||
END IF; | ||
END | ||
$do$; | ||
|
||
DO | ||
$do$ | ||
BEGIN | ||
IF EXISTS ( | ||
SELECT FROM pg_catalog.pg_roles | ||
WHERE rolname = 'api_fac_gov') THEN | ||
RAISE NOTICE 'Role "api_fac_gov" already exists. Skipping.'; | ||
ELSE | ||
CREATE ROLE api_fac_gov NOLOGIN; | ||
END IF; | ||
END | ||
$do$; | ||
|
||
GRANT api_fac_gov TO authenticator; | ||
|
||
NOTIFY pgrst, 'reload schema'; |
43 changes: 43 additions & 0 deletions
43
backend/support/api/admin_api_v1_1_1/create_access_tables.sql
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,43 @@ | ||
-- This is explicitly not a Django managed table. | ||
-- In order to have an administrative key added, | ||
-- it must be added via a Github commit, and a PR | ||
-- must be performed to merge the key into the tree. | ||
|
||
-- This is because administrative keys can read/write | ||
-- to some tables in the database. They can read internal and | ||
-- in-flight data. | ||
|
||
DROP TABLE IF EXISTS support_administrative_key_uuids; | ||
|
||
CREATE TABLE support_administrative_key_uuids | ||
( | ||
id BIGSERIAL PRIMARY KEY, | ||
email TEXT, | ||
uuid TEXT, | ||
permissions TEXT, | ||
added DATE | ||
); | ||
|
||
INSERT INTO support_administrative_key_uuids | ||
(email, uuid, permissions, added) | ||
VALUES | ||
( | ||
'[email protected]', | ||
'61ba59b2-f545-4c2f-9b24-9655c706a06c', | ||
'CREATE,READ,DELETE', | ||
'2023-12-04' | ||
), | ||
( | ||
'[email protected]', | ||
'b6e08808-ecb2-4b6a-b928-46d4205497ff', | ||
'CREATE,READ,DELETE', | ||
'2023-12-08' | ||
), | ||
( | ||
'[email protected]', | ||
'dd60c3f9-053d-4d82-a309-c89da53559f4', | ||
'CREATE,READ,DELETE', | ||
'2024-07-10' | ||
) | ||
; | ||
|
Oops, something went wrong.