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

http.bzl should support authentication and not limit itself to "simple" when it does #7636

Closed
oakad opened this issue Mar 6, 2019 · 6 comments
Labels
P2 We'll consider working on this in future. (Assignee optional) team-ExternalDeps External dependency handling, remote repositiories, WORKSPACE file. type: feature request

Comments

@oakad
Copy link

oakad commented Mar 6, 2019

Even when dealing with internal services it is unreasonable to assume that all build dependencies are "publicly" available. Moreover, the content of the packaged build dependencies, may, in general, be dependent on the authentication details passed to the remote server.

Tools like Maven and Gradle had support for providing a local set of credentials for use with http services for dependency download from the early on. Bazel should have one too (especially considering that it is not difficult to do with Java).

@aiuto aiuto added type: feature request team-ExternalDeps External dependency handling, remote repositiories, WORKSPACE file. untriaged labels Mar 6, 2019
@aiuto
Copy link
Contributor

aiuto commented Mar 6, 2019

This needs some design before simply adding. It feels to me like

  • different repositories might require different credentials. You might go to a corporate one for some things and the public internet for the others.
  • I am sure some shops store credentials in user & system keychains. Pulling those out is a nasty problem. We may not want to do that, but would have to write documentation around the issue.
  • Once we start talking about authenticaion, proxies always come up. More than a few Windows shops need authentication to through proxies to the outside. So we have another level of credentials.

It's always great to hear about actual use cases.

  • What is your particular setup where you need authenticated access to a repository?
  • Since you are talking about remote servers and authenticated access, are you OK with the remote server fetching a secured artifact and leaving it cached indefinitely? Of course caching it is the right choice for performance, but now we have opened up a can of worms in that we have to what creds we used to get it, and unless a second user provides the exact same credentials, the build machine should not use a cached version, else we could be leaking.

@oakad
Copy link
Author

oakad commented Mar 6, 2019

I'd say, an optimal approach is to do something simple first, then elaborate further. I, personally, would be content with a Maven credentials model to start with (it's not the most secure model around but it served us well over the years).

Maven stores credentials in plain text in a "settings.xml" file - essentially it's a map of custom server ids (user specified - those must be matched by the ids in the actual build file) to authentication material (passwords, private keys, whatever). It is assumed that the settings.xml file will protected by OS permissions (on multi-user machines) or isolated in a container (when dealing with those).

Caching is also ok, per the above model - it is either localized to user's home dir and thus protected by the user's home dir permissions or ends up in a secure container.

For proxies, Maven maintains a separate map similar to the above.

https://maven.apache.org/settings.html

@dslomov
Copy link
Contributor

dslomov commented Mar 21, 2019

@dkelmer wdyt?

@dslomov dslomov added P2 We'll consider working on this in future. (Assignee optional) and removed untriaged labels Mar 21, 2019
@depthwise
Copy link

FWIW, here's how I solved this problem: by putting stuff on S3 and downloading it from there with this here rule: https://github.com/1e100/cloud_archive/blob/master/cloud_archive.bzl. Not super principled maybe, but it works.

@meisterT
Copy link
Member

Is there anything left to do here?

@jin
Copy link
Member

jin commented May 13, 2020

No. There's netrc support now.

@jin jin closed this as completed May 13, 2020
@philwo philwo added the team-OSS Issues for the Bazel OSS team: installation, release processBazel packaging, website label Jun 15, 2020
@philwo philwo removed the team-OSS Issues for the Bazel OSS team: installation, release processBazel packaging, website label Nov 29, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
P2 We'll consider working on this in future. (Assignee optional) team-ExternalDeps External dependency handling, remote repositiories, WORKSPACE file. type: feature request
Projects
None yet
Development

No branches or pull requests

8 participants