Skip to content

Conversation

@GaetanSantucci
Copy link
Member

@GaetanSantucci GaetanSantucci commented Dec 26, 2025

As a Security Analyst
I want to view and filter payloads (injects) by their assigned Security Domains when I create a new inject (scenario/simulation)
So that can quickly select the most relevant payloads for my simulation and ensure that each inject aligns with the right part of the attack surface

Proposed changes

  • New IconBar Component: Added a horizontal scrollable bar to display security domains with real-time payload counts in create inject component.
  • Bidirectional Filtering: Implemented synchronization between the IconBar and the global filter system .

Testing Instructions

  • Open the Create Inject drawer (from a Scenario or Atomic testing view).
  • Observe the IconBar at the top; verify that counts reflect the available contracts.

Related issues

Closes #4284

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

@codecov
Copy link

codecov bot commented Dec 30, 2025

Codecov Report

❌ Patch coverage is 44.18605% with 24 lines in your changes missing coverage. Please review.
✅ Project coverage is 52.83%. Comparing base (d7ba6eb) to head (97ae3f4).
⚠️ Report is 2 commits behind head on release/current.

Files with missing lines Patch % Lines
...r_contract/InjectorContractDomainStatsService.java 0.00% 18 Missing ⚠️
..._contract/output/InjectorContractSearchResult.java 0.00% 4 Missing ⚠️
...est/injector_contract/InjectorContractService.java 86.66% 0 Missing and 2 partials ⚠️
Additional details and impacted files
@@                  Coverage Diff                  @@
##             release/current    #4651      +/-   ##
=====================================================
- Coverage              52.84%   52.83%   -0.02%     
- Complexity              4138     4141       +3     
=====================================================
  Files                    965      968       +3     
  Lines                  29003    29046      +43     
  Branches                2162     2165       +3     
=====================================================
+ Hits                   15327    15346      +19     
- Misses                 12771    12793      +22     
- Partials                 905      907       +2     

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

@GaetanSantucci GaetanSantucci self-assigned this Dec 30, 2025
@GaetanSantucci GaetanSantucci added feature use for describing a new feature to develop filigran team use to identify PR from the Filigran team labels Dec 30, 2025
@GaetanSantucci GaetanSantucci added this to the Release 2.1.0 milestone Dec 30, 2025
@GaetanSantucci GaetanSantucci marked this pull request as ready for review December 30, 2025 13:17
@GaetanSantucci GaetanSantucci force-pushed the issue/4284 branch 3 times, most recently from 83eac8f to 636ba34 Compare January 6, 2026 16:33
@gabriel-peze
Copy link
Contributor

Tested OK, just is it possible to add a little bit of space on the right of the filter field ?
image

@EmilieFo17 EmilieFo17 removed this from the Release 2.1.0 milestone Jan 9, 2026
@SamuelHassine SamuelHassine requested a review from Copilot January 9, 2026 09:01
Copy link

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR implements a Security Domains Icon Bar feature that enables filtering of payloads (injects) by their assigned security domains. The implementation adds a horizontal scrollable bar displaying security domains with real-time payload counts, synchronized with the global filter system.

Key Changes:

  • Added IconBar component for displaying and filtering by security domains
  • Implemented bidirectional filtering synchronization between IconBar and global filters
  • Created backend endpoint for domain count aggregation
  • Migrated InjectorContracts actions from JavaScript to TypeScript
  • Removed legacy "Targeting Players only" filter

Reviewed changes

Copilot reviewed 20 out of 22 changed files in this pull request and generated 6 comments.

Show a summary per file
File Description
openaev-front/src/components/common/queryable/pagination/PaginationComponentV2.tsx Removed legacy InjectorContractSwitchFilter component usage
openaev-front/src/components/ItemDomains.tsx Fixed domain count display using resolved domains length instead of raw domains
openaev-front/src/admin/components/integrations/injectors/injector_contracts/InjectorContractPopover.js Updated import to use TypeScript version of InjectorContracts actions
openaev-front/src/admin/components/integrations/injectors/injector_contracts/CreateInjectorContract.js Updated import to use TypeScript version of InjectorContracts actions
openaev-front/src/admin/components/integrations/injectors/InjectorContracts.js Updated import to use TypeScript version of InjectorContracts actions
openaev-front/src/admin/components/common/injects/CreateInject.tsx Integrated IconBar with domain filtering logic and synchronization
openaev-front/src/admin/components/common/filters/constants.ts Removed file containing legacy filter constants
openaev-front/src/admin/components/common/filters/InjectorContractSwitchFilter.tsx Removed legacy "Targeting Players only" filter component
openaev-front/src/admin/components/common/domains/IconBar.tsx Added new IconBar component for displaying domain icons with counts
openaev-front/src/admin/components/common/domains/IconBar-model.ts Added TypeScript interface for IconBar element structure
openaev-front/src/admin/components/common/domains/DomainsIcons.tsx Added domain-to-icon mapping and IconBar element builder
openaev-front/src/actions/domains/domain-actions.ts Moved default export to end of file for consistency
openaev-front/src/actions/InjectorContracts.ts Migrated from JavaScript to TypeScript with added fetchDomainCounts action
openaev-front/src/actions/InjectorContracts.js Removed JavaScript version (migrated to TypeScript)
openaev-api/src/test/java/io/openaev/rest/injector_contract/InjectorContractApiTest.java Added test for domain count aggregation endpoint
openaev-api/src/main/java/io/openaev/rest/injector_contract/output/InjectorContractSearchResult.java Added output class for contract search with domain counts
openaev-api/src/main/java/io/openaev/rest/injector_contract/output/InjectorContractDomainCountOutput.java Added output class for domain count data
openaev-api/src/main/java/io/openaev/rest/injector_contract/InjectorContractService.java Added getDomainCounts method for aggregating domain counts
openaev-api/src/main/java/io/openaev/rest/injector_contract/InjectorContractDomainStatsService.java Added new service for domain statistics (appears unused)
openaev-api/src/main/java/io/openaev/rest/injector_contract/InjectorContractApi.java Added POST endpoint for domain counts
Comments suppressed due to low confidence (1)

openaev-front/src/admin/components/common/injects/CreateInject.tsx:133

  • The change from 'Label' to 'Name' is inconsistent with the actual data displayed, which is injector_contract_labels (plural, suggesting multiple labels). Consider reverting to 'Label' or using 'Labels' to accurately reflect the field.
      label: 'Name',

Comment on lines +7 to +17
@Data
public class InjectorContractSearchResult {
private List<InjectorContractFullOutput> contracts;
private Map<String, Long> injectorContractDomainCounts;

public InjectorContractSearchResult(
List<InjectorContractFullOutput> contracts, Map<String, Long> domainCounts) {
this.contracts = contracts;
this.injectorContractDomainCounts = domainCounts;
}
}
Copy link

Copilot AI Jan 9, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This new output class is never used anywhere in the codebase. The getDomainCounts endpoint returns List directly instead. Consider removing this unused class or clarifying its intended usage.

Copilot uses AI. Check for mistakes.
sx={{
flexShrink: isScroll ? 0 : 1,
flexGrow: isScroll ? 0 : 1,
minWidth: isScroll ? '180px' : 'auto',
Copy link

Copilot AI Jan 9, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The hard-coded minimum width of '180px' should be extracted to a constant or theme configuration for maintainability and consistency across the application.

Copilot uses AI. Check for mistakes.
Comment on lines 373 to 374
List<InjectorContractFullOutput> outputs =
query.getResultList().stream()
Copy link

Copilot AI Jan 9, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The intermediate variable 'outputs' is unnecessary as it's immediately returned. The original direct return statement was cleaner and should be retained.

Copilot uses AI. Check for mistakes.
Comment on lines 99 to 100
domainRepository.deleteAll();
em.flush();
Copy link

Copilot AI Jan 9, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The domainRepository.deleteAll() and em.flush() calls are added to the general @beforeeach setup, which affects all existing tests in this file, not just the new domain-related test. This could introduce unintended side effects in existing tests that may depend on preset domain data. Consider moving this cleanup to the specific nested test class WhenContractsAreLinkedToDomains.

Copilot uses AI. Check for mistakes.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

feature use for describing a new feature to develop filigran team use to identify PR from the Filigran team

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants