Token prefixes: Support for workspace tokens

What does this MR do and why?

This MR adds support for workspace tokens to instance wide token prefixes.

Workspace tokens will now include the instance wide token prefix when configured. The new token format is <instance>-glwt-token.

This feature is still behind the feature flag custom_prefix_for_all_token_types.

With this custom prefix, it is easier to identify leaked tokens, because we can now skip all leaked tokens that start with gl.

Now, we only need to look at tokens starting with mycompanyname-.

🛠️ with ❤️ at Siemens

References

How to set up and validate locally

  1. Enable feature flag via rails c:
Feature.enable(:custom_prefix_for_all_token_types)
  1. Change the instance wide token prefix: Admin area > General > Account and limit > Instance token prefix, e.g. to mycustomprefix
  2. Creating a new workspace should succeed. Old workspaces should continue to work.

MR acceptance checklist

checklist

Related to #388379

Edited by Nicholas Wittstruck

Merge request reports

Loading