Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

SUP-1248: Use process substitution to hide auth token #64

Merged
merged 4 commits into from Jan 9, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
4 changes: 1 addition & 3 deletions hooks/pre-exit
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
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