filter_sensitive_data simply wraps a more flexible, fundamental
API...before record/playback hooks:
https://github.com/vcr/vcr/blob/v2.4.0/lib/vcr/configuration.rb#L218-L231
You can write your own hooks. It could be something like:
VCR.configure do |c|
c.before_record do |interaction|
decoded_body = Base64.decode(interaction.response.body)
decoded_body.gsub!(ENV['PASSWORD']), '<PASSWORD>')
interaction.response.body = Base64.encode(decoded_body)
end
c.before_playback do |interaction|
decoded_body = Base64.decode(interaction.response.body)
decoded_body.gsub!('<PASSWORD>', ENV['PASSWORD'])
interaction.response.body = Base64.encode(decoded_body)
end
end
HTH,
Myron