Skip to content

Admin Token API: Add support for reading Cluster Agent Tokens

  • Please check this box if this contribution uses AI-generated content (including content generated by GitLab Duo features) as outlined in the GitLab DCO & CLA. As a benefit of being a GitLab Community Contributor, you can request access to GitLab Duo.

What does this MR do and why?

This MR adds support for retrieving information about cluster agent tokens to the Admin Token API. It does not support revoking yet - this will be done in a separate MR to keep things small.

🛠️ with ❤️ at Siemens

References

  • Issue that implements the token information API for the first few token types.

MR acceptance checklist

MR Checklist ( @nwittstruck)

How to set up and validate locally

  1. You'll need to create two new tokens:

    1. A personal access token with admin capabilities.
    2. A cluster agent token that you can query.
  2. Now you can retrieve information about this token:

curl -k --request POST \
--url 'https://gdk.test:3443/api/v4/admin/token \       
--header 'Authorization: Bearer <Admin Token from Step 1.>' \
--header 'Content-Type: application/json' \
--data '{"token": "glagent-token-from-step-1-2"}'

Related to #443597 (closed)

Edited by 🤖 GitLab Bot 🤖

Merge request reports

Loading