Skip to content

[backend] refactor(contract-types): extract ContractOutputType business logic into handler classes (#4302)#4960

Merged
savacano28 merged 1 commit intomasterfrom
issue/4941
Feb 26, 2026
Merged

[backend] refactor(contract-types): extract ContractOutputType business logic into handler classes (#4302)#4960
savacano28 merged 1 commit intomasterfrom
issue/4941

Conversation

@savacano28
Copy link
Copy Markdown
Contributor

@savacano28 savacano28 commented Feb 16, 2026

Proposed changes

Chunk 1: Part 1

  • Cleaned up the ContractOutputType enum by moving all business logic into separate handler classes.
  • Created handler classes for each output type (Text, Number, Port, PortScan, IPv4, IPv6, Credentials, CVE, Asset)
  • Services now fetch handlers from a factory instead of calling enum functions

Testing Instructions

Test refact_2026-02-18T08_40_12.089231500Z_(with_teams & with_players & with_variable_values).zip

  1. Atomic Testing with Payload and Output Parsers
    You should be able to execute an atomic test using a payload with output parsers configured.
    The test should work as expected, with normal execution behavior.

  2. Inject Execution with Nuclei
    You should be able to execute an inject operation Nuclei.
    The execution should complete successfully and produce:

  • Findings (including CVEs, if applicable)
  • Execution traces
  • No unexpected errors
  1. Atomic Testing with Vulnerability Expectation (CVE Validation)
    You should be able to execute an atomic test with a defined vulnerability expectation.
    If the payload uses an output parser of type cve, the system should correctly validate the vulnerability expectation against the detected CVE.

Related issues

Checklist

  • I consider the submitted work as finished
  • I tested the code for its functionality
  • I wrote test cases for the relevant uses case
  • I added/update the relevant documentation (either on github or on notion)
  • Where necessary I refactored code to improve the overall quality
  • For bug fix -> I implemented a test that covers the bug

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...

@savacano28 savacano28 self-assigned this Feb 16, 2026
@savacano28 savacano28 added the filigran team use to identify PR from the Filigran team label Feb 16, 2026
@savacano28 savacano28 changed the title [backend] feat(contract-types): refacto contract output type [backend] feat(contract-types): refacto contract output type (#4302) Feb 16, 2026
@codecov
Copy link
Copy Markdown

codecov Bot commented Feb 16, 2026

Codecov Report

❌ Patch coverage is 79.52756% with 26 lines in your changes missing coverage. Please review.
✅ Project coverage is 56.23%. Comparing base (a9f6deb) to head (fffbd18).
⚠️ Report is 1 commits behind head on master.

Files with missing lines Patch % Lines
...n/java/io/openaev/rest/finding/FindingService.java 56.52% 6 Missing and 4 partials ⚠️
...naev/output_processor/AbstractOutputProcessor.java 81.25% 5 Missing and 1 partial ⚠️
...enaev/output_processor/OutputProcessorFactory.java 75.00% 2 Missing ⚠️
...o/openaev/output_processor/CVEOutputProcessor.java 93.33% 0 Missing and 1 partial ⚠️
.../openaev/output_processor/IPv4OutputProcessor.java 80.00% 1 Missing ⚠️
.../openaev/output_processor/IPv6OutputProcessor.java 80.00% 1 Missing ⚠️
...penaev/output_processor/NumberOutputProcessor.java 66.66% 1 Missing ⚠️
.../openaev/output_processor/PortOutputProcessor.java 66.66% 1 Missing ⚠️
...naev/output_processor/PortScanOutputProcessor.java 91.66% 0 Missing and 1 partial ⚠️
.../openaev/output_processor/TextOutputProcessor.java 66.66% 1 Missing ⚠️
... and 1 more
Additional details and impacted files
@@             Coverage Diff              @@
##             master    #4960      +/-   ##
============================================
+ Coverage     56.03%   56.23%   +0.20%     
- Complexity     4441     4492      +51     
============================================
  Files           986      997      +11     
  Lines         29261    29357      +96     
  Branches       2142     2147       +5     
============================================
+ Hits          16396    16510     +114     
+ Misses        11920    11896      -24     
- Partials        945      951       +6     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@savacano28 savacano28 force-pushed the issue/4941 branch 5 times, most recently from 4826ef8 to 9545f82 Compare February 17, 2026 19:20
@savacano28 savacano28 changed the title [backend] feat(contract-types): refacto contract output type (#4302) [backend] refactor(contract-types): extract ContractOutputType business logic into handler classes (#4302) Feb 17, 2026
@heditar heditar self-requested a review February 17, 2026 22:11
@savacano28 savacano28 marked this pull request as ready for review February 18, 2026 08:07
Comment thread openaev-model/src/main/java/io/openaev/database/model/ContractOutputType.java Outdated
Comment thread openaev-api/src/main/java/io/openaev/rest/finding/FindingService.java Outdated
@savacano28 savacano28 force-pushed the issue/4941 branch 2 times, most recently from 5e4cc4e to 80ab146 Compare February 18, 2026 12:51
@savacano28 savacano28 requested a review from heditar February 18, 2026 15:56
@savacano28 savacano28 force-pushed the issue/4941 branch 2 times, most recently from b6d7d39 to adc775e Compare February 23, 2026 10:05
@heditar
Copy link
Copy Markdown
Contributor

heditar commented Feb 25, 2026

Tested all output handlers

@savacano28 savacano28 merged commit 74519b7 into master Feb 26, 2026
13 checks passed
@savacano28 savacano28 deleted the issue/4941 branch February 26, 2026 14:15
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

filigran team use to identify PR from the Filigran team

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants