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

Filter out Stripe client_id #12058

Merged
merged 5 commits into from
Jan 19, 2024
Merged

Conversation

dacook
Copy link
Member

@dacook dacook commented Jan 18, 2024

What? Why?

What should we test?

Stripe specs pass

Dependencies

Ideally we'd deal with this before the next Stripe version bump.

If they follow a rule, it reduces indirection and makes it easier to manage, I reckon.
It's not as beautiful as I hoped, but it enforces the rule. Am I going too far? Probably.
@dacook dacook added the technical changes only These pull requests do not contain user facing changes and are grouped in release notes label Jan 18, 2024
Copy link
Member Author

@dacook dacook left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

As an aside, I'm actually not sure why we need to filter out "bogus_customer" and "bogus_account", as those are stored in .env.test.

spec/support/vcr_setup.rb Show resolved Hide resolved
Copy link
Member

@mkllnk mkllnk left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Excellent!

spec/support/vcr_setup.rb Outdated Show resolved Hide resolved
@filipefurtad0
Copy link
Contributor

As an aside, I'm actually not sure why we need to filter out "bogus_customer" and "bogus_account", as those are stored in .env.test.

I agree, we don't. But when we send out the "real_customer" and "real_account" to Stripe then the corresponding replies (cassettes) may contain these, too. So I think it's ok to include this in the VCR config and scramble them out 👍

We set these bogus credentials on .env.test so that the CI has all the data (although bogus data!) to send out request. Thing is, it does not get to send them, because the cassettes already exist.

This is my understanding of it - I hope I've understood your comment correctly.

Copy link
Contributor

@filipefurtad0 filipefurtad0 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🙌

@filipefurtad0 filipefurtad0 merged commit 487a7b2 into master Jan 19, 2024
52 checks passed
@filipefurtad0 filipefurtad0 deleted the dependabot/bundler/stripe-10.5.0 branch January 19, 2024 10:36
@dacook
Copy link
Member Author

dacook commented Jan 22, 2024

I agree, we don't. But when we send out the "real_customer" and "real_account" to Stripe then the corresponding replies (cassettes) may contain these, too. So I think it's ok to include this in the VCR config and scramble them out 👍

I didn't have a "real" customer or account ID configured when I re-recorded the cassettes, I just had the default "bogus" ones from .env.test which worked fine. If there is a "real" ID returned in the responses, then they haven't been filtered out. (I believe it filters based on an exact match of the value, that is a simple find/replace).

Anyway, I don't see any harm in filtering them out like this.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
technical changes only These pull requests do not contain user facing changes and are grouped in release notes
Projects
Archived in project
Development

Successfully merging this pull request may close these issues.

3 participants