bazelbuild / bazel

a fast, scalable, multi-language and extensible build system
https://bazel.build
Apache License 2.0
22.68k stars 3.97k forks source link

`http_file` and `http_archive` can't make authenticated calls to Azure storage #14372

Open robin-wayve opened 2 years ago

robin-wayve commented 2 years ago

Description of the problem / feature request:

Allow extra request headers to be passed to http_archive / http_file

Feature requests: what underlying problem are you trying to solve with this feature?

In order to download files from private Azure Storage, clients need to provide an OAuth2 token (which can be done via auth_patterns and a netrc file) and additionally set an x-ms-version header.

Docs: https://docs.microsoft.com/en-us/rest/api/storageservices/authorize-with-azure-active-directory

What operating system are you running Bazel on?

Ubuntu Linux 18.04

What's the output of bazel info release?

release 4.2.1

Have you found anything relevant by searching the web?

We checked if this might be possible through bazel-skylib or repository_ctx.download(_and_extract) but it does not seem so.

thekyz commented 2 years ago

This is a must have for companies relying on Azure for their cloud services (and can probably be used for other things as well).

github-actions[bot] commented 1 year ago

Thank you for contributing to the Bazel repository! This issue has been marked as stale since it has not had any activity in the last 1+ years. It will be closed in the next 14 days unless any other activity occurs or one of the following labels is added: "not stale", "awaiting-bazeler". Please reach out to the triage team (@bazelbuild/triage) if you think this issue is still relevant or you are interested in getting the issue resolved.

tjgq commented 1 year ago

You should be able to use a credential helper to do this.

robin-wayve commented 1 year ago

So this closes with the 6.3.0 release?

tjgq commented 1 year ago

Yes, 6.3.0 will be the first release to support this (it was cherry picked in https://github.com/bazelbuild/bazel/pull/18429).