Admin Token API: Identify Pipeline trigger 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 identifying pipeline trigger tokens to the Admin Token API
.
References
- Issue: #506554 (closed)
- Epic: &15777
- Docs: https://docs.gitlab.com/ee/api/admin/token.html
MR acceptance checklist
MR Checklist ( @nwittstruck)
-
Changelog entry added, if necessary -
Documentation created/updated via this MR -
Documentation reviewed by technical writer or follow-up review issue created -
Tests added for this feature/bug -
Tested in all supported browsers -
Conforms to the code review guidelines -
Conforms to the merge request performance guidelines -
Conforms to the style guides -
Conforms to the javascript style guides -
Conforms to the database guides
How to set up and validate locally
- Enable feature flag via
rails c
:
Feature.enable(:admin_agnostic_token_finder)
- You'll need to create a
personal access token
to access the token and therunner authentication
token that you'd like to query: - 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": "glptt-token-from-step-2.2"}'
{
"id": 1,
"token": "glptt-abc",
"description": "example",
"created_at": "2024-11-27T14:18:29.113Z",
"updated_at": "2024-11-27T14:18:29.113Z",
"last_used": null,
"owner": {
}
}
Related to #506554 (closed)
Edited by Nicholas Wittstruck