Skip to content

Commit

Permalink
Merge pull request #64 from buildkite-plugins/SUP-1248
Browse files Browse the repository at this point in the history
SUP-1248: Use process substitution to hide auth token
  • Loading branch information
tomowatt authored Jan 9, 2024
2 parents fb7da5d + 0afd299 commit b0caed3
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
4 changes: 1 addition & 3 deletions hooks/pre-exit
Original file line number Diff line number Diff line change
Expand Up @@ -137,9 +137,7 @@ upload() {
echo curl "${curl_args[@]}"
fi

curl_args+=("-H" "Authorization: Token token=\"$TOKEN_VALUE\"")

curl "${curl_args[@]}"
curl "${curl_args[@]}" -H @<(printf 'Authorization: Token token=\"%s\"\n' "${TOKEN_VALUE}")
}

# Runs the whole plugin logic for a particular find pattern
Expand Down
2 changes: 2 additions & 0 deletions tests/pre-exit-report-link.bats
Original file line number Diff line number Diff line change
Expand Up @@ -76,6 +76,7 @@ COMMON_CURL_OPTIONS='--form \* --form \* --form \* --form \* --form \* --form \*
assert_output --partial "Uploading './tests/fixtures/junit-1.xml'..."
assert_output --partial "Uploading './tests/fixtures/junit-2.xml'..."
assert_output --partial "curl success 1"
assert_output --partial "curl success 2"
assert_output --partial "curl success 3"
assert_output --partial "Got 1 report URLs."
assert_output --partial "annotation success"
Expand Down Expand Up @@ -104,6 +105,7 @@ COMMON_CURL_OPTIONS='--form \* --form \* --form \* --form \* --form \* --form \*
assert_output --partial "Uploading './tests/fixtures/junit-1.xml'..."
assert_output --partial "Uploading './tests/fixtures/junit-3.xml'..."
assert_output --partial "curl success 1"
assert_output --partial "curl success 2"
assert_output --partial "curl success 3"
assert_output --partial "Got 2 report URLs."
assert_output --partial "- [Report #1](https://buildkite.com/organizations/example/analytics/suites/collector-test/runs/1)"
Expand Down

0 comments on commit b0caed3

Please sign in to comment.