Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Support authentication for repository_ctx.download #7469

Closed
guw opened this issue Feb 19, 2019 · 8 comments
Closed

Support authentication for repository_ctx.download #7469

guw opened this issue Feb 19, 2019 · 8 comments
Assignees
Labels
P1 I'll work on this now. (Assignee required) team-ExternalDeps External dependency handling, remote repositiories, WORKSPACE file. type: feature request

Comments

@guw
Copy link
Contributor

guw commented Feb 19, 2019

Description of the problem / feature request:

The API of repository_ctx.download doesn't allow to supply authentication information.

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

I need to be able to download from an url that requires authentication. At a very minimum BASIC authentication should be supported.

Ideally, it would be nice to supply authentication information in a central file for all Bazel builds and independent/decoupled from Bazel BUILD and WORKSPACE files checked into Git.

@excitoon
Copy link
Contributor

I would even ask for not only Basic but NTLM/SSPI authentication.

@jin jin assigned aehlig and unassigned dkelmer Jul 10, 2019
@jin
Copy link
Member

jin commented Jul 10, 2019

Thanks to @aehlig's work, repository_ctx.download now supports authentication through netrc.

@aehlig
Copy link
Contributor

aehlig commented Jul 10, 2019

This is indeed implemented as per the approved design on adding authentication to downloads in commits 24cf645, 38cfc18, e1e074c, and c26e339.

@aehlig aehlig closed this as completed Jul 10, 2019
@philwo philwo added the team-OSS Issues for the Bazel OSS team: installation, release processBazel packaging, website label Jun 15, 2020
@igorgatis
Copy link

Current Bazel documentation about repository_ctx.download's authentication is rather poor. I already spent literaly a handful of hours trying to make it work.

@cristifalcas
Copy link

Current Bazel documentation about repository_ctx.download's authentication is rather poor. I already spent literaly a handful of hours trying to make it work.

Please share how to do it :)

@koenverwimp
Copy link

@igorgatis Could you please share your findings?
@cristifalcas Did you find a solution in the mean time?

@philwo philwo removed the team-OSS Issues for the Bazel OSS team: installation, release processBazel packaging, website label Nov 29, 2021
@tomml
Copy link

tomml commented Aug 23, 2023

I would like to use a Bearer token here instead of basic auth. Is this possible? I need to access a private company maven repository.
Documentation is pretty poor at this point only mentioning that there is a "type" which can be "basic".

@aehlig It seems you've proposed and implemented the auth feature. Could you give some more insights? Thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
P1 I'll work on this now. (Assignee required) team-ExternalDeps External dependency handling, remote repositiories, WORKSPACE file. type: feature request
Projects
None yet
Development

No branches or pull requests