From 5464551aa3b6a541b8b1d20cfdf2a84d0673eb2f Mon Sep 17 00:00:00 2001 From: al-obrien Date: Sat, 28 Oct 2023 12:43:13 -0600 Subject: [PATCH] Remake documentation for other functions --- man/check_ecosystem.Rd | 27 +++++++++++++++++++++++++-- man/create_osv_list.Rd | 2 +- man/create_ppm_blacklist.Rd | 2 +- man/create_ppm_xref_whitelist.Rd | 2 +- man/download_osv.Rd | 11 +++++++++++ man/fetch_ecosystems.Rd | 20 ++++++++++++++++++-- 6 files changed, 57 insertions(+), 7 deletions(-) diff --git a/man/check_ecosystem.Rd b/man/check_ecosystem.Rd index 45695de..73c6bd7 100644 --- a/man/check_ecosystem.Rd +++ b/man/check_ecosystem.Rd @@ -1,11 +1,34 @@ % Generated by roxygen2: do not edit by hand -% Please edit documentation in R/query.R +% Please edit documentation in R/utils.R \name{check_ecosystem} \alias{check_ecosystem} \title{Check input against possible ecosystems available} \usage{ check_ecosystem(ecosystem, suppressMessages = TRUE) } +\arguments{ +\item{ecosystem}{Character value for ecosystem(s) to check.} + +\item{suppressMessages}{Boolean value whether or not to suppress any messages.} +} +\value{ +A character vector of the same input if all are valid ecosystem names. +} \description{ -Check input against possible ecosystems available +Ensures that inputs for ecosystem are valid based upon what is available in OSV database. +} +\details{ +Will attempt to grab latest file and cache for the session. If cannot access +the online version, will use a local copy that is shipped with the package. +} +\examples{ +# Passes +rosv:::check_ecosystem(c('PyPI', 'CRAN')) + +# Fails +try(rosv:::check_ecosystem(c('notvalid', 'pypi'))) + +} +\seealso{ +\code{\link{check_ecosystem}} } diff --git a/man/create_osv_list.Rd b/man/create_osv_list.Rd index 3d768a8..defcd7c 100644 --- a/man/create_osv_list.Rd +++ b/man/create_osv_list.Rd @@ -1,5 +1,5 @@ % Generated by roxygen2: do not edit by hand -% Please edit documentation in R/utils.R +% Please edit documentation in R/create_lists.R \name{create_osv_list} \alias{create_osv_list} \title{Create list of packages identified in OSV database} diff --git a/man/create_ppm_blacklist.Rd b/man/create_ppm_blacklist.Rd index be94ebe..075bbd3 100644 --- a/man/create_ppm_blacklist.Rd +++ b/man/create_ppm_blacklist.Rd @@ -1,5 +1,5 @@ % Generated by roxygen2: do not edit by hand -% Please edit documentation in R/utils.R +% Please edit documentation in R/create_lists.R \name{create_ppm_blacklist} \alias{create_ppm_blacklist} \title{Create blacklist commands for Posit Package Manager from OSV data} diff --git a/man/create_ppm_xref_whitelist.Rd b/man/create_ppm_xref_whitelist.Rd index e989acd..41141ad 100644 --- a/man/create_ppm_xref_whitelist.Rd +++ b/man/create_ppm_xref_whitelist.Rd @@ -1,5 +1,5 @@ % Generated by roxygen2: do not edit by hand -% Please edit documentation in R/utils.R +% Please edit documentation in R/create_lists.R \name{create_ppm_xref_whitelist} \alias{create_ppm_xref_whitelist} \title{Cross reference a whitelist of packages to a vulnerability database} diff --git a/man/download_osv.Rd b/man/download_osv.Rd index 66425a4..7cd18e5 100644 --- a/man/download_osv.Rd +++ b/man/download_osv.Rd @@ -13,9 +13,20 @@ download_osv(ecosystem = "PyPI", id = NULL, refresh = FALSE) \item{refresh}{Force refresh of the cache to grab latest details from OSV databases.} } +\value{ +A list containing the cache and download locations for the vulnerability files. +} \description{ Helper function to assist in downloading vulnerabilities information from OSV database. } \details{ Any ecosystems listed \href{here}{'https://osv-vulnerabilities.storage.googleapis.com/ecosystems.txt'} can be downloaded. } +\examples{ +osv_dl <- download_osv('CRAN') + +# Clean up +try(unlink(osv_dl$osv_cache, recursive = TRUE)) +try(unlink(osv_dl$dl_dir, recursive = TRUE)) + +} diff --git a/man/fetch_ecosystems.Rd b/man/fetch_ecosystems.Rd index 605d2ce..e4382c9 100644 --- a/man/fetch_ecosystems.Rd +++ b/man/fetch_ecosystems.Rd @@ -1,5 +1,5 @@ % Generated by roxygen2: do not edit by hand -% Please edit documentation in R/query.R +% Please edit documentation in R/utils.R \name{fetch_ecosystems} \alias{fetch_ecosystems} \title{Fetch all available ecosystems} @@ -11,6 +11,22 @@ fetch_ecosystems(offline = FALSE, refresh = FALSE) \item{refresh}{Boolean, force refresh of cache when using online list.} } +\value{ +A data.frame containing all the ecosystem names available in the OSV database. +} \description{ -Fetch all available ecosystems +Internal function used to fetch the available ecosystems in the OSV API. +} +\details{ +The \code{refresh} parameter can be used to force the data to be pulled again +even if one is available in the cached location. Since a fresh pull is performed +for each R session, it is unlikely that this parameter is required and is primarily +reserved for future use if functionality necessitates. +} +\examples{ +rosv:::fetch_ecosystems(offline = TRUE) + +} +\seealso{ +\code{\link{check_ecosystem}} }