feat(chaining): allow linking inputs to many primitive types (#6198) - #6901
feat(chaining): allow linking inputs to many primitive types (#6198)#6901savacano28 wants to merge 21 commits into
Conversation
|
/review docs
|
7d6982a to
b660cc9
Compare
Codecov Report❌ Patch coverage is ❌ Your patch check has failed because the patch coverage (0.00%) is below the target coverage (80.00%). You can increase the patch coverage or adjust the target coverage. Additional details and impacted files@@ Coverage Diff @@
## main #6901 +/- ##
============================================
- Coverage 44.96% 44.94% -0.02%
- Complexity 9327 9354 +27
============================================
Files 2681 2683 +2
Lines 80441 80600 +159
Branches 12066 12098 +32
============================================
+ Hits 36168 36228 +60
- Misses 41653 41737 +84
- Partials 2620 2635 +15
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
There was a problem hiding this comment.
Pull request overview
This PR extends the chaining engine’s condition “key type” model from a single primitive type to a list of primitive types, enabling a single mapper/input link to reference multiple primitive outputs. It updates persistence (jsonb), API/DTOs, chaining execution logic (batch generation), and the frontend linking UI accordingly.
Changes:
- Backend: replace
condition_key_typewithcondition_key_types(jsonb), update chaining services to consume multiple key types, and add a Flyway migration + importer/exporter updates. - Frontend: update chaining flow/editor to display and edit multi-type links, and update generated API types + translations.
- Tests: update existing chaining tests and add coverage for mapper conditions with multiple key types.
Reviewed changes
Copilot reviewed 43 out of 44 changed files in this pull request and generated 2 comments.
Show a summary per file
| File | Description |
|---|---|
| openaev-model/src/main/java/io/openaev/database/repository/ConditionRepository.java | Updates repository query to support new key-types model (now matched in memory). |
| openaev-model/src/main/java/io/openaev/database/model/Condition.java | Persists condition key types as jsonb list. |
| openaev-front/src/utils/lang/zh.json | Adds “Edit links” translation. |
| openaev-front/src/utils/lang/ru.json | Adds “Edit links” translation. |
| openaev-front/src/utils/lang/ko.json | Adds “Edit links” translation. |
| openaev-front/src/utils/lang/ja.json | Adds “Edit links” translation. |
| openaev-front/src/utils/lang/it.json | Adds “Edit links” translation. |
| openaev-front/src/utils/lang/fr.json | Adds “Edit links” translation and removes stale/extra keys. |
| openaev-front/src/utils/lang/es.json | Adds “Edit links” translation. |
| openaev-front/src/utils/lang/en.json | Adds “Edit links” translation. |
| openaev-front/src/utils/lang/de.json | Adds “Edit links” translation. |
| openaev-front/src/utils/api-types.d.ts | Updates Condition DTO typings from scalar to list condition_key_types. |
| openaev-front/src/admin/components/chaining/logic/logic-flow-helpers.ts | Adds key-type resolver to support new/legacy API shapes in UI state. |
| openaev-front/src/admin/components/chaining/logic/events/event-types.ts | Sends condition_key_types array to API. |
| openaev-front/src/admin/components/chaining/logic/drawer/InjectDataFieldItem.tsx | UI: multi-select primitive link types + apply action. |
| openaev-front/src/admin/components/chaining/logic/drawer/ConfigureActionDetail.utils.ts | Updates auto-linking and introduces field-link normalization helper. |
| openaev-front/src/admin/components/chaining/logic/drawer/ConfigureActionDetail.tsx | Applies normalization + auto-linking based on argument default types. |
| openaev-front/src/admin/components/chaining/logic/chaining_flow/LogicFlow.tsx | Emits mapper conditions with condition_key_types. |
| openaev-front/src/admin/components/chaining/logic/chaining_flow/ChainingFlowConfiguration.tsx | Converts UI links to API mapper conditions with condition_key_types. |
| openaev-api/src/test/resources/importer-v1/import-scenario-with-workflow.json | Updates importer fixture to new condition_key_types format. |
| openaev-api/src/test/java/io/openaev/utils/fixtures/ConditionFixture.java | Updates fixture to use keyTypes list. |
| openaev-api/src/test/java/io/openaev/service/chaining/WorkflowStateServiceTest.java | Updates mocks/asserts for new repository method + keyTypes list. |
| openaev-api/src/test/java/io/openaev/service/chaining/StepServiceTest.java | Updates tests to use keyTypes list. |
| openaev-api/src/test/java/io/openaev/service/chaining/StepServiceIntegrationTest.java | Updates integration inputs to use keyTypes list. |
| openaev-api/src/test/java/io/openaev/service/chaining/SaveCorrelatedObjectDecompositionTest.java | Updates verification for new repository method signature. |
| openaev-api/src/test/java/io/openaev/service/chaining/ConditionServiceTest.java | Adds coverage for multi-key-type mapper batch generation and updates existing tests. |
| openaev-api/src/test/java/io/openaev/service/attackpath/AttackPathKillChainResolverTest.java | Updates test construction to use keyTypes list. |
| openaev-api/src/test/java/io/openaev/database/model/ConditionRepositoryTest.java | Updates repository test to aggregate keyTypes list. |
| openaev-api/src/test/java/io/openaev/api/chaining/InjectExecutionStepTest.java | Updates expectations for step-input JSON to use keyTypes array. |
| openaev-api/src/test/java/io/openaev/api/chaining/ConditionApiTest.java | Updates condition tree test data to use keyTypes list. |
| openaev-api/src/main/java/io/openaev/utils/ConditionKeyTypesUtils.java | Adds utility to normalize key-types lists with condition/mapping rules. |
| openaev-api/src/main/java/io/openaev/service/chaining/WorkflowStateService.java | Switches to in-memory key-type matching for filter roots; adapts leaf key checks. |
| openaev-api/src/main/java/io/openaev/service/chaining/StepService.java | Copies conditions using keyTypes list. |
| openaev-api/src/main/java/io/openaev/service/chaining/ConditionService.java | Core logic changes: validation, key-type resolution, multi-key-type mapper batching. |
| openaev-api/src/main/java/io/openaev/service/attackpath/AttackPathKillChainResolver.java | Emits consumed finding keys for all key types on a condition leaf. |
| openaev-api/src/main/java/io/openaev/migration/V6_20260727140000000__Add_condition_key_types_jsonb.java | Adds condition_key_types jsonb column + backfill/normalize + index, drops legacy column. |
| openaev-api/src/main/java/io/openaev/importer/V1_DataImporter.java | Imports both legacy and new key-type shapes and normalizes them. |
| openaev-api/src/main/java/io/openaev/export/Mixins.java | Exports condition_key_types instead of legacy scalar key type. |
| openaev-api/src/main/java/io/openaev/api/chaining/StepMapper.java | Maps step mapper conditions to DTO using conditionKeyTypes. |
| openaev-api/src/main/java/io/openaev/api/chaining/InjectExecutionStep.java | Uses keyTypes array in step input JSON and supports multi-key-type mapping. |
| openaev-api/src/main/java/io/openaev/api/chaining/dto/MapperConditionOutput.java | DTO: condition_key_types list. |
| openaev-api/src/main/java/io/openaev/api/chaining/dto/ConditionOutput.java | DTO: condition_key_types list. |
| openaev-api/src/main/java/io/openaev/api/chaining/dto/ConditionCreateInput.java | DTO: accepts condition_key_types list. |
| openaev-api/src/main/java/io/openaev/api/chaining/ConditionMapper.java | Maps create input to entity using normalized key-types list. |

Proposed changes
Testing Instructions
Test 0:
Test 1
Related issues
Checklist
Further comments
If this is a relatively large or complex change, kick off the discussion by explaining why you chose the solution you did and what alternatives you considered, etc...