Fix auth to dependency proxy with service account
What does this MR do and why?
Fix authentication to dependency proxy with service account.
Prior to this MR, attempting to pull an image via the dependency with a service_account resulted in a Error response from daemon: unauthorized: authentication required
error.
Related issues
- Reported in this internal customer ticket
MR acceptance checklist
Please evaluate this MR against the MR acceptance checklist. It helps you analyze changes to reduce risks in quality, performance, reliability, security, and maintainability.
How to set up and validate locally
- Create a Service Account.
-
Create a personal access token for the service account user. Use the
api
scope. - Add Service account to a group with the dependency proxy enabled. Let's assume the group is called
group1
in this case. - Login to the dependency proxy with the docker cli client. For example:
$ docker login <gitlab_instance> -u service_account_aeee4dca47ce02f80e680f8d56315775 Password: <TOKEN> Login Succeeded
- Try to pull an image:
$ docker pull --platform linux/amd64 <gitlab_instance>/group1/dependency_proxy/containers/ubuntu:latest
- Image should be successfully pulled.
Edited by Kenneth Chu