From a80acf4899221ec1948531aaba7c6aa9dc722314 Mon Sep 17 00:00:00 2001 From: Richard Littauer Date: Fri, 11 Oct 2024 12:00:17 +1300 Subject: [PATCH] feat: Remove sensitive data from vcr --- tests/testthat/helper-vcr.R | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/tests/testthat/helper-vcr.R b/tests/testthat/helper-vcr.R index b2abf49..8e8f767 100644 --- a/tests/testthat/helper-vcr.R +++ b/tests/testthat/helper-vcr.R @@ -1,6 +1,12 @@ library("vcr") # *Required* as vcr is set up on loading invisible(vcr::vcr_configure( filter_sensitive_data = list("<<>>" = Sys.getenv('EBIRD_KEY')), + # Remove sensitive information about tester from cassettes + filter_sensitive_data_regex = list( + '"ip": "redacted"' = '"ip": "[0-9.]+"', + '"hostname": "redacted"' = '"hostname": "[^"]*"', + '"org": "redacted"' = '"org": "[^"]*"' + ), dir = vcr::vcr_test_path("fixtures") )) vcr::check_cassette_names()