[8.11] fix/redact axios headers (#171803) (#171808)

# Backport

This will backport the following commits from `main` to `8.11`:
- [fix/redact axios headers
(#171803)](https://github.com/elastic/kibana/pull/171803)

<!--- Backport version: 8.9.7 -->

### Questions ?
Please refer to the [Backport tool
documentation](https://github.com/sqren/backport)

<!--BACKPORT [{"author":{"name":"Brad
White","email":"Ikuni17@users.noreply.github.com"},"sourceCommit":{"committedDate":"2023-11-22T22:12:33Z","message":"fix/redact
axios headers (#171803)\n\nFix token
things\r\n\r\n---------\r\n\r\nCo-authored-by: Kibana Machine
<42973632+kibanamachine@users.noreply.github.com>","sha":"17ed0748e8d7671df31291d7b2bce5460c74b0f5","branchLabelMapping":{"^v8.12.0$":"main","^v(\\d+).(\\d+).\\d+$":"$1.$2"}},"sourcePullRequest":{"labels":["Team:Operations","release_note:skip","backport:all-open","v8.12.0"],"number":171803,"url":"https://github.com/elastic/kibana/pull/171803","mergeCommit":{"message":"fix/redact
axios headers (#171803)\n\nFix token
things\r\n\r\n---------\r\n\r\nCo-authored-by: Kibana Machine
<42973632+kibanamachine@users.noreply.github.com>","sha":"17ed0748e8d7671df31291d7b2bce5460c74b0f5"}},"sourceBranch":"main","suggestedTargetBranches":[],"targetPullRequestStates":[{"branch":"main","label":"v8.12.0","labelRegex":"^v8.12.0$","isSourceBranch":true,"state":"MERGED","url":"https://github.com/elastic/kibana/pull/171803","number":171803,"mergeCommit":{"message":"fix/redact
axios headers (#171803)\n\nFix token
things\r\n\r\n---------\r\n\r\nCo-authored-by: Kibana Machine
<42973632+kibanamachine@users.noreply.github.com>","sha":"17ed0748e8d7671df31291d7b2bce5460c74b0f5"}}]}]
BACKPORT-->

Co-authored-by: Brad White <Ikuni17@users.noreply.github.com>
This commit is contained in:
Kibana Machine 2023-11-22 18:27:19 -05:00 committed by GitHub
parent 79a4a3cfdc
commit 268df575fd
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
3 changed files with 8 additions and 10 deletions

View file

@ -201,7 +201,7 @@ export class CiStatsClient {
headers: this.defaultHeaders,
});
} catch (error) {
console.error('CI Stats request error:', error);
console.error('CI Stats request error:', error?.response?.data?.message);
if (attempt < maxAttempts) {
const sec = attempt * 3;
@ -210,7 +210,7 @@ export class CiStatsClient {
continue;
}
throw error;
throw new Error('Failed to connect to CI Stats.');
}
}
}

View file

@ -8,8 +8,6 @@ if [[ "${GITHUB_BUILD_COMMIT_STATUS_ENABLED:-}" != "true" ]]; then
"$(dirname "${0}")/commit_status_start.sh"
fi
export CI_STATS_TOKEN="$(retry 5 5 vault read -field=api_token secret/kibana-issues/dev/kibana_ci_stats)"
export CI_STATS_HOST="$(retry 5 5 vault read -field=api_host secret/kibana-issues/dev/kibana_ci_stats)"
ts-node "$(dirname "${0}")/ci_stats_start.ts"

View file

@ -77,16 +77,16 @@ EOF
{
CI_STATS_BUILD_ID="$(buildkite-agent meta-data get ci_stats_build_id --default '')"
export CI_STATS_BUILD_ID
CI_STATS_TOKEN="$(retry 5 5 vault read -field=api_token secret/kibana-issues/dev/kibana_ci_stats)"
export CI_STATS_TOKEN
CI_STATS_HOST="$(retry 5 5 vault read -field=api_host secret/kibana-issues/dev/kibana_ci_stats)"
export CI_STATS_HOST
if [[ "$CI_STATS_BUILD_ID" ]]; then
echo "CI Stats Build ID: $CI_STATS_BUILD_ID"
CI_STATS_TOKEN="$(retry 5 5 vault read -field=api_token secret/kibana-issues/dev/kibana_ci_stats)"
export CI_STATS_TOKEN
CI_STATS_HOST="$(retry 5 5 vault read -field=api_host secret/kibana-issues/dev/kibana_ci_stats)"
export CI_STATS_HOST
KIBANA_CI_STATS_CONFIG=$(jq -n \
--arg buildId "$CI_STATS_BUILD_ID" \
--arg apiUrl "https://$CI_STATS_HOST" \