-
Notifications
You must be signed in to change notification settings - Fork 194
[backend/frontend] feat(scv): implement Security Domains Icon Bar (#4284) #4651
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: release/current
Are you sure you want to change the base?
Conversation
521c331 to
f25b940
Compare
Codecov Report❌ Patch coverage is 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. 🚀 New features to boost your workflow:
|
83eac8f to
636ba34
Compare
openaev-api/src/main/java/io/openaev/rest/injector_contract/InjectorContractService.java
Outdated
Show resolved
Hide resolved
...rc/main/java/io/openaev/rest/injector_contract/output/InjectorContractDomainCountOutput.java
Show resolved
Hide resolved
openaev-front/src/admin/components/common/domains/DomainsIcons.tsx
Outdated
Show resolved
Hide resolved
openaev-front/src/admin/components/common/injects/CreateInject.tsx
Outdated
Show resolved
Hide resolved
There was a problem hiding this 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',
openaev-api/src/main/java/io/openaev/rest/injector_contract/InjectorContractService.java
Outdated
Show resolved
Hide resolved
openaev-api/src/main/java/io/openaev/rest/injector_contract/InjectorContractApi.java
Show resolved
Hide resolved
| @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; | ||
| } | ||
| } |
Copilot
AI
Jan 9, 2026
There was a problem hiding this comment.
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.
| sx={{ | ||
| flexShrink: isScroll ? 0 : 1, | ||
| flexGrow: isScroll ? 0 : 1, | ||
| minWidth: isScroll ? '180px' : 'auto', |
Copilot
AI
Jan 9, 2026
There was a problem hiding this comment.
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.
| List<InjectorContractFullOutput> outputs = | ||
| query.getResultList().stream() |
Copilot
AI
Jan 9, 2026
There was a problem hiding this comment.
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.
| domainRepository.deleteAll(); | ||
| em.flush(); |
Copilot
AI
Jan 9, 2026
There was a problem hiding this comment.
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.
2ab5ea9 to
18ef986
Compare
… Domains metrics on the dashboard(4292)' Signed-off-by: johanah29 <[email protected]>
cfee716 to
0fcc5d9
Compare

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
Testing Instructions
Related issues
Closes #4284
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...