oras-project / rust-oci-client

A Rust crate to interact with OCI registries
Apache License 2.0
96 stars 53 forks source link

WIP: docker config auth #39

Closed imjasonh closed 1 year ago

imjasonh commented 2 years ago

This adds a RegistryAuth option that instructs the client to find, parse, and use a Docker config file (typically at ~/.docker/config.json) if possible.

If the config file contains a username and password (in either form) or an identity token, for the requested registry, it will be used.

If the config file specifies a cred helper for the given registry, the cred helper will be invoked and its output parsed to find a username and password (or ID token). (TODO: this is not implemented correctly now).

If any of the above fails, the error will be debug-logged and anonymous auth will be used instead.