You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository has been archived by the owner on Apr 7, 2024. It is now read-only.
The native store of oras-credentials-go currently depends on github.com/docker/docker-credential-helpers to interact with docker credential helper binaries and does not support context so that it cannot be cancelled when executing the helper binraries.
We should implement the native store to interact with the helper binaries directly according to the protocol with context support.
Contributors can leverage exec.CommandContext for context support for executing commands.
Note The dependency on golang.org/x/sys/execabs is not required since the security patch is enforced since go 1.19 (see doc).
@shizhMSFT Here's a question that I need clarification for: the function exec.CommandContext returns a *exec.Cmd. Its ctx field is private, and once the Cmd is created in NewNativeStore(), I can no longer modify it at all.
Given this, how should the ctx field of nativeStore.Get(ctx, serverAddress) be used? It looks like we cannot use it to manipulate the Cmd in the NativeStore instance, as long as we use the Cmd of os/exec. And should we use one context for all operations of a NativeStore instance?
Given this, how should the ctx field of nativeStore.Get(ctx, serverAddress) be used?
You may consider create a *exe.Cmd instance each time you call nativeStore.Get(ctx, serverAddress) just like the docker credentials helper does. In fact, you should use a brand new instance of *exe.Cmd each time you execute a program.
The native store of
oras-credentials-go
currently depends ongithub.com/docker/docker-credential-helpers
to interact with docker credential helper binaries and does not support context so that it cannot be cancelled when executing the helper binraries.We should implement the native store to interact with the helper binaries directly according to the protocol with context support.
Contributors can leverage exec.CommandContext for context support for executing commands.
See also: #18 (comment)
The text was updated successfully, but these errors were encountered: