Skip to content

Commit

Permalink
use base64 encoded secrets in test to avoid base64 errors with new li…
Browse files Browse the repository at this point in the history
…bssl (#1131)

fixes #1130
  • Loading branch information
aronatkins authored Jan 22, 2025
1 parent 7d19c75 commit e43e273
Show file tree
Hide file tree
Showing 4 changed files with 7 additions and 4 deletions.
3 changes: 3 additions & 0 deletions NEWS.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,8 @@
# rsconnect (development version)

* Use base64 encoded test data. Addresses CRAN test failures when run with
newer libssl. (#1130)

# rsconnect 1.3.3

* Avoid "legacy" time zone names in tests, as they are not available by
Expand Down
4 changes: 2 additions & 2 deletions tests/testthat/_snaps/http.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,11 +11,11 @@
# authHeaders() picks correct method based on supplied fields

Code
str(authHeaders(list(secret = "123"), url, "GET"))
str(authHeaders(list(secret = openssl::base64_encode("123")), url, "GET"))
Output
List of 3
$ Date : chr "Thu, 09 Mar 2023 14:29:00 GMT"
$ X-Auth-Signature : chr "YmJiMjM1Y2E5MjFlNGFkOTMxZjQxNzU4NGQ1ZTk3MzYyYzg1YjcyMzUyMzhlYTY4Y2UxMjI1MzJkZWE1MDA3NQ==; version=1"
$ X-Auth-Signature : chr "ZmQwNjkxNGVmZmZiN2FjNzkzZTkwYzE4OTg1Y2M5NTIxNGZjNTcxY2I5M2RhYzFiNWIxODY5NjFjODMzYjE3ZA==; version=1"
$ X-Content-Checksum: chr "d41d8cd98f00b204e9800998ecf8427e"
Code
str(authHeaders(list(private_key = key), url, "GET"))
Expand Down
2 changes: 1 addition & 1 deletion tests/testthat/test-client-cloud.R
Original file line number Diff line number Diff line change
Expand Up @@ -120,7 +120,7 @@ configureTestAccount <- function(server = "posit.cloud", name = NULL) {
setAccountInfo(
name = name,
token = "foo",
secret = "bar",
secret = openssl::base64_encode("bar"),
server = server
)
}
Expand Down
2 changes: 1 addition & 1 deletion tests/testthat/test-http.R
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ a3hEFijsjg/+FDMr+iAVzjry
key <- openssl::base64_encode(openssl::read_key(key_string))

expect_snapshot({
str(authHeaders(list(secret = "123"), url, "GET"))
str(authHeaders(list(secret = openssl::base64_encode("123")), url, "GET"))
str(authHeaders(list(private_key = key), url, "GET"))
})

Expand Down

0 comments on commit e43e273

Please sign in to comment.