Skip to content

Commit ef7286e

Browse files
committed
Make one call to app key enabled policy
1 parent 7350e20 commit ef7286e

2 files changed

Lines changed: 5 additions & 9 deletions

File tree

.gitlab-ci.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -619,5 +619,5 @@ test-dd-sts:
619619
aud: rapid-seceng-sit
620620
script:
621621
- apt-get update && apt-get install -y curl
622-
- 'curl -s -o /dev/null -w "API key request http status code: %{http_code}\n" -H "Authorization: Bearer ${DD_STS_OIDC_TOKEN}" "https://dd-sts.us1.ddbuild.io/sts/datadog/exchange?policy=dd-trace-py-gitlab"'
623-
- 'curl -s -o /dev/null -w "APP key request http status code: %{http_code}\n" -H "Authorization: Bearer ${DD_STS_OIDC_TOKEN}" "https://dd-sts.us1.ddbuild.io/sts/datadog/exchange?policy=dd-trace-py-gitlab-app-key"'
622+
- 'echo "API key policy: $(curl -s -o /dev/null -w %{http_code} -H "Authorization: Bearer ${DD_STS_OIDC_TOKEN}" https://dd-sts.us1.ddbuild.io/sts/datadog/exchange?policy=dd-trace-py-gitlab)"'
623+
- 'echo "APP key policy: $(curl -s -o /dev/null -w %{http_code} -H "Authorization: Bearer ${DD_STS_OIDC_TOKEN}" https://dd-sts.us1.ddbuild.io/sts/datadog/exchange?policy=dd-trace-py-gitlab-app-key)"'

.gitlab/release.yml

Lines changed: 3 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -54,15 +54,11 @@ notify_datadog_release:
5454
before_script:
5555
- apt-get update && apt-get install --no-install-recommends -y curl jq
5656
- >-
57-
DD_STS_API_KEY=$(curl -sS
58-
-H "Authorization: Bearer ${DD_STS_OIDC_TOKEN}"
59-
"https://dd-sts.us1.ddbuild.io/sts/datadog/exchange?policy=dd-trace-py-gitlab")
60-
- >-
61-
DD_STS_APP_KEY=$(curl -sS
57+
DD_STS_RESPONSE=$(curl -sS
6258
-H "Authorization: Bearer ${DD_STS_OIDC_TOKEN}"
6359
"https://dd-sts.us1.ddbuild.io/sts/datadog/exchange?policy=dd-trace-py-gitlab-app-key")
64-
- export DD_API_KEY=$(echo "$DD_STS_API_KEY" | jq -re '.api_key')
65-
- export DD_APP_KEY=$(echo "$DD_STS_APP_KEY" | jq -re '.application_key')
60+
- export DD_API_KEY=$(echo "$DD_STS_RESPONSE" | jq -re '.api_key')
61+
- export DD_APP_KEY=$(echo "$DD_STS_RESPONSE" | jq -re '.application_key')
6662
script:
6763
- |
6864
echo "Tag: ${CI_COMMIT_TAG} -> Commit SHA: ${CI_COMMIT_SHA}"

0 commit comments

Comments
 (0)