Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 4 additions & 2 deletions oras/auth/base.py
Original file line number Diff line number Diff line change
Expand Up @@ -66,10 +66,11 @@ def _logout(self):

def _get_auth_from_creds_store(self, suffix: str, hostname: str) -> Optional[str]:
binary = f"docker-credential-{suffix}"
stdin = hostname
try:
proc = subprocess.run(
[binary, "get"],
input=hostname.encode(),
input=stdin.encode(),
stdout=subprocess.PIPE,
stderr=subprocess.PIPE,
check=True,
Expand All @@ -79,7 +80,8 @@ def _get_auth_from_creds_store(self, suffix: str, hostname: str) -> Optional[str
return None
except subprocess.CalledProcessError as exc:
logger.warning(
f"Credential helper '{binary}' failed: {exc.stderr.decode().strip()}"
f"Credential helper '{binary}' for {stdin!r} failed: "
f"{(exc.stderr or exc.stdout).decode().strip()}"
)
return None
payload = json.loads(proc.stdout)
Expand Down