Skip to content

Commit dff579e

Browse files
authored
Only return form related task data for human tasks (#2654)
If a user task is configured with a `variableName`, limit the task data in the api response to only contain that key. This piggybacks on the previous `variableName` work to not leak irrelevant task data. I'm still auditing endpoints but this appears to be working and should be safe to merge since it is only in play if a `variableName` is configured. <!-- This is an auto-generated comment: release notes by coderabbit.ai --> ## Summary by CodeRabbit * **Improvements** * Enhanced task data handling with support for variable name extensions in task configurations, enabling better organization and structure of task-related information. <sub>✏️ Tip: You can customize this high-level summary in your review settings.</sub> <!-- end of auto-generated comment: release notes by coderabbit.ai -->
1 parent a68ef0e commit dff579e

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

spiffworkflow-backend/src/spiffworkflow_backend/routes/process_api_blueprint.py

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -753,6 +753,10 @@ def _get_task_model_for_request(
753753
task_model.form_ui_schema = {}
754754
_munge_form_ui_schema_based_on_hidden_fields_in_task_data(task_model.form_ui_schema, task_model.data)
755755

756+
subset_var = extensions.get("variableName")
757+
if subset_var:
758+
task_model.data = {subset_var: task_model.data.get(subset_var, {})}
759+
756760
# it should be safe to add instructions to the task spec here since we are never commiting it back to the db
757761
extensions["instructionsForEndUser"] = JinjaService.render_instructions_for_end_user(task_model, extensions)
758762

0 commit comments

Comments
 (0)