opencti
opencti copied to clipboard
[backend] Merged entity should also have all files of the merged entity and at the right path in S3 (#6258)
Proposed changes
- Add a test "example" on merge Artifact, did not cover all use cases with all entities
- Add a s3 method to move file from one entity to another
- update x_opencti_files content on the target entity for the merge
- Remove S3 metadata (as per issue comment): it's not needed anymore since we store metadata in elastic (InternalFile)
- fix x_opencti_file ids on artifact creation
Refactor:
- API_TOKEN to ADMIN_API_TOKEN (in testQuery)
Related issues
Checklist
- [ ] I consider the submitted work as finished
- [ ] 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)
- [ ] Where necessary I refactored code to improve the overall quality
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...