Admin Token API: Identify Incoming Email Tokens
What does this MR do and why?
This MR adds support for identifying incoming email tokens to the Admin Token API.
References
- Issue: #512033 (closed)
- Epic: &15777
- Docs: https://docs.gitlab.com/ee/api/admin/token.html
MR acceptance checklist
checklist
-
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
-
You'll need to create a
personal access tokento access the token and get anincoming mail tokentoken that you'd like to query:-
Create a
personal access tokenwithadmin_modeandapicapabilities.Preferences > Access Tokens > Add a new token - You'll need an incoming email token of a user. If you've seeded the GDK, you can get a token from an existing user in the
rails console:
-
Create a
User.last.incoming_email_token
- 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": "glimt-token-from-step-2.2"}'
{
"id": 68,
"username": "reported_user_22",
"name": "Diann Turcotte",
"state": "active",
...
}
Related to #512033 (closed)
Edited by Nicholas Wittstruck