Skip to content

Enable filtering OSV results for malware#18934

Merged
woodruffw merged 2 commits into
mainfrom
ww/osv-mal-filt
Apr 9, 2026
Merged

Enable filtering OSV results for malware#18934
woodruffw merged 2 commits into
mainfrom
ww/osv-mal-filt

Conversation

@woodruffw

Copy link
Copy Markdown
Member

Summary

This is towards #18781 -- we now have a small Filter type, and we can filter an OSV query to limit it to just malware results by passing Filter::Malware. This has no performance cost versus normal queries since with OSV's "batch query" API we can cheaply pre-filter IDs before actually fetching the full OSV payloads.

Test Plan

Added a unit test that exhibits the filtering.

Signed-off-by: William Woodruff <william@astral.sh>
@woodruffw woodruffw requested review from konstin and zanieb April 8, 2026 19:52
@woodruffw woodruffw self-assigned this Apr 8, 2026
@woodruffw woodruffw added the internal A refactor or improvement that is not user-facing label Apr 8, 2026
Comment thread crates/uv-audit/src/service/osv.rs Outdated
Signed-off-by: William Woodruff <william@astral.sh>
@woodruffw woodruffw enabled auto-merge (squash) April 9, 2026 16:56
@woodruffw woodruffw merged commit f138c6c into main Apr 9, 2026
220 of 222 checks passed
@woodruffw woodruffw deleted the ww/osv-mal-filt branch April 9, 2026 17:40
naveenOnarayanan pushed a commit to doppelxyz/uv that referenced this pull request Apr 9, 2026
## Summary

This is towards astral-sh#18781 -- we now have a small `Filter` type, and we can
filter an OSV query to limit it to just malware results by passing
`Filter::Malware`. This has no performance cost versus normal queries
since with OSV's "batch query" API we can cheaply pre-filter IDs before
actually fetching the full OSV payloads.

## Test Plan

Added a unit test that exhibits the filtering.

---------

Signed-off-by: William Woodruff <william@astral.sh>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

internal A refactor or improvement that is not user-facing

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants