Skip to content

Commit

Permalink
set ssl_verify=0 in aqs function
Browse files Browse the repository at this point in the history
  • Loading branch information
mccroweyclinton-EPA committed Jul 25, 2023
1 parent 9a605e8 commit e217cb7
Show file tree
Hide file tree
Showing 5 changed files with 26 additions and 7 deletions.
8 changes: 4 additions & 4 deletions MD5
Original file line number Diff line number Diff line change
Expand Up @@ -117,9 +117,9 @@ f41ed996be135fb35afe00641621da61 *man/figures/lifecycle-questioning.svg
ed42e3fbd7cc30bc6ca8fa9b658e24a8 *man/figures/lifecycle-stable.svg
bf2f1ad432ecccee3400afe533404113 *man/figures/lifecycle-superseded.svg
7ce4525010156c02adaf819a8c835134 *man/RAQSAPI.Rd
d54578e689123033bdc0f894eb441c7e *NAMESPACE
b9c254cb8186dd9711be9b0a04a55ebd *NAMESPACE
94c65e3824d4fd9ffa90ec73fed63596 *NEWS.md
7cb0c1a65c83e6f94eb1309fac9b0d87 *R/AQSAPI_helperfunctions.R
cd77b18f3f8fda5c82c40a9eb815b812 *R/AQSAPI_helperfunctions.R
a3558975d0256839b174ab7868833075 *R/bybox.R
bd8b36cc7325d4fc8b8ed894f0046678 *R/bycbsa.R
253ea551f88c65c1c49feff3cb33f552 *R/bycounty.R
Expand Down Expand Up @@ -148,8 +148,8 @@ c883634140b22f5fb97c08f909ce377e *tests/testthat/test-byCBSA.R
f7ea691da1baf266047ed7af4b0c4629 *tests/testthat/test-bypqao.R
41e407548ac72ec4f41e678d23a566dd *tests/testthat/test-bysite.R
051416af24d0386f084eb13a14053ce1 *tests/testthat/test-bystate.R
25648d9e388d85a6ba8449bec950ee28 *tests/testthat/test-helperfunctions.R
def7331bf9e0d31fdee6185008e9fc99 *tests/testthat/test-RAQSAPlistfunctions.R
014b81fb9c8d2350e1347841f41b24a3 *tests/testthat/test-helperfunctions.R
8392bc0bfa62b60485a925a2517475a6 *tests/testthat/test-RAQSAPlistfunctions.R
8ec3157359d9a0fbdf126ed74f399ee1 *vignettes/Acknowledgements.html
49025d261826350f3050e677eab9dbac *vignettes/Acknowledgements.Rmd
22d607e5d49e10047a911e5d42183c34 *vignettes/acs-nano.csl
Expand Down
1 change: 1 addition & 0 deletions NAMESPACE
Original file line number Diff line number Diff line change
Expand Up @@ -106,6 +106,7 @@ importFrom(dplyr,select)
importFrom(dplyr,select_if)
importFrom(dplyr,vars)
importFrom(glue,glue)
importFrom(httr2,req_options)
importFrom(httr2,req_perform)
importFrom(httr2,req_url_path_append)
importFrom(httr2,req_user_agent)
Expand Down
5 changes: 3 additions & 2 deletions R/AQSAPI_helperfunctions.R
Original file line number Diff line number Diff line change
Expand Up @@ -376,7 +376,7 @@ aqs_ratelimit <- function(waittime=5L)
#' @importFrom glue glue
#' @importFrom tibble as_tibble
#' @importFrom httr2 request req_user_agent req_url_path_append resp_body_json
#' req_perform
#' req_perform req_options
#' @return a AQS_DATAMART_APIv2 S3 object that is the return value from the
#' AQS API. A AQS_DATAMART_APIv2 is a 2 item named list in which the
#' first item ($Header) is a tibble of header information from the
Expand All @@ -399,7 +399,8 @@ aqs <- function(service, filter = NULL, user = NA,
glue(format_variables_for_api(c(list(email = I(user), key = user_key),
variables))) %>%
request() %>%
httr::config(ssl_cipher_list = 'DEFAULT@SECLEVEL=1')
req_options(ssl_verifypeer = 0)
#req_options(ssl_cipher_list = 'DEFAULT@SECLEVEL=1')
#for some reason user_agent isn't working
#%>%
#req_user_agent(string = user_agent)
Expand Down
5 changes: 4 additions & 1 deletion tests/testthat/test-RAQSAPlistfunctions.R
Original file line number Diff line number Diff line change
@@ -1,6 +1,9 @@
#' @importFrom magrittr `%>%`()
#' @import testthat
test_that("list functions", {
#' @importFrom magrittr `%>%`()
#' @import testthat

test_that("test list functions", {
testthat::skip_on_cran()
testthat::skip_if_offline()

Expand Down
14 changes: 14 additions & 0 deletions tests/testthat/test-helperfunctions.R
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,20 @@ testthat::skip_if_offline()
testthat::skip_on_cran()
server <- "AQSDatamartAPI"

if(file.exists("local.R"))
{
source("helper.R")
AQScredentials <- RAQSAPItestsetup_helper()
datamartAPI_user <- AQScredentials$datamartAPI_user
datamartAPI_key <- AQScredentials$datamartAPI_key
} else {
datamartAPI_user <- Sys.getenv("RAQSAPIKEY", names = TRUE)
datamartAPI_key <- Sys.getenv("RAQSAPIUSERNAME", names = TRUE)
}
RAQSAPI::aqs_credentials(username = datamartAPI_user,
key = datamartAPI_key
)

RAQSAPI:::checkaqsparams(parameter = "abcdefg") %>%
expect_error()
RAQSAPI:::checkaqsparams(bdate = "notadate") %>%
Expand Down

0 comments on commit e217cb7

Please sign in to comment.