feat: add IOC type filter to Feeds API and page#617
Merged
regulartim merged 7 commits intointelowlproject:developfrom Dec 17, 2025
Merged
feat: add IOC type filter to Feeds API and page#617regulartim merged 7 commits intointelowlproject:developfrom
regulartim merged 7 commits intointelowlproject:developfrom
Conversation
- Add optional ioc_type parameter (ip/domain/all) to FeedRequestParams - Update FeedsRequestSerializer with ioc_type field validation - Modify get_queryset to filter IOCs by type when ioc_type is specified - Add IOC type dropdown in Feeds page UI with three options - Update frontend to include ioc_type in API calls and URL generation - Add test data with domain IOC for comprehensive testing - Add test cases for IP-only, domain-only, and all IOC type filters This enhancement allows users to filter feeds specifically by IP addresses or domains, making it easier to showcase domains extracted from payload requests separately from IP addresses. Closes intelowlproject#551
…mprove validation 1. Synced Tests with Existing Test Data: Updated assertions to expect 3 IOCs for Heralding instead of 2, matching the setupTestData. Refactored tests to find IOCs by value. 2. Fixed Feed Filtering Bug: Updated feeds view to correctly pass query parameters (like ioc_type) to FeedRequestParams. 3. Improved Input Validation: Added check in serializers to reject invalid IP strings that were being accepted as domains.
…e Feeds component.
Contributor
Author
|
Apologies for the confusion with the previous PR #610 . I realized I had mistakenly branched off main instead of develop, which caused the commit history to become messy. To fix this, I reset my local branch to match develop and cherry-picked my specific feature commits onto it. This ensures the history is now clean, linear, and strictly contains the changes for this feature on top of the correct base branch. |
Collaborator
|
Could you please resolve the merge conflicts? |
…type-filter-v2 # Conflicts: # tests/test_views.py
Contributor
Author
|
I have integrated the conditional check for the license presence logic: if settings.FEEDS_LICENSE:
self.assertEqual(response.json()["license"], settings.FEEDS_LICENSE)
else:
self.assertNotIn("license", response.json()) |
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.
feat: add IOC type filter to Feeds API and page. Closes #551
Description
This PR adds the ability to filter IOCs by type (IP address or domain) in the Feeds API and frontend page. Users can now choose to view only IP addresses, only domains, or all IOCs (default behavior).
Related issues
Closes #551
Type of change
Checklist
develop.Black,Flake,Isort) gave 0 errors. If you have correctly installed pre-commit, it does these checks and adjustments on your behalf.Changes Made
Backend:
ioc_typeparameter toFeedRequestParamsinapi/views/utils.pyioc_typefield validation inapi/serializers.pywith ChoiceFieldtests/test_views.pyto cover all filtering scenariosFrontend:
frontend/src/components/feeds/Feeds.jsxTests:
tests/__init__.pytest_200_feeds_filter_ip_only,test_200_feeds_filter_domain_only,test_200_feeds_filter_all,test_400_feeds_invalid_ioc_type