opencti
opencti copied to clipboard
[backend] Improve entity type validation in deletion operations
Proposed changes
- Enforce type validation in
stixDomainObjectDeletewithexpectedEntityTypeparameter for stricter entity type checking - Updated Individual resolver to use the new type-checking deletion method
- Added comprehensive integration tests for entity type validation in deletion operations
Related issues
- Improves data integrity by ensuring delete operations target the correct entity types
- Prevents accidental deletion of wrong entities through type-specific endpoints
Checklist
- [x] I consider the submitted work as finished
- [x] I tested the code for its functionality
- [x] I wrote test cases for the relevant uses case (coverage and e2e)
- [ ] I added/update the relevant documentation (either on github or on notion)
- [x] Where necessary I refactored code to improve the overall quality
Codecov Report
:x: Patch coverage is 92.74194% with 9 lines in your changes missing coverage. Please review.
:white_check_mark: Project coverage is 30.83%. Comparing base (26a4bae) to head (65a6c88).
:warning: Report is 7 commits behind head on master.
Additional details and impacted files
@@ Coverage Diff @@
## master #13356 +/- ##
==========================================
+ Coverage 30.65% 30.83% +0.18%
==========================================
Files 2906 2906
Lines 192005 192099 +94
Branches 39088 39254 +166
==========================================
+ Hits 58851 59229 +378
+ Misses 133154 132870 -284
| Flag | Coverage Δ | |
|---|---|---|
| opencti | 30.83% <92.74%> (+0.18%) |
:arrow_up: |
| opencti-front | 2.47% <ø> (ø) |
|
| opencti-graphql | 68.24% <92.74%> (+0.37%) |
:arrow_up: |
Flags with carried forward coverage won't be shown. Click here to find out more.
:umbrella: View full report in Codecov by Sentry.
:loudspeaker: Have feedback on the report? Share it here.
:rocket: New features to boost your workflow:
- :snowflake: Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
- :package: JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.