microsoft / microsoft/WSL

WSLc: Support non-docker style registries (e.g. Zot)

Open
#41,067 3 comments 1 reaction 0 assignees View on GitHub
feature wslc
Dominant language
C++
Stars
33.7k
Forks
1.8k
Avg merge
3d 17h
Merged PRs (30d)
116

Description

**Is your feature request related to a problem? Please describe.**
Currently WSLc is quite tailored towards `docker.io`. In particular, the authentication challenge follows the Docker client convention: It probes `/v2/` and expect that no authentication is required if the answer is `200 Ok`. However the OCI spec on image delivery [does not mandate this behaviour](https://github.com/opencontainers/distribution-spec/blob/main/spec.md#determining-support):

> This endpoint MAY be used for authentication/authorization purposes, but this is out of the purview of this specification.

**Describe the solution you'd like**

Implementing the [CNCF Distribution](https://distribution.github.io/distribution/spec/auth/token/) approach instead - try to authenticate lazily on first 401, *not* by probing `/v2/`. The question I haven't answered is how to detect login successful or not - currently `wslc login` always succeed when pointing at Zot / some compliant OCI registry. From a quick look, `podman` sends a query with `Basic` authz and deals with the response.

**Describe alternatives you've considered**

As a Zot registry user, I've raised a [separate feature request](https://github.com/project-zot/zot/issues/4224). Adding some `Docker-Client` might be good enough for my use-case (it'll trigger the workaround), but implementing the spec seems like a better direction.

Contributor guide

Open the contributing guide

Research direction

Start by reading the OCI image delivery authentication guidance and the CNCF Distribution token-authentication approach referenced in the issue, then inspect the WSLc registry and `wslc login` entry points. Done means authentication is attempted lazily after a 401 rather than by probing `/v2/`, while login success or failure is correctly detected for compliant registries such as Zot.

Written by the indexing model from the issue text.

Assessment

Tech stack
cpp
Domain
authentication, networking
Issue type
Feature
Difficulty
5/5
Estimated time
Over a week
Activity status
Quiet
Clarity
Mostly clear
Newbie friendliness
45/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.