Skip to content

Fix token prefix change when PAT prefix is nil

What does this MR do and why?

Fix token prefix change when PAT prefix is nil

Personal access token prefix has a default value of glpat-. However, it can be set to nil in the UI, which causes problems with the token prefix check. This fix ensures any nil values are excluded in the token prefix check.

References

lib/authn/tokens/personal_access_token.rb self... (#536734 - closed)

Screenshots or screen recordings

Before After

How to set up and validate locally

  1. Set the personal_access_token_prefix Application setting to nil through Rails Console.
  2. Try to clone using Git over HTTP(S).
  3. Observe the clone fails even with a valid password or token, and a 500 is returned.
  4. After applying the changes from this MR, observe the clone works.

MR acceptance checklist

Evaluate this MR against the MR acceptance checklist. It helps you analyze changes to reduce risks in quality, performance, reliability, security, and maintainability.

Edited by Drew Blessing

Merge request reports

Loading