Support fine-grained PATs for the go-get discovery endpoint

What does this MR do and why?

Support fine-grained PATs for the go-get discovery endpoint

The ?go-get=1 meta-tag discovery request authorized the caller through Gitlab::Auth::Result#authentication_abilities, which is always empty for a fine-grained personal access token. Every request for a private project made with one returned 404, so go get could not be used with fine-grained tokens even though the subsequent git clone already supports them.

Authorize the token against its granular scopes, the same way Gitlab::GitAccess does. A fine-grained token now needs the download_code permission on the project, matching what the clone itself requires.

Closes #599476 (closed)

Co-Authored-By: Claude Opus 5 noreply@anthropic.com

References

Screenshots or screen recordings

Before After

How to set up and validate locally

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.

Related to #599476 (closed)

Merge request reports

Loading
Loading