Add Feed Tokens to Token information API
requested to merge gitlab-community/gitlab:443597-nwittstruck-admin-api-token-info-feed-token into master
-
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?
Due to the refactoring of the token identification, the Token information API can now handle feed tokens.
This commit adds a spec and updates the documentation.
References
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 and retrieve your feed token:
-
Now you can retrieve information about this token:
curl --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": "glft-<example-token>"}'
{
"id": 1,
"username": "root",
"name": "Administrator",
"state": "active",
...
}
Related to #443597 (closed)
Edited by Nicholas Wittstruck