From f2c30816a9a7948d19263230d49392a4fee1e2a0 Mon Sep 17 00:00:00 2001 From: Vadim Melnik Date: Tue, 19 Sep 2023 10:50:36 +0300 Subject: [PATCH] Generate API key for system accounts in setup_db --- repromon_tools/setup_db.py | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/repromon_tools/setup_db.py b/repromon_tools/setup_db.py index c54be68..dba3d93 100644 --- a/repromon_tools/setup_db.py +++ b/repromon_tools/setup_db.py @@ -178,6 +178,7 @@ def fill_tables_with_init_data(): sec_svc.set_user_password("admin", pwd) # set user roles + logger.info("set user roles") sec_svc.set_user_roles("user1", [Rolename.DATA_COLLECTOR]) sec_svc.set_user_roles("user2", [Rolename.MRI_OPERATOR]) sec_svc.set_user_roles("user3", [Rolename.PARTICIPANT]) @@ -195,6 +196,7 @@ def fill_tables_with_init_data(): Rolename.SYS_DATA_ENTRY]) # set user devices + logger.info("set user devices") sec_svc.set_user_devices("user1", ["MRI"]) sec_svc.set_user_devices("user2", ["MRI"]) sec_svc.set_user_devices("user3", ["MRI"]) @@ -205,6 +207,14 @@ def fill_tables_with_init_data(): sec_svc.set_user_devices("reproevt", ["MRI"]) sec_svc.set_user_devices("dicomqa", ["MRI"]) sec_svc.set_user_devices("tester1", ["MRI"]) + + # generate API key for system accounts + logger.info("generate API key for system accounts") + sec_svc.renew_user_apikey("noisseur") + sec_svc.renew_user_apikey("reprostim") + sec_svc.renew_user_apikey("reproevt") + sec_svc.renew_user_apikey("dicomqa") + sec_svc.renew_user_apikey("tester1") else: logger.info("skip user fill")