Skip to content
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

[backend] Fix missing entities in shared Report (#8333) #8366

Closed
wants to merge 11 commits into from

Conversation

marieflorescontact
Copy link
Member

@marieflorescontact marieflorescontact commented Sep 16, 2024

Proposed changes

  • Add System and Individual in STIX_ORGANIZATIONS_UNRESTRICTED

Related issues

Checklist

  • I consider the submitted work as finished
  • I tested the code for its functionality
  • 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

@github-actions github-actions bot added the filigran team use to identify PR from the Filigran team label Sep 16, 2024
@marieflorescontact marieflorescontact self-assigned this Sep 16, 2024
Copy link

codecov bot commented Sep 17, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 66.30%. Comparing base (20ad2e9) to head (d1085f9).
Report is 4 commits behind head on master.

Additional details and impacted files
@@            Coverage Diff             @@
##           master    #8366      +/-   ##
==========================================
+ Coverage   66.18%   66.30%   +0.11%     
==========================================
  Files         597      597              
  Lines       60392    60532     +140     
  Branches     6207     6323     +116     
==========================================
+ Hits        39972    40133     +161     
+ Misses      20420    20399      -21     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@@ -401,7 +401,7 @@ const executeRuleElementRescan = async (context, user, actionContext, element) =
}
}
};
const executeShare = async (context, user, actionContext, element) => {
export const executeShare = async (context, user, actionContext, element) => {
Copy link
Member

Choose a reason for hiding this comment

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

no needed finally

expect(organizationSharingQueryResult?.data?.stixCoreObjectEdit.restrictionOrganizationAdd.objectOrganization[0].name).toEqual(TEST_ORGANIZATION.name);

// Need background task magic to happens for sharing
await taskHandler();
Copy link
Member

Choose a reason for hiding this comment

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

This is a kind of hack, not sure of this. But we will have some random issue if the manager has not run before next test. The alternative would be to do this test at domain level in taskManager-test, calling taskManager.executeShare.

@@ -67,7 +67,7 @@ schemaRelationsRefDefinition.registerRelationsRef(ENTITY_TYPE_CONTAINER_GROUPING
schemaRelationsRefDefinition.registerRelationsRef(ENTITY_TYPE_VULNERABILITY, [objectOrganization]);

schemaRelationsRefDefinition.registerRelationsRef(ENTITY_TYPE_IDENTITY_SYSTEM, [objectOrganization]);
schemaRelationsRefDefinition.registerRelationsRef(ENTITY_TYPE_IDENTITY_SECTOR, []);
schemaRelationsRefDefinition.registerRelationsRef(ENTITY_TYPE_IDENTITY_SECTOR, [objectOrganization]);
Copy link
Member

Choose a reason for hiding this comment

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

Sectors shouldn't have organization restriction (part of unrestricted entities)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
filigran team use to identify PR from the Filigran team
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants