An R6 class to provide a lower-level interface to the query endpoint of the OSV API.
An R6 object to operate with OSV query endpoint.
requestRequest object made by httr2.
contentBody contents of response from OSV API.
responseResponse object returned from OSV API.
new()Set the core request details for subsequent use when called in run() method.
RosvQuery1$new(
commit = NULL,
version = NULL,
name = NULL,
ecosystem = NULL,
purl = NULL
)commitCommit hash to query against (do not use when version set).
versionVersion of package.
nameName of package.
ecosystemEcosystem package lives within (must be set if using name).
purlURL for package (do not use if name or ecosystem is set).
run()Perform the request and return response for OSV API call.
RosvQuery1$run()
parse()Parse the contents returned into a tidier format. Can
use future plans to help parallelize. Not all contents are parsed.
RosvQuery1$parse()
...Reserved for possible future use.
clone()The objects of this class are cloneable with this method.
RosvQuery1$clone(deep = FALSE)deepWhether to make a deep clone.
Pageination is implemented via httr2::req_perform_iterative() and a private method for
extracting tokens automatically. When initialized, the page_token is set to NULL;
if a token is generated for large results the process is handled internally. The response object
will contain a list of all returned responses before any formatting occurred. The content field will
contain the list of vulnerabilities which may be further parsed into a table format.
query <- RosvQuery1$new(commit = '6879efc2c1596d11a6a6ad296f80063b558d5e0f')
query
Run the code above in your browser using DataLab