Improve redaction of cross project references

What does this MR do and why?

Currently, we redact this at multiple places unnecessarily. We should handle this only once to reduce the number of Ability checks and clean up the code.

This was supposed to be an optimization done in gitlab-foss@08266ba0 but for some reason the code removals were not part of the merge commit of gitlab-foss!17208 (merged) 🤷

For reference, this is related to the external authorization feature.

When external authorization is enabled, we make an HTTP request to check if a user can access a project. It is expensive to make multiple HTTP requests in a single request so we redact cross-project references when this is enabled.

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 Heinrich Lee Yu

Merge request reports

Loading