bytecodealliance / wasm-pkg-tools

Apache License 2.0
48 stars 11 forks source link

fix: Resolve docker hub credentials #62

Closed tomasol closed 3 months ago

tomasol commented 3 months ago

Fix resolving credentials from docker config.json. Add a new server parameter variant for docker_credential::get_credential.

When using the default registry, it must be set to https://index.docker.io/v1/. Retain the generic lookup for other registries.

Fixes #61

tomasol commented 3 months ago

I was testing the PR and realized that even the non-default registries are keyed incorrectly, fixed in the last commit. For reference, here is my ~/.docker/config

{
        "auths": {
                "ghcr.io": {
                        "auth": "redacted"
                },
                "https://index.docker.io/v1/": {
                        "auth": "redacted"
                },
                "registry.fly.io": {
                        "auth": "redacted"
                }
        }
}