From 8d698cf27516cd3024e5a88b1521e08a83dfcc35 Mon Sep 17 00:00:00 2001 From: mike cullerton Date: Thu, 6 May 2021 15:31:33 -0400 Subject: [PATCH] Added explicit config values for `FRONTEND` and `BPMN` hostname and port. Use these new values to define `CORS_ALLOW_ORIGINS` Removed unused `FRONTEND_AUTH_CALLBACK` --- config/default.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/config/default.py b/config/default.py index d9af6a76..464b4ef7 100644 --- a/config/default.py +++ b/config/default.py @@ -18,7 +18,9 @@ NAME = "CR Connect Workflow" DEFAULT_PORT = "5000" FLASK_PORT = environ.get('PORT0') or environ.get('FLASK_PORT', default=DEFAULT_PORT) FRONTEND = "localhost:4200" -CORS_ALLOW_ORIGINS = re.split(r',\s*', environ.get('CORS_ALLOW_ORIGINS', default="localhost:4200, localhost:5002")) +BPMN = "localhost:5002" +CORS_DEFAULT = f'{FRONTEND}, {BPMN}' +CORS_ALLOW_ORIGINS = re.split(r',\s*', environ.get('CORS_ALLOW_ORIGINS', default=CORS_DEFAULT)) TESTING = environ.get('TESTING', default="false") == "true" PRODUCTION = (environ.get('PRODUCTION', default="false") == "true") TEST_UID = environ.get('TEST_UID', default="dhf8r") @@ -51,7 +53,6 @@ SQLALCHEMY_DATABASE_URI = environ.get( TOKEN_AUTH_TTL_HOURS = float(environ.get('TOKEN_AUTH_TTL_HOURS', default=24)) SECRET_KEY = environ.get('SECRET_KEY', default="Shhhh!!! This is secret! And better darn well not show up in prod.") -FRONTEND_AUTH_CALLBACK = environ.get('FRONTEND_AUTH_CALLBACK', default="http://localhost:4200/session") SWAGGER_AUTH_KEY = environ.get('SWAGGER_AUTH_KEY', default="SWAGGER") # %s/%i placeholders expected for uva_id and study_id in various calls. PB_ENABLED = environ.get('PB_ENABLED', default="false") == "true"