-
-
Notifications
You must be signed in to change notification settings - Fork 9.7k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Widen attestation verification rollout
Take 2 of #17692 but with: - provide and document `HOMEBREW_NO_VERIFY_ATTESTATIONS` - don't try to run unless there's GitHub credentials - don't try to run unless `gh` is installed - don't try to run in CI While we're here: - split out a `Homebrew::EnvConfig.devcmdrun?` helper method - add some missing `Homebrew::EnvConfig.github_api_token` presence checks
- Loading branch information
1 parent
b9da669
commit b8ff4b3
Showing
8 changed files
with
26 additions
and
11 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -45,13 +45,13 @@ class GhAuthNeeded < RuntimeError; end | |
# @api private | ||
sig { returns(T::Boolean) } | ||
def self.enabled? | ||
# TODO: allow this undocumented variable until this is rolled out more | ||
# widely and then we can remove or document it. | ||
return false if ENV.fetch("HOMEBREW_NO_VERIFY_ATTESTATIONS", false) | ||
return false if Homebrew::EnvConfig.no_verify_attestations? | ||
return true if Homebrew::EnvConfig.verify_attestations? | ||
return false if GitHub::API.credentials.blank? | ||
return false if ENV.fetch("CI", false) | ||
return false unless Formula["gh"].any_version_installed? | ||
This comment has been minimized.
Sorry, something went wrong.
This comment has been minimized.
Sorry, something went wrong.
mmrwoods
|
||
|
||
Homebrew::EnvConfig.developer? | ||
Homebrew::EnvConfig.developer? || Homebrew::EnvConfig.devcmdrun? | ||
end | ||
|
||
# Returns a path to a suitable `gh` executable for attestation verification. | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Should this check for gh cli version 2.49.0 or above? The
attestation
command was only added in that version, so the with the current any version check anyone with an earlier version gets an attestation verification failed error, e.g. from gettext...