-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add sanitize() function, which wipes personal data and adds user URLs (…
…#29) --------- Co-authored-by: Colin Gillespie <[email protected]>
- Loading branch information
1 parent
c6357e2
commit cd8a282
Showing
9 changed files
with
55 additions
and
8 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,14 +1,14 @@ | ||
Type: Package | ||
Package: audit.connect | ||
Title: Posit Connect Health Check | ||
Version: 0.6.3 | ||
Version: 0.7.0 | ||
Authors@R: | ||
person("Jumping", "Rivers", , "[email protected]", role = c("aut", "cre")) | ||
Description: Posit Connect Health Check. Deploys various content types to | ||
assess whether Connect is functioning correctly. | ||
License: file LICENSE | ||
Imports: | ||
audit.base (>= 0.6.9), | ||
audit.base (>= 0.6.10), | ||
cli, | ||
connectapi (>= 0.1.3.1), | ||
dplyr, | ||
|
@@ -22,7 +22,6 @@ Imports: | |
quarto (>= 1.3), | ||
rlang, | ||
rsconnect (>= 1.1.0), | ||
serverHeaders, | ||
stringr, | ||
tibble | ||
Suggests: | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
#' Sanitise {audit.connect} object | ||
#' | ||
#' This function removes user-identifying data from an {audit.connect} object | ||
#' @param audit_connect_check An object from audit.connect::check() | ||
#' @export | ||
sanitise = function(audit_connect_check) { | ||
# Wipe any user-identifiable data | ||
for (value in c("email", "first_name", "last_name", "username")) { | ||
audit_connect_check$users_details$user_list$users[, value] = NA_character_ | ||
} | ||
audit_connect_check | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
describe("Checking sanitize function", { | ||
testthat::skip_on_ci() | ||
# Skip report checks for speed | ||
create_config(default = FALSE, type = "force") | ||
rtn = suppressMessages(check()) | ||
sanitize_rtn = sanitise(rtn) | ||
|
||
it("Check users have been changed", | ||
expect_false(identical(rtn[["users_details"]], | ||
sanitize_rtn[["users_details"]])) | ||
) | ||
|
||
it("Check everything else has stayed the same", { | ||
rtn[["users_details"]] = sanitize_rtn[["users_details"]] = NULL | ||
expect_identical(rtn, sanitize_rtn) | ||
}) | ||
}) |