[backend/client] handle file markings input as standard ids in file upload (#11643)#12666
[backend/client] handle file markings input as standard ids in file upload (#11643)#12666JeremyCloarec merged 3 commits intomasterfrom
Conversation
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## master #12666 +/- ##
==========================================
+ Coverage 32.09% 32.10% +0.01%
==========================================
Files 3006 3006
Lines 205955 205971 +16
Branches 37643 37656 +13
==========================================
+ Hits 66092 66122 +30
+ Misses 139863 139849 -14
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
adc7739 to
248c6fa
Compare
248c6fa to
ecbcebe
Compare
f31fc38 to
1dd52c9
Compare
1dd52c9 to
159c2b1
Compare
159c2b1 to
3e02930
Compare
3e02930 to
cad385b
Compare
There was a problem hiding this comment.
Pull request overview
This PR standardizes file marking handling to use internal IDs instead of standard IDs during file upload operations. The changes ensure that file markings are consistently stored as internal IDs in the backend, while also enabling proper marking export in the Python client by adding marking metadata to GraphQL queries and processing it in the STIX2 export logic.
- Backend now normalizes file marking inputs to internal IDs before validation and storage
- Python client GraphQL queries updated to include file marking metadata across all entity types
- STIX2 export now properly constructs marking-definition objects for file markings
Reviewed changes
Copilot reviewed 41 out of 41 changed files in this pull request and generated 3 comments.
Show a summary per file
| File | Description |
|---|---|
| opencti-platform/opencti-graphql/src/database/file-storage.ts | Normalizes file_markings input to internal IDs and passes markings cache to validation |
| opencti-platform/opencti-graphql/src/utils/access.ts | Adds optional markingsMap parameter to validateMarking to avoid redundant cache lookups |
| opencti-platform/opencti-graphql/tests/03-integration/01-database/file-storage-test.js | Updates test to verify file markings are stored as internal IDs |
| opencti-platform/opencti-graphql/tests/03-integration/01-database/file-storage-helper-test.ts | Updates test expectations to compare against internal IDs |
| client-python/pycti/utils/opencti_stix2.py | Adds logic to construct marking-definition objects from file markings during export |
| client-python/pycti/entities/*.py | Adds objectMarking fragment to all entity GraphQL queries to fetch file marking metadata |
1c222ef to
2cb4539
Compare
cad385b to
bf26cb1
Compare
… handle file markings in file export(#11643)
bf26cb1 to
f470349
Compare
esrevi
left a comment
There was a problem hiding this comment.
tested on local, files have markings
Proposed changes
Related issues
Checklist
Further comments