Skip to content

Commit

Permalink
Code review feedback 2
Browse files Browse the repository at this point in the history
Implement cassette scrubbing for cookie values

None of these values are currently sensitive, but the possibility exists
that future cassettes could store sensitive values in the Set-Cookie
headers.
  • Loading branch information
matt-bernhardt committed Jan 13, 2025
1 parent c8d8a25 commit 4bfd7fa
Show file tree
Hide file tree
Showing 5 changed files with 42 additions and 41 deletions.
7 changes: 7 additions & 0 deletions test/test_helper.rb
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,13 @@
VCR.configure do |config|
config.cassette_library_dir = 'test/vcr_cassettes'
config.hook_into :webmock

config.before_record do |interaction|
header = interaction.response&.headers&.[]('Set-Cookie')
header&.each do |redacted_text|
interaction.filter!(redacted_text, '<FAKE_COOKIE_DATA>')
end
end
end

module ActionDispatch
Expand Down
20 changes: 9 additions & 11 deletions test/vcr_cassettes/barcode_39080027236626.yml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

20 changes: 9 additions & 11 deletions test/vcr_cassettes/barcode_not_found.yml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

21 changes: 10 additions & 11 deletions test/vcr_cassettes/pmid_37953305.yml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

15 changes: 7 additions & 8 deletions test/vcr_cassettes/pmid_not_found.yml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit 4bfd7fa

Please sign in to comment.