1Password / shell-plugins

Seamless authentication for every tool in your terminal.
https://developer.1password.com/docs/cli/shell-plugins/
MIT License
519 stars 170 forks source link

Add `install` as an auth command for `brew` #368

Closed AndyTitu closed 1 year ago

AndyTitu commented 1 year ago

Platform or tool

Homebrew

Desired or expected behavior

brew install should also be provisioned with HOMEBREW_GITHUB_API_TOKEN as this command can run into rate limits or it can be used to install from private taps

Current behavior

brew install won't be provisioned

Relevant log output

op plugin run --debug -- brew install foo

Error: foo: Failed to download resource "foo"
Download failed: Please set HOMEBREW_GITHUB_API_TOKEN

op CLI version

No response

AndyTitu commented 1 year ago

To achieve this we need to add install in this list of commands that need authentication:

NeedsAuth: needsauth.IfAll(
            needsauth.NotForHelpOrVersion(),
            needsauth.IfAny(
                needsauth.ForCommand("search"),
                needsauth.ForCommand("bump"),
                needsauth.ForCommand("bump-cask-pr"),
                needsauth.ForCommand("bump-formula-pr"),
            ),