Skip to content
Permalink

Comparing changes

Choose two branches to see what’s changed or to start a new pull request. If you need to, you can also or learn more about diff comparisons.

Open a pull request

Create a new pull request by comparing changes across two branches. If you need to, you can also . Learn more about diff comparisons here.
base repository: docker/cli
Failed to load repositories. Confirm that selected base ref is valid, then try again.
Loading
base: master
Choose a base ref
...
head repository: docker/cli
Failed to load repositories. Confirm that selected head ref is valid, then try again.
Loading
compare: secrets-engine-desktop-auth
Choose a head ref
Checking mergeability… Don’t worry, you can still create the pull request.
  • 8 commits
  • 86 files changed
  • 1 contributor

Commits on Oct 22, 2026

  1. vendor: github.com/docker/secrets-engine/client v0.2.2

    Add the Docker secrets engine client, used to read the Docker Desktop session for Docker Hub. It brings in github.com/docker/secrets-engine/x v0.8.5 and connectrpc.com/connect v1.19.1.
    
    The client module requires go1.26.10, which raises the go directive in vendor.mod from 1.26.0.
    
    Signed-off-by: Alano Terblanche <[email protected]>
    Benehiko committed Oct 22, 2026
    Configuration menu
    Copy the full SHA
    0c2d0f7 View commit details
    Browse the repository at this point in the history
  2. cli/command: use the Docker Desktop session for Docker Hub

    When Docker Desktop is running and signed in, read the Docker Hub session from the Docker Desktop secrets engine, and send it as the registry credentials for Docker Hub (docker.io) and Docker Hardened Images (dhi.io) when pulling or pushing images through the daemon: docker pull, push, run, create, plugin install and push, service create and update, and stack deploy.
    
    Credentials in DOCKER_AUTH_CONFIG take precedence for the registries they cover. Without a usable Docker Desktop session (no socket, nothing listening, signed out, or no answer within 5 seconds), the CLI uses its credential store, credential helpers, and configuration file as before. docker login and stored credentials are not changed.
    
    Signed-off-by: Alano Terblanche <[email protected]>
    Benehiko committed Oct 22, 2026
    Configuration menu
    Copy the full SHA
    a46376f View commit details
    Browse the repository at this point in the history
  3. internal/secretsengine: add unit tests

    Cover which registries use the Docker Desktop session, keeping the production and staging sessions apart, caching the session until it expires, the retry interval after a failed lookup, and Disable.
    
    Signed-off-by: Alano Terblanche <[email protected]>
    Benehiko committed Oct 22, 2026
    Configuration menu
    Copy the full SHA
    c4e3171 View commit details
    Browse the repository at this point in the history
  4. internal/secretsengine: test and benchmark against a secrets engine s…

    …ocket
    
    Run lookups against a fake secrets engine on a unix socket: signed in, signed out, no socket, a socket with nothing listening, and an engine that never answers. The benchmarks cover the same cases. BenchmarkExternalEngine runs against the engine at SECRETSENGINE_BENCH_SOCKET when it is set.
    
    Signed-off-by: Alano Terblanche <[email protected]>
    Benehiko committed Oct 22, 2026
    Configuration menu
    Copy the full SHA
    f59d490 View commit details
    Browse the repository at this point in the history
  5. internal/test: keep FakeCli from contacting Docker Desktop

    Tests that use FakeCli pull, push, and create containers through RetrieveAuthTokenFromImage. Disable the Docker Desktop lookup, so that they never reach the Docker Desktop of the machine they run on.
    
    Signed-off-by: Alano Terblanche <[email protected]>
    Benehiko committed Oct 22, 2026
    Configuration menu
    Copy the full SHA
    1afa7ac View commit details
    Browse the repository at this point in the history
  6. cli/command: test credential precedence with Docker Desktop

    Check that the Docker Desktop session is used for Docker Hub and dhi.io, that other registries use the configuration file, and that DOCKER_AUTH_CONFIG takes precedence over Docker Desktop. TestRetrieveAuthTokenFromImage disables the Docker Desktop lookup.
    
    Signed-off-by: Alano Terblanche <[email protected]>
    Benehiko committed Oct 22, 2026
    Configuration menu
    Copy the full SHA
    ec9ac08 View commit details
    Browse the repository at this point in the history

Commits on Oct 23, 2026

  1. internal/secretsengine: unexport what only tests use

    Provider, HubClient, and New were only used inside the package and by FakeCli. FakeCli now returns its configuration file as the auth provider, which is what the signed-out Docker Hub stub fell back to. NewDesktop returns an AuthProvider. Remove DockerCli.RegistryAuthProvider: EncodedRegistryAuth already falls back to RetrieveAuthTokenFromImage, which uses the Docker Desktop session, so the method only added to the public API.
    
    Signed-off-by: Alano Terblanche <[email protected]>
    Benehiko committed Oct 23, 2026
    Configuration menu
    Copy the full SHA
    59e40e6 View commit details
    Browse the repository at this point in the history

Commits on Oct 26, 2026

  1. cli/command: look up registry credentials through internal/registryauth

    RetrieveAuthTokenFromImage is exported and imported by other projects, so it keeps reading only the configuration file. The commands that pull and push call registryauth.EncodedAuth instead, which asks DOCKER_AUTH_CONFIG, then the Docker Desktop session, then the configuration file. This drops command.EncodedRegistryAuth from the public API.
    
    Each DockerCli owns its Docker Desktop sessions through RegistryAuthProvider, created on first use, instead of package-level sessions shared by every caller. A command.Cli without RegistryAuthProvider uses only its configuration file. The fallback reads the current configuration file, since Initialize replaces it.
    
    Remove the session fields and the constructors that only tests used, move the staging and dhi.io hostnames into internal/secretsengine, and use testing/synctest instead of a fake clock, so that the tests run in parallel. Only the DOCKER_AUTH_CONFIG test still sets the environment.
    
    Signed-off-by: Alano Terblanche <[email protected]>
    Benehiko committed Oct 26, 2026
    Configuration menu
    Copy the full SHA
    a195d24 View commit details
    Browse the repository at this point in the history
Loading