Skip to content

Refactor git http controllers to rely on auth results differently

Drew Blessing requested to merge dblessing_find_for_git_http_client into master

What does this MR do and why?

Part of https://gitlab.com/gitlab-org/gitlab/-/issues/328692.

Refactor GitHttpController and GitHttpClientController to not access actor directly.

The aforementioned issue aims to get all callers of auth results to stop accessing actor directly because it's ambiguous - it can be a User or a Deploy Token. These two models do not have the exact same attributes so it is prone to errors. Now we have direct user and deploy_token attributes so the caller needs to make a conscious choice on which to support and it's a least known upfront.

authenticated_user is used by ApplicationController and is eventually used to append info to the logged request. The tests added/changed in this MR are to ensure this logging happens as it currently does - which is slightly different between a real user and a deploy token.

Screenshots or screen recordings

These are strongly recommended to assist reviewers and reduce the time to merge your change.

How to set up and validate locally

Numbered steps to set up and validate the change are strongly suggested.

MR acceptance checklist

This checklist encourages us to confirm any changes have been analyzed to reduce risks in quality, performance, reliability, security, and maintainability.

Edited by Drew Blessing

Merge request reports

Loading