Token prefixes: Fix issue when resetting feed tokens in rake task
-
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 receive complimentary access to GitLab Duo.
What does this MR do and why?
When resetting all feed tokens using the rake task tokens:reset_all_feed
, the instance prefix for tokens was ignored. This MR fixes that behaviour.
References
How to set up and validate locally
- Enable feature flag via
rails c
:
Feature.enable(:custom_prefix_for_all_token_types)
BEFORE applying this MR:
- Check your current feed token:
https://gdk.test:3443/-/user_settings/personal_access_tokens
It should not contain an instance prefix yet. - Now, change the instance wide token prefix:
Admin area > General > Account and limit > Instance token prefix
, e.g. tomycustomprefix
- Execute the rake task:
bundle exec rake tokens:reset_all_feed
- Check your feed token again - it should have been changed, but does not contain the instance wide token prefix.
AFTER applying this MR
Same steps as above, however in step 5 you should now see that the feed token contains the instance wide token prefix.
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
Edited by Nicholas Wittstruck