-
Notifications
You must be signed in to change notification settings - Fork 322
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
Parse .netrc for HTTP Basic authentication credentials when BAZELISK_BASE_URL points to protected resource #292
Conversation
@fweikert sorry for pushing that already, but we would need that feature soon and we would like to use an official release in case review pass |
var auth string = "" | ||
t, err := tryFindNetrcFileCreds(u.Host) | ||
if err == nil { | ||
// successfully parsed netrc for given host |
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'd fail here if the .netrc file exists, but could not be read (for whatever reasons).
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.
It would also be good to add a log statement regarding whether a .netrc file was read or not
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'd fail here if the .netrc file exists, but could not be read (for whatever reasons).
.netrc may exist, but may not contain given "Host". In this case we should proceed with normal auth, without a failure, because remote may not have auth at all.
Ping @fweikert |
[![Mend Renovate](https://app.renovatebot.com/images/banner.svg)](https://renovatebot.com) This PR contains the following updates: | Package | Change | Age | Adoption | Passing | Confidence | |---|---|---|---|---|---| | [@bazel/bazelisk](https://github.com/bazelbuild/bazelisk) | [`^1.11.0` -> `^1.12.0`](https://renovatebot.com/diffs/npm/@bazel%2fbazelisk/1.11.0/1.12.0) | [![age](https://badges.renovateapi.com/packages/npm/@bazel%2fbazelisk/1.12.0/age-slim)](https://docs.renovatebot.com/merge-confidence/) | [![adoption](https://badges.renovateapi.com/packages/npm/@bazel%2fbazelisk/1.12.0/adoption-slim)](https://docs.renovatebot.com/merge-confidence/) | [![passing](https://badges.renovateapi.com/packages/npm/@bazel%2fbazelisk/1.12.0/compatibility-slim/1.11.0)](https://docs.renovatebot.com/merge-confidence/) | [![confidence](https://badges.renovateapi.com/packages/npm/@bazel%2fbazelisk/1.12.0/confidence-slim/1.11.0)](https://docs.renovatebot.com/merge-confidence/) | --- ### Release Notes <details> <summary>bazelbuild/bazelisk</summary> ### [`v1.12.0`](https://github.com/bazelbuild/bazelisk/releases/tag/v1.12.0) [Compare Source](https://github.com/bazelbuild/bazelisk/compare/v1.11.0...v1.12.0) This release brings new features and fixes to both versions of Bazelisk: Go: - Added support for basic HTTP authentication via a .netrc file ([https://github.com/bazelbuild/bazelisk/pull/292](https://github.com/bazelbuild/bazelisk/pull/292)) - Improved and fixed Apple Silicon support ([https://github.com/bazelbuild/bazelisk/pull/299](https://github.com/bazelbuild/bazelisk/pull/299), [https://github.com/bazelbuild/bazelisk/pull/303](https://github.com/bazelbuild/bazelisk/pull/303)) - Rolling releases are now fetched from GCS instead of GitHub ([https://github.com/bazelbuild/bazelisk/pull/319](https://github.com/bazelbuild/bazelisk/pull/319)) Python: - Added support for Apple Silicon ([https://github.com/bazelbuild/bazelisk/pull/272](https://github.com/bazelbuild/bazelisk/pull/272)) - Implemented verification of downloaded Bazel binaries ([https://github.com/bazelbuild/bazelisk/pull/295](https://github.com/bazelbuild/bazelisk/pull/295)) We'd like to thank our contributors [@​chenrui333](https://github.com/chenrui333), [@​codeman9](https://github.com/codeman9), [@​cpsauer](https://github.com/cpsauer), [@​keith](https://github.com/keith), [@​linzhp](https://github.com/linzhp), [@​Warchant](https://github.com/Warchant) and [@​xinnjie](https://github.com/xinnjie)! </details> --- ### Configuration 📅 **Schedule**: Branch creation - At any time (no schedule defined), Automerge - At any time (no schedule defined). 🚦 **Automerge**: Disabled by config. Please merge this manually once you are satisfied. ♻ **Rebasing**: Whenever PR is behind base branch, or you tick the rebase/retry checkbox. 🔕 **Ignore**: Close this PR and you won't be reminded about this update again. --- - [ ] <!-- rebase-check -->If you want to rebase/retry this PR, click this checkbox. --- This PR has been generated by [Mend Renovate](https://www.mend.io/free-developer-tools/renovate/). View repository job log [here](https://app.renovatebot.com/dashboard#github/googleapis/gapic-generator-typescript). <!--renovate-debug:eyJjcmVhdGVkSW5WZXIiOiIzMi4xMjIuMSIsInVwZGF0ZWRJblZlciI6IjMyLjEyMi4xIn0=-->
This PR adds support for using .netrc file for getting credentials for Basic HTTP authentication to download bazel from protected resource.
Same as #269 but for Go code.
Fixes #291
Fixes #269
Tested with JFrog Artifactory.