diff --git a/DESCRIPTION b/DESCRIPTION index 40358c2..b3e3a8b 100644 --- a/DESCRIPTION +++ b/DESCRIPTION @@ -1,10 +1,11 @@ Package: ConceptLibraryClient Title: Concept Library API Client -Version: 4.1 +Version: 4.2 Authors@R: c( person("Dan", "Thayer", email = "d.s.thayer@swansea.ac.uk", role = "cre"), person("Etienne", "Badoche", email = "e.c.a.badoche@swansea.ac.uk", role = "aut"), - person("Ieuan", "Scanlon", email = "ieuan.scanlon@swansea.ac.uk", role = "aut")) + person("Ieuan", "Scanlon", email = "ieuan.scanlon@swansea.ac.uk", role = "aut"), + person("Jack", "Scanlon", email = "j.a.scanlon@swansea.ac.uk", role = "aut")) Description: This package provides functions which mirror the HTTP requests that can be sent to the Concept Library API. These functions interact with Phenotypes, Concepts, Date Sources, Working Sets and Tags. The Concept Library also provides a public API, and a function is provided to connect to it instead with no authentication needed. @@ -16,7 +17,7 @@ Imports: License: GPL (>= 3) Encoding: UTF-8 LazyData: true -RoxygenNote: 7.2.0 +RoxygenNote: 7.2.3 Suggests: testthat (>= 3.0.0), Config/testthat/edition: 3 diff --git a/R/connection.R b/R/connection.R index 5046cdc..3bb8c98 100644 --- a/R/connection.R +++ b/R/connection.R @@ -37,6 +37,10 @@ Connection <- R6::R6Class( initialize = function ( username=NA, password=NA, public=FALSE, url=DEFAULT_CONNECTION_URL ) { + if (startsWith(url, DOMAINS$GATEWAY)) { + set_gateway_proxy() + } + if (!public) { if (is.na(username) || is.na(password)) { message('Please log in to the Concept Library') diff --git a/R/utils.R b/R/utils.R index daf3de6..ab87641 100644 --- a/R/utils.R +++ b/R/utils.R @@ -1,3 +1,16 @@ +#' set_gateway_proxy +#' +#' @description +#' Sets the user system environment variable to the gateway proxy. +#' This method is only called when the user is utilising the DOMAINS$GATEWAY URL +#' +#' @returns NA +#' +set_gateway_proxy <- function () { + Sys.setenv(http_proxy='http://proxy:8080') + Sys.setenv(https_proxy='http://proxy:8080') +} + #' validate_type #' #' @description diff --git a/man/set_gateway_proxy.Rd b/man/set_gateway_proxy.Rd new file mode 100644 index 0000000..773b48c --- /dev/null +++ b/man/set_gateway_proxy.Rd @@ -0,0 +1,15 @@ +% Generated by roxygen2: do not edit by hand +% Please edit documentation in R/utils.R +\name{set_gateway_proxy} +\alias{set_gateway_proxy} +\title{set_gateway_proxy} +\usage{ +set_gateway_proxy() +} +\value{ +NA +} +\description{ +Sets the user system environment variable to the gateway proxy. +This method is only called when the user is utilising the DOMAINS$GATEWAY URL +}