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_prefix
option to specify the method name for token format instead of overriding theformat_#{token_field}
method, and changeCi::Build
,Project
,Group
andPersonalAccessToken
to use the newformat
option - use
ensure_prefix
to replaceprefix
to reduce the naming confusion forProject
andGroup
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 token
button - 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
Runners
section - 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