Hotfix: AddIOCtoIOCCollectionAction Check indicators earlier (1314)#2067
Open
Hotfix: AddIOCtoIOCCollectionAction Check indicators earlier (1314)#2067
Conversation
Contributor
Reviewer's guide (collapsed on small PRs)Reviewer's GuideHotfix consolidates and moves the validation of the Updated class diagram for AddIOCtoIOCCollectionAction run methodclassDiagram
class AddIOCtoIOCCollectionAction {
+run(arguments: dict) void
+add_IP_action(indicators: list, ioc_collection_id: str, valid_for: int) void
+add_generic_indicator_action(indicators: list, ioc_collection_id: str, valid_for: int, indicator_type: str) void
}
class IndicatorTypeMapping {
+get(indicator_type: str) function
}
AddIOCtoIOCCollectionAction --> IndicatorTypeMapping : uses
class RunArguments {
+indicators: any
+indicator_type: any
+valid_for: any
+ioc_collection_id: any
}
AddIOCtoIOCCollectionAction ..> RunArguments : reads
Flow diagram for updated AddIOCtoIOCCollectionAction.run validation and routingflowchart TD
A[Start run] --> B[Read indicators, indicator_type, valid_for from arguments]
B --> C{Is indicators a list?}
C -- No --> D[Raise ValueError: Indicators should be list type]
D --> E[End run]
C -- Yes --> F{indicator_type == IP address?}
F -- Yes --> G[Call add_IP_action with indicators, ioc_collection_id, valid_for]
G --> E
F -- No --> H[Lookup indicator_type in indicator_type_mapping]
H --> I{Mapping found?}
I -- No --> J[Raise ValueError or handle unsupported indicator_type]
J --> E
I -- Yes --> K[Call mapped action with indicators, ioc_collection_id, valid_for]
K --> E
File-Level Changes
Tips and commandsInteracting with Sourcery
Customizing Your ExperienceAccess your dashboard to:
Getting Help
|
mchupeau-sk
reviewed
Mar 9, 2026
Contributor
mchupeau-sk
left a comment
There was a problem hiding this comment.
Ok for me just to rebase with develop
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.
Relates to 1314
Summary by Sourcery
Guard the AddIOCtoIOCCollection action with an early validation of the indicators payload and release a hotfix version.
Bug Fixes:
Build:
Documentation: