Generic credential helper API call #23976
Replies: 2 comments
-
I'm very much in favor of exposing this functionality to Starlark for use by tools that don't go through Since by now there are multiple ways in which users can configure the behavior of Bazel downloads (at least |
Beta Was this translation helpful? Give feedback.
-
Currently, only Bazel-native methods (
rctx.download()
and similar) have access to the credential helper interface. As such, authentication for any external tool called within a repository rule must come up with it's own (user facing) authentication mechanism. We would like to propose an extension to the repository rule's API that would allow arbitrary starlark code to access the credential helper. To illustrate this idea, consider a repository rule attempting to authenticate against toolfoo.exe
using flag--auth=<user>:<password>
In this example
rctx.get_credential(url)
request the credentials to any matching credential helper and returns a dictionary with the headers it provides.We argue that while this can be accomplished using other methods (i.e. env variables or
.netrc
), for any non-trivial credential usage, it would not be as seamless and consistent as using the mechanism provided by the credential helper.Beta Was this translation helpful? Give feedback.
All reactions