-
Notifications
You must be signed in to change notification settings - Fork 4.1k
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
Add authentication support to the downloader rewriter #13822
Conversation
The external repository downloader rewriter currently allows configuring bazel to pull external dependencies from alternative locations. However, it doesn't take credentials in the url into account. This change fixes that by reading the user information from the URL object and updating the authHeaders accordingly.
Just a friendly reminder :) |
@@ -101,8 +102,11 @@ public Path download( | |||
} | |||
|
|||
List<URL> rewrittenUrls = originalUrls; | |||
Map<URI, Map<String, String>> rewrittenAuthHeaders = ImmutableMap.copyOf(authHeaders); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
nit: rewrittenAuthHeaders = authHeaders
to save the copy?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please address this comment or I can do it during import if you don't mind.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I will import the PR and address this during that. Thanks for the PR!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hey; sorry about that. I'm not super familiar with Github and I didn't receive these on the right email. Thanks a lot @keith for following up.
The external repository downloader rewriter currently allows configuring
bazel to pull external dependencies from alternative locations. However,
it doesn't take credentials in the url into account.
This change fixes that by reading the user information from the URL
object and updating the authHeaders accordingly.