-
Notifications
You must be signed in to change notification settings - Fork 188
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
Clarify documentation of return format for /v1/querybatch API #466
Comments
Hi! Thanks for trying our API and filing this issue.
Unfortunately since we allow up to 1000 packages per batch query, it's not feasible for us to return the full vulnerability details for every single package. There is no rate limiting. GETing vulnerability details is very cheap and you can do them in parallel. We may add a batch GET endpoint in the near future if we see enough demand for it.
We return an array where each element corresponds to the package you provided. I.e. in your example, you provided two packages. The returned response has two entries in "results". The first shows 4 vulnerabilities for the first package you provided. There were no vulnerabilities that were matched for the second package you provided (given by the "{}"). Note that Packagist querying is not fully supported yet (tracked in #230). We'll clarify this in our API.
Could you please clarify this? Is this just the same issue with us not returning fully hydrated results?
We have no rate limits :) |
@oliverchang Many thanks! I’ll have a go at the /v1/query endpoint instead of the batch endpoint. Great to hear there is no rate limitting.
Indeed, the Swagger documentation currently suggests that the batch endpoint returns the fully hydrated vulnerabilities. Hence the confusion. |
I've just ran into this same issue as well in context of integrating OSV into [1].
Which one is actually faster for my use case in [1] is not obvious to me instantly, e.g: Anyhow, what I'm after is whether option 2. would allow for caching vulnerability details, which would be beneficial.
|
Hi @fviernau, Thanks for trying the OSV API! Option 2. is definitely the preferred option from our perspective also. GETing vulnerabilities by ID is extremely fast/cheap and you can do this in parallel as well to improve performance. We've also been considering adding a bulk GET (by multiple IDs) to make this easier. Re your questions specifically,
This makes a lot of sense -- we can certainly include the "modified" timestamp with the ID as well in the batch response. The combination of ID+modified would serve as a reliable cache key. I just filed #492 to track this. Extending |
Add a retrofit based REST API client and a wrapper for simplicity and information hiding. The implementation is based on [1], even though it has some inconsistencies with the real behavior, see [2]. [1] https://osv.dev/docs/ [2] google/osv.dev#466 Signed-off-by: Frank Viernau <frank_viernau@epam.com>
Add a retrofit based REST API client and a wrapper for simplicity and information hiding. The implementation is based on [1], even though it has some inconsistencies with the real behavior, see [2]. [1] https://osv.dev/docs/ [2] google/osv.dev#466 Signed-off-by: Frank Viernau <frank_viernau@epam.com>
Add a retrofit based REST API client and a wrapper for simplicity and information hiding. The implementation is based on [1], even though it has some inconsistencies with the real behavior, see [2]. [1] https://osv.dev/docs/ [2] google/osv.dev#466 Signed-off-by: Frank Viernau <frank_viernau@epam.com>
Add a retrofit based REST API client and a wrapper for simplicity and information hiding. The implementation is based on [1], even though it has some inconsistencies with the real behavior, see [2]. [1] https://osv.dev/docs/ [2] google/osv.dev#466 Signed-off-by: Frank Viernau <frank_viernau@epam.com>
Add a Retrofit-based REST API client as well as a wrapper for simplicity and information hiding. The implementation is based on [1], even though it has some inconsistencies with the real behavior, see e.g. [2]. [1] https://osv.dev/docs/ [2] google/osv.dev#466 Signed-off-by: Frank Viernau <frank_viernau@epam.com>
Add a Retrofit-based REST API client as well as a wrapper for simplicity and information hiding. The implementation is based on [1], even though it has some inconsistencies with the real behavior, see e.g. [2]. [1] https://osv.dev/docs/ [2] google/osv.dev#466 Signed-off-by: Frank Viernau <frank_viernau@epam.com>
Add a Retrofit-based REST API client as well as a wrapper for simplicity and information hiding. The implementation is based on [1], even though it has some inconsistencies with the real behavior, see e.g. [2]. [1] https://osv.dev/docs/ [2] google/osv.dev#466 Signed-off-by: Frank Viernau <frank_viernau@epam.com>
Add a Retrofit-based REST API client as well as a wrapper for simplicity and information hiding. The implementation is based on [1], even though it has some inconsistencies with the real behavior, see e.g. [2]. [1] https://osv.dev/docs/ [2] google/osv.dev#466 Signed-off-by: Frank Viernau <frank_viernau@epam.com>
This issue has not had any activity for 60 days and will be automatically closed in two weeks |
According to the Swagger documentation at https://osv.dev/docs/#operation/OSV_QueryAffectedBatch the endpoint
https://api.osv.dev/v1/querybatch
should return a list ofosvVulnerability
.Instead it returns a list of vulnerability IDs without any vulnerability details or the actual link to the package the vulnerability belongs to.
This leads to the following issues:
Example:
Returns:
With this approach, the current service is almost impossible to use without hitting rate limits.
The text was updated successfully, but these errors were encountered: