diff --git a/.env.test b/.env.test index a2190c418c..535d37a9e0 100644 --- a/.env.test +++ b/.env.test @@ -14,6 +14,3 @@ SITE_URL="test.host" OPENID_APP_ID="test-provider" OPENID_APP_SECRET="12345" - -CLIENT_SECRET =~ /secret.+/ -HOSTNAME =~ /"hostname":".+"/ diff --git a/spec/support/vcr_setup.rb b/spec/support/vcr_setup.rb index 256bdb07cb..01cc2d9033 100644 --- a/spec/support/vcr_setup.rb +++ b/spec/support/vcr_setup.rb @@ -16,9 +16,13 @@ VCR.configure do |config| STRIPE_ACCOUNT STRIPE_CLIENT_ID STRIPE_ENDPOINT_SECRET - CLIENT_SECRET - HOSTNAME ].each do |env_var| config.filter_sensitive_data("") { ENV.fetch(env_var, nil) } end + config.filter_sensitive_data('') { |interaction| + interaction.request.headers['X-Stripe-Client-User-Agent']&.public_send(:[], 0) + } + config.filter_sensitive_data('') { |interaction| + interaction.response.body.match(/"client_secret": "(pi_.+)"/)&.public_send(:[], 1) + } end