Improve logging in the container registry authentication service
🔥 Problem
The Auth::ContainerRegistryAuthenticationService handles 3 different types of actors:
- A (ci) build
- A Deploy Token
- A User
Permissions are checked on that actor. If the access is rejected, the request is logged.
The problem is that we log the User username and id. Guess what happens when a Deploy Token or a CI Build is used? Yep, no logs.
This makes harder to debug rejected requests.
🚒 Solution
Log whatever actor has been used so that we have:
- User: username + id (already implemented)
- Deploy Token: name + id
- Build: CI job token id ? + build id ? (Not sure what is available here)