RosvDownload {rosv}R Documentation

R6 Class for OSV Database Downloads

Description

An R6 class to provide a lower-level interface to download from the OSV database GCS buckets.

Details

If no vulnerability IDs are provided, the entire set is downloaded from the ecosystem's all.zip file. JSON files are downloaded to the R session's temporary folder as dictated by the environment variable ROSV_CACHE_GLOBAL. Due to its similarity in parsing process, it simply inherits the method from the parent class RosvQuery1.

Any ecosystems listed here can be downloaded.

Value

An R6 object to operate with data downloaded from the OSV GCS buckets.

Super class

rosv::RosvQuery1 -> RosvDownload

Public fields

osv_cache_dir

Location of cached vulnerability JSON files.

content

Content from downloading the vulnerabilities.

time_stamp

Time stamp associated with run.

date_stamp_hash

Hashed date from time stamp.

ecosystem

The ecosystem used upon creation.

vuln_ids

The vulnerability IDs, if provided.

request

The URLs to request downloaded files.

Methods

Public methods

Inherited methods

Method new()

Set the core request details for subsequent use when called in run() method.

Usage
RosvDownload$new(vuln_ids = NULL, ecosystem)
Arguments
vuln_ids

Character vector of vulnerability IDs.

ecosystem

Ecosystem package lives within (must be set).


Method download()

Download vulnerabilities from provided ecosystem to disk, the location is recorded under the osv_cache_dir field. Will overwrite any existing files in the cache.

Usage
RosvDownload$download()

Method run()

Load vulnerabilities to the R session. The entire contents of each vulnerability file will be loaded. Subsequent use of the parse() method will shrink the memory footprint as not all contents will be carried across.

Usage
RosvDownload$run()

Method print()

Print basic details of query object to screen.

Usage
RosvDownload$print(...)
Arguments
...

Reserved for possible future use.


Method clone()

The objects of this class are cloneable with this method.

Usage
RosvDownload$clone(deep = FALSE)
Arguments
deep

Whether to make a deep clone.

See Also

https://google.github.io/osv.dev/data/#data-dumps

Examples

query <- RosvDownload$new(ecosystem = 'CRAN')
query

[Package rosv version 0.5.1 Index]