Use format_with_prefix, ensure_prefix options of token auth strategy
What does this MR do and why?
As titled, this MR aims at:
- support
format_with_prefixoption to specify the method name for token format instead of overriding theformat_#{token_field}method, and changeCi::Build,Project,GroupandPersonalAccessTokento use the newformatoption - use
ensure_prefixto replaceprefixto reduce the naming confusion forProjectandGroup
Screenshots or screen recordings
Screenshots are required for UI changes, and strongly recommended for all other merge requests.
How to set up and validate locally
For personal access token:
- Go to
User Settings->Personal Access Tokens - Fill in the name and choose a scope
- Click
Create personal access tokenbutton - Reveal the newly created personal access token and see if it's prefixed with
glpat-
For group/project runners token:
- Create a group or project
- Go to
CI/CD Settings - Expand
Runnerssection - See if the runners registration token starts with
GR1348941
MR acceptance checklist
This checklist encourages us to confirm any changes have been analyzed to reduce risks in quality, performance, reliability, security, and maintainability.
-
I have evaluated the MR acceptance checklist for this MR.
Related to #385590 (closed)
Edited by Tianwen Chen