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

fix: No events returned when one of many orgs in filter does not exist #9166

Open
wants to merge 1 commit into
base: 2.4
Choose a base branch
from

Conversation

tomking2
Copy link
Contributor

@tomking2 tomking2 commented Jun 30, 2023

What does it do?

Discovered that when using the search_index endpoint (or filtering through UI), if you pass a list of organisations in the org parameter, and at least one of the orgs does not exist (either by ID, UUID or Name), then no results are returned. It did not matter if other orgs provided in the parameter exist.

To replicate:
The following search returns a result:

pm.search_index(org=["CIRCL"], limit=1)

The following does not:

pm.search_index(org=["CIRCL", "CIRCL_____MISSING"], limit=1)

Fixed by handling where at least one org was found, and also skipping including an empty $test in the conditions (for code cleanup)

Questions

  • Does it require a DB change?
  • Are you using it in production?
  • Does it require a change in the API (PyMISP for example)?

@tomking2 tomking2 changed the title fix: No events returned when any org in filter does not exist fix: No events returned when one of many orgs in filter does not exist Jun 30, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants