Simplify token prefix/validation
Description
The following discussion from !106179 (merged) should be addressed:
-
@grzesiek started a discussion: Should we create a follow up issue about fixing
format_token + prefixconfusion?
Solution
- We can probably use format: -> and access the proc in options what would be trivial change, but we can do that later.
- maybe also rename the prefix: to something that matches what it actually does, validating the token’s prefix when using the finders: https://gitlab.com/gitlab-org/gitlab/-/blob/bc3037d32d837742ab4457792a94edc7817bf361/app/models/concerns/token_authenticatable_strategies/encrypted.rb#L23
Edited by Max Orefice