From 2a9fe2a503a0825b34b7d33ecab0e9ad93eb036e Mon Sep 17 00:00:00 2001 From: Richard Littauer Date: Sat, 12 Apr 2025 12:31:18 +1200 Subject: [PATCH] Add an example filter to vcr_configure See https://github.com/ropensci/vcr/issues/272#issuecomment-2791461513. --- R/configuration.R | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/R/configuration.R b/R/configuration.R index 8bf6e0c4..7d76b89e 100644 --- a/R/configuration.R +++ b/R/configuration.R @@ -160,6 +160,15 @@ #' vcr_configure(dir = tempdir(), #' filter_sensitive_data = list(foo = "", hello = "") #' ) +#' vcr_configure( +#' # Use regex to remove sensitive information (e.g. IP data) from cassettes +#' filter_sensitive_data_regex = list( +#' '"ip": "redacted"' = '"ip": "[0-9.]+"', +#' '"hostname": "redacted"' = '"hostname": "[^"]*"', +#' '"org": "redacted"' = '"org": "[^"]*"' +#' ), +#' dir = tempdir() +#') #' @export vcr_configure <- function(...) {