Reserve token type prefixes as instance token prefix

What does this MR do and why?

An instance prefix equal to a token type prefix without its hyphen made other tokens look like that type. For example, with "glcbt", new personal access tokens ("glcbt-glpat-...") were detected as CI job tokens and rejected by the API.

This MR reserves all token type prefixes, derived from the model constants.

🛠️ with ❤️ at Siemens

References

How to set up and validate locally

  1. Enable the feature flag:
    Feature.enable(:custom_prefix_for_all_token_types)
  2. Go to Admin area > Settings > General > Account and limit, set Instance token prefix to e.g. glcbt. You should see the error "Instance token prefix is reserved and cannot be used" appears.

MR acceptance checklist

MR Checklist ( @nwittstruck)

Related to #388379 (closed)

Edited by Nicholas Wittstruck

Merge request reports

Loading
Loading