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

Backend optimizations and improvements, TAXII interop filters #175

Open
wants to merge 3 commits into
base: master
Choose a base branch
from

Conversation

chisholm
Copy link
Contributor

@chisholm chisholm commented Feb 2, 2023

This PR primarily updates memory and mongo backends to improve performance and add support for interop filters. "Interop" (interoperability) filters are an expanded set of filter names one can use in "match[...]" style TAXII queries. These are described in section 3.13.2 and appendix B of the interoperability test document.

Interop support can be enabled and disabled via a new "interop_requirements" setting in the medallion config file ("backend" section). The default is false (disabled).

There are also changes to other implementation details, e.g. change how Flask apps and unit tests are set up to make it easy to create fresh Flask apps for each unit test and reset the database. Recreating Flask apps and resetting the database improves unit test independence (one unit test should not affect another). But mongo backend unit tests run much more slowly now.

Also included are some small updates from some PRs which were (and still are) outstanding, which we built upon. So this PR obsoletes several other PRs, listed below.

Fixes issues: #154, #159, #173

Obsoletes PRs: #163, #164, #165, #166, #167, #174

@codecov-commenter
Copy link

codecov-commenter commented Feb 4, 2023

Codecov Report

Attention: Patch coverage is 95.57409% with 69 lines in your changes missing coverage. Please review.

Project coverage is 95.30%. Comparing base (2a588aa) to head (fc535a4).
Report is 1 commits behind head on master.

Files with missing lines Patch % Lines
medallion/backends/memory_backend.py 88.47% 28 Missing ⚠️
medallion/common.py 84.93% 11 Missing ⚠️
medallion/filters/mongodb_filter.py 92.76% 11 Missing ⚠️
medallion/filters/memory_filter.py 97.17% 8 Missing ⚠️
medallion/backends/mongodb_backend.py 93.93% 4 Missing ⚠️
medallion/filters/common.py 91.42% 3 Missing ⚠️
medallion/test/test_backends.py 99.29% 3 Missing ⚠️
medallion/__init__.py 95.65% 1 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##           master     #175      +/-   ##
==========================================
+ Coverage   95.09%   95.30%   +0.20%     
==========================================
  Files          24       25       +1     
  Lines        2955     3384     +429     
==========================================
+ Hits         2810     3225     +415     
- Misses        145      159      +14     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.


🚨 Try these New Features:

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.

2 participants