trabajo-afectivo/spec/support/vcr_mask_zendesk_sensitive_data.rb
2021-08-26 14:14:40 +02:00

12 lines
628 B
Ruby

# Copyright (C) 2012-2021 Zammad Foundation, http://zammad-foundation.org/
VCR.configure do |c|
# The API key is used only inside the base64 encoded Basic Auth string, so mask that as well.
c.filter_sensitive_data('<IMPORT_ZENDESK_ENDPOINT_BASIC_AUTH>') { Base64.encode64("#{ENV['IMPORT_ZENDESK_ENDPOINT_USERNAME']}/token:#{ENV['IMPORT_ZENDESK_ENDPOINT_KEY']}").lines(chomp: true).join }
# The hostname of the Zendesk endpoint URL used as well
if ENV['IMPORT_ZENDESK_ENDPOINT'].present?
c.filter_sensitive_data('<IMPORT_ZENDESK_ENDPOINT_HOSTNAME>') { URI.parse(ENV['IMPORT_ZENDESK_ENDPOINT']).hostname }
end
end