Skip to content

Commit

Permalink
Generate API key for system accounts in setup_db
Browse files Browse the repository at this point in the history
  • Loading branch information
vmdocua committed Sep 19, 2023
1 parent e1127fc commit f2c3081
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions repromon_tools/setup_db.py
Original file line number Diff line number Diff line change
Expand Up @@ -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])
Expand All @@ -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"])
Expand All @@ -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")

Expand Down

0 comments on commit f2c3081

Please sign in to comment.