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

Remove IP-based location determination? #115

Open
slager opened this issue Mar 8, 2024 · 4 comments
Open

Remove IP-based location determination? #115

slager opened this issue Mar 8, 2024 · 4 comments

Comments

@slager
Copy link
Collaborator

slager commented Mar 8, 2024

I'm wondering if we should just remove the IP-based location determination. It's neat, but it creates potential privacy issues by exposing IP address and coordinates in the VCR fixtures. Also my experimenting with it shows that the location can be quite far off from my actual location.

@sebpardo
Copy link
Contributor

Is there a way to hide IP addresses and coordinates in VCR the same way we hide the API key?

@jrdnbradford
Copy link
Contributor

It looks like you can filter data via regex in {vcr}, so something like this would remove coordinates from URLs and JSON strings in the fixtures:

library("vcr") # *Required* as vcr is set up on loading
invisible(vcr::vcr_configure(
  filter_sensitive_data = list("<<<redacted>>>" = Sys.getenv('EBIRD_KEY')),
+ filter_sensitive_data_regex = list(
+   '"lat":<<<redacted>>>' = '("lat"|"latitude"):(-?\\d+(\\.\\d+)?)',
+   "lat=<<<redacted>>>" = '(lat|latitude)=(-?\\d+(\\.\\d+)?)',
+   '"lng":<<<redacted>>>' = '("lng"|:"longitude"):(-?\\d+(\\.\\d+)?)',
+   "lng=<<<redacted>>>" = '(lng|longitude)=(-?\\d+(\\.\\d+)?)'
+ ),
  dir = vcr::vcr_test_path("fixtures")
))

If redaction is the route you want to go I'm happy to take a look.

@slager
Copy link
Collaborator Author

slager commented Jul 15, 2024

I tried at one point using vcr/regex to redact latitude, longitude, and IP address, but iirc the tricky part is that they occur inside a long string value. If you can get it to work, go for it.

@sebpardo sebpardo mentioned this issue Aug 27, 2024
19 tasks
@jrdnbradford
Copy link
Contributor

I tried a few things but every solution I tried that redacted the relevant data ended up causing issues with the vcr testing setup. 🫠

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants