diff --git a/spiffworkflow-backend/bin/run_process_model_with_api b/spiffworkflow-backend/bin/run_process_model_with_api index a0ab07bc..3886f3ae 100755 --- a/spiffworkflow-backend/bin/run_process_model_with_api +++ b/spiffworkflow-backend/bin/run_process_model_with_api @@ -10,10 +10,10 @@ set -o errtrace -o errexit -o nounset -o pipefail script_dir="$( cd -- "$(dirname "$0")" >/dev/null 2>&1 ; pwd -P )" if [[ -z "${KEYCLOAK_BASE_URL:-}" ]]; then - export KEYCLOAK_BASE_URL=https://keycloak.dev.spiffworkflow.org + export KEYCLOAK_BASE_URL="http://localhost:7002" fi if [[ -z "${BACKEND_BASE_URL:-}" ]]; then - export BACKEND_BASE_URL=https://api.dev.spiffworkflow.org + export BACKEND_BASE_URL=http://localhost:7000 fi process_model_identifier="${1:-}" diff --git a/spiffworkflow-backend/src/spiffworkflow_backend/models/file.py b/spiffworkflow-backend/src/spiffworkflow_backend/models/file.py index cf82ef90..6504cc12 100644 --- a/spiffworkflow-backend/src/spiffworkflow_backend/models/file.py +++ b/spiffworkflow-backend/src/spiffworkflow_backend/models/file.py @@ -24,6 +24,7 @@ class FileType(SpiffEnum): ppt = "ppt" pptx = "pptx" rtf = "rtf" + sql = "sql" svg = "svg" svg_xml = "svg+xml" txt = "txt" @@ -48,6 +49,7 @@ CONTENT_TYPES = { "ppt": "application/vnd.ms-powerpoint", "pptx": "application/vnd.openxmlformats-officedocument.presentationml.presentation", "rtf": "application/rtf", + "sql": "text/plain", "svg": "image/svg+xml", "svg_xml": "image/svg+xml", "txt": "text/plain", diff --git a/spiffworkflow-backend/src/spiffworkflow_backend/models/service_account.py b/spiffworkflow-backend/src/spiffworkflow_backend/models/service_account.py index 3acf96e9..20d80640 100644 --- a/spiffworkflow-backend/src/spiffworkflow_backend/models/service_account.py +++ b/spiffworkflow-backend/src/spiffworkflow_backend/models/service_account.py @@ -13,7 +13,7 @@ from spiffworkflow_backend.models.db import db # this is designed to be used for the "service" column on the user table, which is designed to hold # information about which authentiation system is used to authenticate this user. -# in this case, we are authenticating based on X-API-KEY which correlates to a known value in the spiff db. +# in this case, we are authenticating based on SpiffWorkflow-Api-key which correlates to a known value in the spiff db. SPIFF_SERVICE_ACCOUNT_AUTH_SERVICE = "spiff_service_account" SPIFF_SERVICE_ACCOUNT_AUTH_SERVICE_ID_PREFIX = "service_account_" diff --git a/spiffworkflow-backend/src/spiffworkflow_backend/routes/authentication_controller.py b/spiffworkflow-backend/src/spiffworkflow_backend/routes/authentication_controller.py index ce791ef0..efa9fbad 100644 --- a/spiffworkflow-backend/src/spiffworkflow_backend/routes/authentication_controller.py +++ b/spiffworkflow-backend/src/spiffworkflow_backend/routes/authentication_controller.py @@ -313,8 +313,8 @@ def _find_token_from_headers(token: str | None) -> dict[str, str | None]: ): token = request.cookies["access_token"] - if not token and "X-API-KEY" in request.headers: - api_key = request.headers["X-API-KEY"] + if not token and "SpiffWorkflow-Api-key" in request.headers: + api_key = request.headers["SpiffWorkflow-Api-key"] token_info = {"token": token, "api_key": api_key} return token_info diff --git a/spiffworkflow-backend/src/spiffworkflow_backend/scripts/get_task_data_value.py b/spiffworkflow-backend/src/spiffworkflow_backend/scripts/get_task_data_value.py index c68fbee9..701ca171 100644 --- a/spiffworkflow-backend/src/spiffworkflow_backend/scripts/get_task_data_value.py +++ b/spiffworkflow-backend/src/spiffworkflow_backend/scripts/get_task_data_value.py @@ -18,7 +18,9 @@ class GetTaskDataValue(Script): def run(self, script_attributes_context: ScriptAttributesContext, *args: Any, **kwargs: Any) -> Any: variable_to_check = args[0] - default_value = args[1] + default_value = None + if len(args) > 1: + default_value = args[1] task = script_attributes_context.task if task is None: diff --git a/spiffworkflow-backend/tests/spiffworkflow_backend/integration/test_service_accounts.py b/spiffworkflow-backend/tests/spiffworkflow_backend/integration/test_service_accounts.py index 76bf53e4..bdae22ad 100644 --- a/spiffworkflow-backend/tests/spiffworkflow_backend/integration/test_service_accounts.py +++ b/spiffworkflow-backend/tests/spiffworkflow_backend/integration/test_service_accounts.py @@ -40,7 +40,7 @@ class TestServiceAccounts(BaseTest): response = client.post( "/v1.0/secrets", content_type="application/json", - headers={"X-API-KEY": service_account.api_key}, + headers={"SpiffWorkflow-Api-Key": service_account.api_key}, data=json.dumps(post_body), ) assert response.status_code == 201 diff --git a/spiffworkflow-frontend/src/routes/ProcessModelShow.tsx b/spiffworkflow-frontend/src/routes/ProcessModelShow.tsx index 47950e4f..3fc66b80 100644 --- a/spiffworkflow-frontend/src/routes/ProcessModelShow.tsx +++ b/spiffworkflow-frontend/src/routes/ProcessModelShow.tsx @@ -328,48 +328,53 @@ export default function ProcessModelShow() { return null; } let constructedTag; - const tags = processModel.files.map((processModelFile: ProcessFile) => { - const isPrimaryBpmnFile = - processModelFile.name === processModel.primary_file_name; + const tags = processModel.files + .map((processModelFile: ProcessFile) => { + if (!processModelFile.name.match(/\.(dmn|bpmn|json|md)$/)) { + return undefined; + } + const isPrimaryBpmnFile = + processModelFile.name === processModel.primary_file_name; - let actionsTableCell = null; - if (processModelFile.name.match(/\.(dmn|bpmn|json|md)$/)) { - actionsTableCell = ( - - {renderButtonElements(processModelFile, isPrimaryBpmnFile)} - - ); - } + let actionsTableCell = null; + if (processModelFile.name.match(/\.(dmn|bpmn|json|md)$/)) { + actionsTableCell = ( + + {renderButtonElements(processModelFile, isPrimaryBpmnFile)} + + ); + } - let primarySuffix = null; - if (isPrimaryBpmnFile) { - primarySuffix = ( - -  -{' '} - Primary File - + let primarySuffix = null; + if (isPrimaryBpmnFile) { + primarySuffix = ( + +  -{' '} + Primary File + + ); + } + let fileLink = null; + const fileUrl = profileModelFileEditUrl(processModelFile); + if (fileUrl) { + fileLink = {processModelFile.name}; + } + constructedTag = ( + + + {fileLink} + {primarySuffix} + + {actionsTableCell} + ); - } - let fileLink = null; - const fileUrl = profileModelFileEditUrl(processModelFile); - if (fileUrl) { - fileLink = {processModelFile.name}; - } - constructedTag = ( - - - {fileLink} - {primarySuffix} - - {actionsTableCell} - - ); - return constructedTag; - }); + return constructedTag; + }) + .filter((element: any) => element !== undefined); if (tags.length > 0) { return (