Draft: Add API endpoint to retrieve an `id_token`
What does this MR do and why?
Describe in detail what your merge request does and why.
Allows programs running in CI to receive OIDC tokens automatically using CI_JOB_TOKEN.
Relates to: #388514 (closed)
Screenshots or screen recordings
Screenshots are required for UI changes, and strongly recommended for all other merge requests.
How to set up and validate locally
Numbered steps to set up and validate the change are strongly suggested.
-
Configure your GDK with GitLab Runner
-
Create a new project
-
Add a
.gitlab-ci.yml
with the following content:get_jwt: image: alpine:latest script: - apk add --update jq curl - | curl -v -H "JOB-TOKEN: $CI_JOB_TOKEN" "${CI_API_V4_URL}/job/id_token" -d aud=my-aud | jq '.id_token | split(".") | .[0],.[1] | @base64d | fromjson'
-
Check the CI job log. The token data will be printed there.
MR acceptance checklist
This checklist encourages us to confirm any changes have been analyzed to reduce risks in quality, performance, reliability, security, and maintainability.
-
I have evaluated the MR acceptance checklist for this MR.
Edited by Brian Williams