[sdk] Add created in common properties#6448
Merged
Merged
Conversation
Contributor
There was a problem hiding this comment.
Pull request overview
This PR updates the connectors SDK model layer to support additional STIX2.1 “common” properties (created, modified, confidence) on BaseIdentifiedEntity, enabling entities like Vulnerability to be instantiated/exported with these fields.
Changes:
- Add
created,modified, andconfidencefields toBaseIdentifiedEntityand include them in_common_stix2_properties()when set. - Update
Incident.to_stix2_object()to rely on_common_stix2_properties()for thecreatedSTIX property (removing the explicitcreated=argument). - Add unit tests validating inclusion/omission behavior for these new common properties.
Reviewed changes
Copilot reviewed 3 out of 3 changed files in this pull request and generated 1 comment.
| File | Description |
|---|---|
| connectors-sdk/connectors_sdk/models/base_identified_entity.py | Introduces new common STIX properties and injects them into _common_stix2_properties() when provided. |
| connectors-sdk/connectors_sdk/models/incident.py | Removes explicit created= argument so STIX created is supplied via common properties. |
| connectors-sdk/tests/test_models/test_base_identified_entity.py | Adds tests covering presence/absence of created/modified/confidence in common properties. |
f52c7c7 to
d02cd91
Compare
Codecov Report✅ All modified and coverable lines are covered by tests.
Additional details and impacted files@@ Coverage Diff @@
## master #6448 +/- ##
==========================================
- Coverage 26.75% 20.91% -5.85%
==========================================
Files 1801 1800 -1
Lines 106940 106894 -46
==========================================
- Hits 28614 22352 -6262
- Misses 78326 84542 +6216
📢 Thoughts on this report? Let us know! 🚀 New features to boost your workflow:
|
d02cd91 to
3f81a93
Compare
3f81a93 to
f20db62
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Proposed changes
Related issues
Checklist
Further comments