Skip to content

Admin Token API: Identify Runner Authentication 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 identification of runner authentication tokens in the Admin Token API.

Revocation is left out and will be added in a separate MR.

🛠️ with ❤️ at Siemens

References

MR acceptance checklist

MR Checklist ( @nwittstruck)

How to set up and validate locally

  1. Enable feature flag via rails c:
Feature.enable(:admin_agnostic_token_finder)
  1. You'll need to create a personal access token to access the token and the runner authentication token that you'd like to query:

    1. Create a personal access token with admin_mode and api capabilities. Preferences > Access Tokens > Add a new token
    2. Create a new instance runner to get a runner authentication token to query. Admin > CI / CD > Runners > New instance runner
  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 2.1>' \
--header 'Content-Type: application/json' \
--data '{"token": "glrt-token-from-step-2.2"}'
{
	"id": 32,
	"description": "instance-runner-example",
	"ip_address": null,
	"active": true,
	"paused": false,
	"is_shared": true,
	"runner_type": "instance_type",
	"name": null,
	"online": null,
	"status": "never_contacted"
}

Related to #506513 (closed)

Edited by Nicholas Wittstruck

Merge request reports

Loading