bzlmod doesn't use credentials stored in .netrc files #15286
Labels
area-Bzlmod
Bzlmod-specific PRs, issues, and feature requests
help wanted
Someone outside the Bazel team could own this
P2
We'll consider working on this in future. (Assignee optional)
team-ExternalDeps
External dependency handling, remote repositiories, WORKSPACE file.
type: bug
Milestone
Description of the bug:
bzlmod supports to store modules in private registries. These reqistries can be pass with the
--registry
parameter to bazel. In corporate environments there could be a use case that for security reasons access to a private registry must be limited, e.g. by basic authentication with a username and password. Often these credentials are stored in a.netrc
file.It looks like that bzlmod doesn't check if credentials for a private registry are available in a
.netrc
file. Bazel just throws a 401 error:ERROR: Error accessing registry https://my.local-registry.com/bazel-central-registry: GET returned 401
I also tried to pass the username within the URI:
https://<username>:<password>@my.local-registry.com/bazel-central-registry
But also this credentials aren't used by bzlmod.
To ensure that basically the credentials are correct and used by Bazel I tried to download a single file from the private registry with
http_file
. This works out of the box. The credentials of the.netrc
file are used.What's the simplest, easiest way to reproduce this bug? Please provide a minimal example if possible.
.bazelrc
file:common --registry <my-registry-url>
Which operating system are you running Bazel on?
Ubuntu 20.04
What is the output of
bazel info release
?release 5.1.1
If
bazel info release
returnsdevelopment version
or(@non-git)
, tell us how you built Bazel.No response
What's the output of
git remote get-url origin; git rev-parse master; git rev-parse HEAD
?Have you found anything relevant by searching the web?
No response
Any other information, logs, or outputs that you want to share?
No response
The text was updated successfully, but these errors were encountered: