Skip to content

Fix auth to dependency proxy with service account

Kenneth Chu requested to merge kenneth-dependency-proxy-service-account into master

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

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

  1. Create a Service Account.
  2. Create a personal access token for the service account user. Use the api scope.
  3. Add Service account to a group with the dependency proxy enabled. Let's assume the group is called group1 in this case.
  4. Login to the dependency proxy with the docker cli client. For example:
    $ docker login <gitlab_instance> -u service_account_aeee4dca47ce02f80e680f8d56315775
    Password: <TOKEN>
    Login Succeeded
  5. Try to pull an image:
    $ docker pull --platform linux/amd64 <gitlab_instance>/group1/dependency_proxy/containers/ubuntu:latest
  6. Image should be successfully pulled.
Edited by Kenneth Chu

Merge request reports