-
Notifications
You must be signed in to change notification settings - Fork 64
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
Add VulnerabilityResult.published field #404
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Some tiny nits, but LGTM overall! Thanks!
Thanks for adding this field! This will be a nice addition, when plumbed through the different output formats.
Would you mind opening a discussion issue for this feature first? So far we've tried to limit the number of "filter-style" CLI options we provide, under the reasoning that users who want filtering should use |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM aside from unresolved discussion
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM overall, we should probably clarify the OSV schema question but I'm okay with letting that float if you are @di 🙂
Thanks again @orsinium! |
Add a new field
published
intoVulnerabilityResult
dataclass. The field holds information about when the vulnerability was published. That information is not used in the CLI or anywhere else yet, only emitted (from both PyPA and OSV sources).Motivation: in a follow-up PR, I'm going to introduce a new CLI flag for filtering out only advisories published in a specific time window. The motivation for that, in turn, is to be able to have multiple CI jobs in user projects, one that warns about new vulnerabilities and another that fails for all vulnerabilities that weren't resolved in time. But that's another story. For now, just hold that information but don't act on it :)
Also, I've switched
pip_audit/_service/interface.py
to the new style of type annotations. Since you usefrom __future__ import annotaions
, you can use any style of type annotations in any Python versions, type checkers will understand it. I thinkdatetime | None
is easier to understand thanOptional[datetime]
.