Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: Remove additional / from API calls #33

Merged
merged 1 commit into from
Mar 27, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions DESCRIPTION
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
Type: Package
Package: audit.connect
Title: Posit Connect Health Check
Version: 0.7.2
Version: 0.7.3
Authors@R:
person("Jumping", "Rivers", , "[email protected]", role = c("aut", "cre"))
Description: Posit Connect Health Check. Deploys various content types to
Expand Down Expand Up @@ -38,4 +38,4 @@ Config/testthat/edition: 3
Encoding: UTF-8
LazyData: true
Roxygen: list(markdown = TRUE)
RoxygenNote: 7.2.3
RoxygenNote: 7.3.1
3 changes: 3 additions & 0 deletions NEWS.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
# audit.connect 0.7.3 _2024-03-27_
- fix: Remove additional / from user api call

# audit.connect 0.7.2 _2024-01-24_
- fix: If NA, return 0 locked apps

Expand Down
2 changes: 1 addition & 1 deletion R/audit_details.R
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ audit_details = function(server, token) {
# Details on the user running this audit
summarise_user = function(server, token) {
cli::cli_h2("User Summary")
res = httr::GET(paste0(server, "/__api__/v1/user"),
res = httr::GET(paste0(server, "__api__/v1/user"),
httr::add_headers(Authorization = paste("Key", token)))
check_api_status_code(res)
content = httr::content(res)
Expand Down
1 change: 1 addition & 0 deletions R/set_key.R
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ get_account = function() {
account = .connect[["connect_account"]]
account
}

get_server = function(clean = FALSE) {
server = .connect[["connect_server"]]
if (is.null(server)) {
Expand Down
2 changes: 1 addition & 1 deletion R/summarise_versions.R
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ summarise_versions = function(server, token) {

get_server_settings = function(server, token, type = c("r", "python", "quarto")) {
type = match.arg(type)
res = httr::GET(paste0(server, "/__api__/v1/server_settings/", type),
res = httr::GET(paste0(server, "__api__/v1/server_settings/", type),
httr::add_headers(Authorization = paste("Key", token)))
content = httr::content(res)
purrr::map_dfr(content$installations,
Expand Down
4 changes: 0 additions & 4 deletions tests/testthat/test-check.R
Original file line number Diff line number Diff line change
Expand Up @@ -21,8 +21,4 @@ test_that("High level test", {
file.copy(input, tmpdir, overwrite = TRUE)
saveRDS(rtn, file = file.path(tmpdir, "output.rds"))

y = quarto::quarto_render(input = file.path(tmpdir, "report.qmd"),
execute_params = list(input = file.path(tmpdir, "output.rds")))
# Test if file exists
expect_true(file.exists(file.path(tmpdir, "report.html")))
})
Loading