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

[frontend/backend] Filters operator switching + filters refacto (#2686) #4396

Closed
wants to merge 80 commits into from

Conversation

Archidoit
Copy link
Member

@Archidoit Archidoit commented Sep 19, 2023

PR content

  • filters refacto to prepare the future version of filters
  • enable filters operator switching between filters of different groups and withing a filter group

Dynamic filters

  • back filters refacto, new logic implementation (imbrication, modes switching etc)
  • front filters refacto
  • backend tests for filters complex combinations
  • operator switching in front: enable operator switching by clicking on the 'AND/OR'
  • filter value resolution in the back
  • rename all the local storage keys (not to use local storage containing old filters anymore)
  • remove filterMode option
  • handle redirection from an url with filters in the old format

General

  • rename filter keys that were different between front and back
  • filter type generalization to supress filter enums
  • filter keys checking and conversion in the back according to the schema definition
  • generalize some args in filters
  • introduce 'nil' and 'not_nil' operators (filter empty / not empty fields)
  • cache: add an object containing all the existing attributes in the schema definitions name with their type (for filters key checking)
  • list special filter keys (special behaviors)
  • fix 'some filters cannot have NOT operator' ([Dashboard] "NOT" filters not available for some filters #4878)
  • client-python filter types adaptation: see associated PR
  • connectors filter types adaptation: see associated PR

Stored filters

  • query background tasks: back & front adaptation
  • feed and taxii: back & front adaptation
  • write backend tests with complex filtering for taxii collections
  • streams, playbooks, triggers: back & front adaptation
  • migration of stored filters (feeds, taxii collections, triggers, not finished query background tasks, workspaces, playbooks, rules)
  • remove unncessary filter ids resolution in backend
  • new filter key 'connectedToId' for instance triggers
  • new encoded logic for stix and events: isStixMatchFilters / isEventMatchFilters
  • store filter keys as array in the back, handle them as string in the front

Ressources

Notion page: https://www.notion.so/filigran/Switch-between-AND-and-OR-operators-between-filters-change-filter-schema-d05fe9af797c4751a293e3a7046ef89d#23a6b0fb69c94d2a8b837b50184c60b8

Github issue: #2686 and #4878 (bug)

Associated PR in client-python: OpenCTI-Platform/client-python#461

Associated PR in documentation: OpenCTI-Platform/docs#70

Associated PR in connectors: OpenCTI-Platform/connectors#1544

@Archidoit Archidoit self-assigned this Sep 19, 2023
@Archidoit Archidoit marked this pull request as draft September 19, 2023 09:58
@Archidoit Archidoit added the filigran team use to identify PR from the Filigran team label Sep 19, 2023
@Archidoit Archidoit force-pushed the issue/2686-preparation branch 2 times, most recently from 9ee6103 to 3c5c701 Compare September 19, 2023 16:01
@Archidoit Archidoit force-pushed the issue/2686-preparation branch 2 times, most recently from 2afc130 to 66110fa Compare September 20, 2023 12:50
@SouadHadjiat

This comment was marked as outdated.

@SouadHadjiat

This comment was marked as outdated.

@Archidoit

This comment was marked as resolved.

@Archidoit

This comment was marked as resolved.

@Archidoit Archidoit force-pushed the issue/2686-preparation branch 4 times, most recently from aaa092d to f90c261 Compare October 5, 2023 10:33
@Archidoit Archidoit force-pushed the issue/2686-preparation branch 5 times, most recently from e4b1d81 to a15ceea Compare October 11, 2023 12:46
@Archidoit Archidoit closed this Nov 22, 2023
@SamuelHassine SamuelHassine deleted the issue/2686-preparation branch November 25, 2023 14:22
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.

4 participants