Skip to contents

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

Value

An R6 object to operate with data downloaded from the OSV 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.

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

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.

Examples

query <- RosvDownload$new(ecosystem = 'CRAN')
query
#> Request(s) made to: https://osv-vulnerabilities.storage.googleapis.com/CRAN 
#> Save location:  /tmp/RtmpmBK0QD/rosv/CRAN-983b727da75d2568512e033cf1fa0a15 
#> Object contents:  NULL