-
-
Notifications
You must be signed in to change notification settings - Fork 10.8k
feat: Allow omit Authentication header, if HOMEBREW_DOCKER_REGISTRY_BASIC_AUTH_TOKEN is set to none
#21278
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
Conversation
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.
Pull request overview
This PR adds support for disabling authentication headers when HOMEBREW_DOCKER_REGISTRY_BASIC_AUTH_TOKEN is set to the sentinel value -. This allows Homebrew to work with custom bottle domains that don't support authentication headers.
Key changes:
- Introduced sentinel value
-forHOMEBREW_DOCKER_REGISTRY_BASIC_AUTH_TOKENto disable authentication - Modified authorization header logic to conditionally add headers only when authentication is configured
- Updated documentation across all relevant files to describe the new behavior
Reviewed changes
Copilot reviewed 6 out of 6 changed files in this pull request and generated 3 comments.
Show a summary per file
| File | Description |
|---|---|
| Library/Homebrew/brew.sh | Adds logic to detect the sentinel value - and set HOMEBREW_GITHUB_PACKAGES_AUTH to empty string instead of constructing a Basic auth header |
| Library/Homebrew/download_strategy.rb | Updates condition to check if HOMEBREW_GITHUB_PACKAGES_AUTH has presence before adding the Authorization header |
| Library/Homebrew/cmd/vendor-install.sh | Modifies curl command to conditionally add Authorization header only when HOMEBREW_GITHUB_PACKAGES_AUTH is non-empty |
| Library/Homebrew/env_config.rb | Updates environment variable description to document the sentinel value behavior |
| docs/Manpage.md | Updates documentation to explain the sentinel value - and its use case |
| manpages/brew.1 | Updates man page to explain the sentinel value - and its use case |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
…BASIC_AUTH_TOKEN` is set to `-` Signed-off-by: Jan-Otto Kröpke <mail@jkroepke.de>
MikeMcQuaid
left a comment
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.
This seems like a solid approach here, great work so far. I'm not in love with - as the magic value but struggle to think of better; unset, blank, empty, I dunno? Any more ideas you have here?
Co-authored-by: Mike McQuaid <mike@mikemcquaid.com>
What about the case where HOMEBREW_DOCKER_REGISTRY_BASIC_AUTH_TOKEN is explicitly set to an empty value? This may require additional Bash logic to check whether the variable is unset or set but empty. Alternatively, using the value omit would be more self describing. |
|
@jkroepke That would be ideal but both Bash and Ruby handle that weirdly enough that it'll end up being a massive pain unfortunately. |
|
If you would agree, it take the term |
|
How about |
|
I'm generally open for any value. I guess in any case, the value needs to be documented as well. |
|
|
… tricks page Signed-off-by: Jan-Otto Kröpke <mail@jkroepke.de>
HOMEBREW_DOCKER_REGISTRY_BASIC_AUTH_TOKEN is set to -HOMEBREW_DOCKER_REGISTRY_BASIC_AUTH_TOKEN is set to none
MikeMcQuaid
left a comment
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.
Great work here, thanks a lot @jkroepke, you rock!
brew lgtm(style, typechecking and tests) with your changes locally?See #21275
Alternative proposal, a new environment variable. But this feels harder to implement. I read that homebrew filters environment variables and I may need more guidance.