Admin Token API: Revoke Impersonation tokens

What does this MR do and why?

Impersonation tokens are already supported by the Admin Token API, since underneath they are PATs. This MR updates the docs and adds a spec for this.

🛠️ with ❤️ at Siemens

References

MR acceptance checklist

checklist

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 impersonation 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 an impersonation token to query. Admin > Users > User-X > Impersonation tokens > Add token
  2. Now you can revoke the token:
curl -k --request DELETE \
--url 'https://gdk.test:3443/api/v4/admin/token' \
--header 'Authorization: Bearer <Admin Token from Step 1.>' \
--header 'Content-Type: application/json' \
--data '{"token": "glpat-token-from-step-1-2"}'

Related to #499958 (closed)

Edited by 🤖 GitLab Bot 🤖

Merge request reports

Loading