feat(openaev): compatibility with new JSON:API format (#317) - #358
feat(openaev): compatibility with new JSON:API format (#317)#358guzmud wants to merge 19 commits into
Conversation
ef208ea to
343bc64
Compare
Codecov Report❌ Patch coverage is Additional details and impacted files@@ Coverage Diff @@
## main #358 +/- ##
===========================================
- Coverage 78.59% 46.11% -32.49%
===========================================
Files 270 276 +6
Lines 12507 12682 +175
===========================================
- Hits 9830 5848 -3982
- Misses 2677 6834 +4157
📢 Thoughts on this report? Let us know! 🚀 New features to boost your workflow:
|
|
Adding |
84c27ee to
aeba730
Compare
|
Note: changing the tag from |
837fcd5 to
966251e
Compare
966251e to
9976f89
Compare
19bad4e to
b461ecb
Compare
89548fa to
578a54f
Compare
578a54f to
6751d5c
Compare
There was a problem hiding this comment.
Pull request overview
Adds JSON:API (new OpenAEV export) ingestion support to the openaev collector while keeping backward compatibility with the legacy “flat” payload format, enabling payloads exported from the UI to be re-imported into the community payloads repository.
Changes:
- Introduces a format-detecting payload processing flow that routes payloads to either a JSON:API or legacy-flat processor.
- Adds a GitHub crawler to enumerate and fetch payload JSON files directly from a repo/ref.
- Adds unit + functional tests and fixtures to validate JSON:API vs legacy processing parity.
Reviewed changes
Copilot reviewed 17 out of 18 changed files in this pull request and generated 6 comments.
Show a summary per file
| File | Description |
|---|---|
| openaev/openaev/openaev_openaev.py | Refactors collector loop to fetch payloads from GitHub and process JSON:API vs legacy automatically. |
| openaev/openaev/github_crawler.py | New helper for listing/fetching payload JSON files and generating raw download URLs. |
| openaev/openaev/processors/common_processor.py | Shared processing logic for tags, attack patterns, and document handling. |
| openaev/openaev/processors/json_api_processor.py | JSON:API-specific payload normalization into legacy-like shape. |
| openaev/openaev/processors/json_flat_processor.py | Legacy flat payload processing extracted into a dedicated processor. |
| openaev/openaev/processors/init.py | Exposes processor classes at the package level. |
| openaev/openaev/constants.py | Moves default expected security platforms mapping into a dedicated module. |
| openaev/pyproject.toml | Updates dependencies (adds JSON:API deserializer, test/dev deps) and project metadata. |
| openaev/tests/unit/test_openaev_openaev.py | Unit tests for format detection and per-payload processing routing. |
| openaev/tests/unit/test_github_crawler.py | Unit tests for repo/ref parsing, listing JSON paths, and JSON retrieval. |
| openaev/tests/unit/processors/test_common_processor.py | Unit tests for shared processor behaviors (tags, attack patterns, documents). |
| openaev/tests/unit/processors/test_json_api_processor.py | Unit tests for JSON:API deserialization + normalization behavior. |
| openaev/tests/unit/processors/test_json_flat_processor.py | Unit tests for legacy flat processing behavior. |
| openaev/tests/test_default_expected_security_platforms.py | Updates tests to call the refactored defaulting logic on CommonProcessor. |
| openaev/tests/functional/test_payload_processing.py | Functional comparison test to ensure JSON:API and legacy formats produce equivalent outputs. |
| openaev/tests/functional/old_format.json | Legacy payload fixture. |
| openaev/tests/functional/new_format.json | JSON:API payload fixture. |
| openaev/tests/unit/processors/init.py | Test package initializer for processor unit tests. |
| [project.scripts] | ||
| TemplateCollector = "src.__main__:main" |
e57ca80 to
5214de9
Compare
5214de9 to
d56bba9
Compare
Proposed changes
openaevcollectorTesting Instructions
Related issues
Checklist