Skip to content

Admin Token API: Revoke Feature Flags Client token

What does this MR do and why?

This MR adds support for feature flag clients tokens to the Admin Token API. It resets the runner token when called.

🛠️ with ❤️ at Siemens

References

MR acceptance checklist

MR Checklist ( @nwittstruck)

How to set up and validate locally

  1. Enable the feature flag with rails c:
Feature.enable(:api_admin_token_revoke)
  1. You'll need to create a personal access token to access the token and the feature flags client 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. You'll need feature flag client token of a project. Access it from any project from Deploy > Feature flags > Configure. The Instance ID listed is the token. It should start with glffct.
  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.>' \
--header 'Content-Type: application/json' \
--data '{"token": "glffct-token-from-step-2-2"}'
  1. Now, 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": "glffct-token-from-step-2-2"}'
  1. Query the token again - you should now see that the status changed to Not Found, as the client token has changed.

Related to #517682 (closed)

Edited by 🤖 GitLab Bot 🤖

Merge request reports

Loading