Skip to content

Commit 0094152

Browse files
committed
SS-1154: Address latest review comments.
1 parent 9e65787 commit 0094152

2 files changed

Lines changed: 4 additions & 6 deletions

File tree

R/DataMart.R

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -507,7 +507,7 @@ getCompanySecret <- function()
507507
return (secret)
508508
}
509509

510-
#' Gets document secret from the environment. Throws an error if not found.
510+
#' Gets document secret from the environment or an empty string if not found.
511511
#'
512512
#' @return Document secret token as a string.
513513
#'

tests/testthat/test-datamart-secrets.R

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -3,12 +3,10 @@ localGlobal("projectSecret", "test_project_secret")
33

44
test_env = new.env() # holds HTTP header verification result that is put there by mocked HTTP function and is used by the tests below
55

6-
verifyHttpHeaders <- function(headers = list(), expect_company_secret_header_to_be_equivalent_to_company_secret, expect_project_secret_header_to_be_equivalent_to_project_secret)
6+
verifyHttpHeaders <- function(headers = character(0), expect_company_secret_header_to_be_equivalent_to_company_secret, expect_project_secret_header_to_be_equivalent_to_project_secret)
77
{
8-
companySecretHeader = headers["X-Q-Company-Secret"];
9-
companySecretHeader <- ifelse(is.null(companySecretHeader), "", companySecretHeader)
10-
projectSecretHeader = headers["X-Q-Project-Secret"];
11-
projectSecretHeader <- ifelse(is.null(projectSecretHeader), "", projectSecretHeader)
8+
companySecretHeader = headers[["X-Q-Company-Secret"]] %||% ""
9+
projectSecretHeader = headers[["X-Q-Project-Secret"]] %||% ""
1210
httpResponse <- structure(list(status_code = 200, content = "mock"), class = "response")
1311
companySecret <- getCompanySecret()
1412
projectSecret <- getProjectSecret()

0 commit comments

Comments
 (0)