Skip to content

Commit

Permalink
Filter out api key from vcr cassettes
Browse files Browse the repository at this point in the history
  • Loading branch information
wojtekmach committed Jan 24, 2017
1 parent 66831e2 commit af729ee
Show file tree
Hide file tree
Showing 4 changed files with 8 additions and 3 deletions.
2 changes: 1 addition & 1 deletion fixture/vcr_cassettes/error_on_wrong_input.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
"request": {
"body": "{\"test\":false,\"name\":\"test.pdf\",\"document_url\":\"malformed://address\",\"document_type\":\"pdf\"}",
"headers": {
"Authorization": "Basic aU40Tm9VTVoxTnJoaDN4UXBIME06"
"Authorization": "Basic [FILTERED]"
},
"method": "post",
"options": {
Expand Down
2 changes: 1 addition & 1 deletion fixture/vcr_cassettes/generate_pdf_from_string.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
"request": {
"body": "{\"test\":false,\"name\":\"test.pdf\",\"document_type\":\"pdf\",\"document_content\":\"<html><body>Hello</body></html>\"}",
"headers": {
"Authorization": "Basic aU40Tm9VTVoxTnJoaDN4UXBIME06"
"Authorization": "Basic [FILTERED]"
},
"method": "post",
"options": {
Expand Down
2 changes: 1 addition & 1 deletion fixture/vcr_cassettes/generate_pdf_from_url.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
"request": {
"body": "{\"test\":false,\"name\":\"test.pdf\",\"document_url\":\"https://google.com\",\"document_type\":\"pdf\"}",
"headers": {
"Authorization": "Basic aU40Tm9VTVoxTnJoaDN4UXBIME06"
"Authorization": "Basic [FILTERED]"
},
"method": "post",
"options": {
Expand Down
5 changes: 5 additions & 0 deletions test/velociraptor_test.exs
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,11 @@ defmodule VelociraptorTest do
use ExUnit.Case, async: true
use ExVCR.Mock, adapter: ExVCR.Adapter.Httpc

setup do
ExVCR.Config.filter_sensitive_data("Basic .*", "Basic [FILTERED]")
:ok
end

test "generates a PDF from a provided HTML string" do
use_cassette "generate_pdf_from_string" do
client = Velociraptor.new
Expand Down

0 comments on commit af729ee

Please sign in to comment.