Skip to content

Commit

Permalink
Handle not-logged-in public repos with credsStore
Browse files Browse the repository at this point in the history
  • Loading branch information
fahhem committed Jan 24, 2025
1 parent a911e9e commit 2d68278
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions oci/private/authn.bzl
Original file line number Diff line number Diff line change
Expand Up @@ -126,6 +126,11 @@ exec "docker-credential-{}" get <<< "$1" """.format(helper_name),

response = json.decode(result.stdout)

# If the username and secret are empty, the user does not have a login.
# Returning {} avoids sending invalid Basic auth headers that result in 401's
if response["Username"] == "" and response["Secret"] == "":
return {}

return {
"type": "basic",
"login": response["Username"],
Expand Down

0 comments on commit 2d68278

Please sign in to comment.