diff --git a/src/spiffworkflow_backend/config/__init__.py b/src/spiffworkflow_backend/config/__init__.py index f6896ede..b75ea0ee 100644 --- a/src/spiffworkflow_backend/config/__init__.py +++ b/src/spiffworkflow_backend/config/__init__.py @@ -52,15 +52,15 @@ def load_config_file(app: Flask, env_config_module: str) -> None: def _set_up_tenant_specific_fields_as_list_of_strings(app: Flask) -> None: - tenant_specific_fields = app.config.get("TENANT_SPECIFIC_FIELDS") + tenant_specific_fields = app.config.get("OPEN_ID_TENANT_SPECIFIC_FIELDS") if tenant_specific_fields is None or tenant_specific_fields == "": - app.config["TENANT_SPECIFIC_FIELDS"] = [] + app.config["OPEN_ID_TENANT_SPECIFIC_FIELDS"] = [] else: - app.config["TENANT_SPECIFIC_FIELDS"] = tenant_specific_fields.split(",") - if len(app.config["TENANT_SPECIFIC_FIELDS"]) > 3: + app.config["OPEN_ID_TENANT_SPECIFIC_FIELDS"] = tenant_specific_fields.split(",") + if len(app.config["OPEN_ID_TENANT_SPECIFIC_FIELDS"]) > 3: raise ConfigurationError( - "TENANT_SPECIFIC_FIELDS can have a maximum of 3 fields" + "OPEN_ID_TENANT_SPECIFIC_FIELDS can have a maximum of 3 fields" ) diff --git a/src/spiffworkflow_backend/config/default.py b/src/spiffworkflow_backend/config/default.py index 499bc8f5..f44d5b33 100644 --- a/src/spiffworkflow_backend/config/default.py +++ b/src/spiffworkflow_backend/config/default.py @@ -41,6 +41,11 @@ OPEN_ID_CLIENT_SECRET_KEY = environ.get( "OPEN_ID_CLIENT_SECRET_KEY", default="JXeQExm0JhQPLumgHtIIqf52bDalHz0q" ) # noqa: S105 +# Tenant specific fields is a comma separated list of field names that we will convert to list of strings +# and store in the user table's tenant_specific_field_n columns. You can have up to three items in this +# comma-separated list. +OPEN_ID_TENANT_SPECIFIC_FIELDS = environ.get("OPEN_ID_TENANT_SPECIFIC_FIELDS") + SPIFFWORKFLOW_BACKEND_LOG_TO_FILE = ( environ.get("SPIFFWORKFLOW_BACKEND_LOG_TO_FILE", default="false") == "true" ) @@ -89,11 +94,6 @@ ALLOW_CONFISCATING_LOCK_AFTER_SECONDS = int( environ.get("ALLOW_CONFISCATING_LOCK_AFTER_SECONDS", default="600") ) -# Tenant specific fields is a comma separated list of field names that we will convert to list of strings -# and store in the user table's tenant_specific_field_n columns. You can have up to three items in this -# comma-separated list. -TENANT_SPECIFIC_FIELDS = environ.get("TENANT_SPECIFIC_FIELDS") - SPIFFWORKFLOW_DEFAULT_USER_GROUP = environ.get( "SPIFFWORKFLOW_DEFAULT_USER_GROUP", default="everybody" ) diff --git a/src/spiffworkflow_backend/services/authorization_service.py b/src/spiffworkflow_backend/services/authorization_service.py index 85a06ad8..0843a6e1 100644 --- a/src/spiffworkflow_backend/services/authorization_service.py +++ b/src/spiffworkflow_backend/services/authorization_service.py @@ -504,7 +504,7 @@ class AuthorizationService: user_attributes["service_id"] = user_info["sub"] for field_index, tenant_specific_field in enumerate( - current_app.config["TENANT_SPECIFIC_FIELDS"] + current_app.config["OPEN_ID_TENANT_SPECIFIC_FIELDS"] ): if tenant_specific_field in user_info: field_number = field_index + 1