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

Impersonate values in the VCR Cassette file API response #954

Open
RazvanFarte opened this issue Nov 18, 2022 · 1 comment
Open

Impersonate values in the VCR Cassette file API response #954

RazvanFarte opened this issue Nov 18, 2022 · 1 comment

Comments

@RazvanFarte
Copy link

Is your feature request related to a problem? Please describe.
Is there a way to create impersonate emails, phone numbers and names from the server response once the cassette file is stored, or before the file is stored?
I'm working on a setup in which VCR is configured to hit a production API, not ours, read only, to get the data for testing and store it in a file. It's useful as the data stored is matching the production API, thus real data based tests. Although some of the is personal identifying data and it's not the best for GDPR.
Currently I can manually remove and alter that data in the cassette file before committing to the VCS, but there was already some such data committed to VCS and it's in the history. It's a private repo, although it's better not to mess with GDPR.

Describe the solution you'd like
Automatically convert the data in the response body of the requests, for all VCR cassettes in the test suite, to dummy data, for field types "email", "phone" and maybe "custom" based on a regex; to have the configuration available in "VCR.configure"

Describe alternatives you've considered
Manually impersonate the data after VCR stores the files, before commiting to VCS

Additional context

@RazvanFarte
Copy link
Author

Just found #38. Seems a duplicate and seems that this setup could be used for our case

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

1 participant