-
-
Notifications
You must be signed in to change notification settings - Fork 1.2k
fix: clarify GitHub attestations to be artifact ones #8394
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
Merged
+62
−59
Merged
Changes from all commits
Commits
Show all changes
2 commits
Select commit
Hold shift + click to select a range
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or 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 hidden or 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 hidden or 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 hidden or 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 hidden or 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 hidden or 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 |
|---|---|---|
| @@ -1,29 +1,29 @@ | ||
| #!/usr/bin/env bash | ||
| # Test GitHub attestations verification for precompiled Ruby binaries | ||
| # Test GitHub artifact attestations verification for precompiled Ruby binaries | ||
|
|
||
| set -euo pipefail | ||
|
|
||
| export MISE_RUBY_COMPILE=false | ||
| export MISE_RUBY_GITHUB_ATTESTATIONS=true | ||
|
|
||
| echo "=== Testing Ruby GitHub Attestations Verification ===" | ||
| echo "=== Testing Ruby GitHub Artifact Attestations Verification ===" | ||
|
|
||
| # Test: Install Ruby with GitHub attestations verification enabled | ||
| echo "Installing Ruby with GitHub attestations verification enabled..." | ||
| # Test: Install Ruby with GitHub artifact attestations verification enabled | ||
| echo "Installing Ruby with GitHub artifact attestations verification enabled..." | ||
|
|
||
| output=$(mise install ruby@3.4.8 2>&1) || true | ||
| echo "$output" | ||
|
|
||
| # Check if attestation verification was attempted | ||
| if echo "$output" | grep -q "verify GitHub attestations"; then | ||
| echo "✅ GitHub attestations verification was attempted" | ||
| if echo "$output" | grep -q "verify GitHub artifact attestations"; then | ||
| echo "✅ GitHub artifact attestations verification was attempted" | ||
| else | ||
| echo "❌ ERROR: Attestation verification message not found" | ||
| echo "❌ ERROR: GitHub artifact attestation verification message not found" | ||
| exit 1 | ||
| fi | ||
|
|
||
| # Cleanup | ||
| mise uninstall ruby@3.4.8 2>/dev/null || true | ||
|
|
||
| echo "" | ||
| echo "=== Ruby GitHub Attestations Test Passed ✓ ===" | ||
| echo "=== Ruby GitHub Artifact Attestations Test Passed ✓ ===" |
This file contains hidden or 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 hidden or 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 | ||||
|---|---|---|---|---|---|---|
|
|
@@ -125,7 +125,7 @@ impl Backend for UnifiedGitBackend { | |||||
| } | ||||||
| } | ||||||
|
|
||||||
| // Check for GitHub Attestations (assets with .sigstore.json or .sigstore extension) | ||||||
| // Check for GitHub artifact Attestations (assets with .sigstore.json or .sigstore extension) | ||||||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. For consistency with the rest of the codebase, could you please use "artifact attestations" in lowercase?
Suggested change
|
||||||
| if let Some(release) = latest_release { | ||||||
| let has_attestations = release.assets.iter().any(|a| { | ||||||
| let name = a.name.to_lowercase(); | ||||||
|
|
@@ -1058,7 +1058,7 @@ impl UnifiedGitBackend { | |||||
| Ok(()) | ||||||
| } | ||||||
|
|
||||||
| /// Verify artifact using GitHub attestations or SLSA provenance. | ||||||
| /// Verify artifact using GitHub artifact attestations or SLSA provenance. | ||||||
| /// Tries attestations first, falls back to SLSA if no attestations found. | ||||||
| /// If verification is attempted and fails, it's a hard error. | ||||||
| async fn verify_attestations_or_slsa( | ||||||
|
|
@@ -1074,7 +1074,7 @@ impl UnifiedGitBackend { | |||||
| return Ok(()); | ||||||
| } | ||||||
|
|
||||||
| // Try GitHub attestations first (if enabled globally and for github backend) | ||||||
| // Try GitHub artifact attestations first (if enabled globally and for github backend) | ||||||
| if settings.github_attestations && settings.github.github_attestations { | ||||||
| match self | ||||||
| .try_verify_github_attestations(ctx, tv, file_path) | ||||||
|
|
@@ -1084,17 +1084,17 @@ impl UnifiedGitBackend { | |||||
| Ok(false) => { | ||||||
| // Attestations exist but verification failed - hard error | ||||||
| return Err(eyre::eyre!( | ||||||
| "GitHub attestations verification failed for {tv}" | ||||||
| "GitHub artifact attestations verification failed for {tv}" | ||||||
| )); | ||||||
| } | ||||||
| Err(VerificationStatus::NoAttestations) => { | ||||||
| // No attestations - fall through to try SLSA | ||||||
| debug!("No GitHub attestations found for {tv}, trying SLSA"); | ||||||
| debug!("No GitHub artifact attestations found for {tv}, trying SLSA"); | ||||||
| } | ||||||
| Err(VerificationStatus::Error(e)) => { | ||||||
| // Error during verification - hard error | ||||||
| return Err(eyre::eyre!( | ||||||
| "GitHub attestations verification error for {tv}: {e}" | ||||||
| "GitHub artifact attestations verification error for {tv}: {e}" | ||||||
| )); | ||||||
| } | ||||||
| } | ||||||
|
|
@@ -1122,7 +1122,7 @@ impl UnifiedGitBackend { | |||||
| Ok(()) | ||||||
| } | ||||||
|
|
||||||
| /// Try to verify GitHub attestations. Returns: | ||||||
| /// Try to verify GitHub artifact attestations. Returns: | ||||||
| /// - Ok(true) if attestations exist and verified successfully | ||||||
| /// - Ok(false) if attestations exist but verification failed | ||||||
| /// - Err(NoAttestations) if no attestations found | ||||||
|
|
@@ -1133,7 +1133,8 @@ impl UnifiedGitBackend { | |||||
| tv: &ToolVersion, | ||||||
| file_path: &std::path::Path, | ||||||
| ) -> std::result::Result<bool, VerificationStatus> { | ||||||
| ctx.pr.set_message("verify GitHub attestations".to_string()); | ||||||
| ctx.pr | ||||||
| .set_message("verify GitHub artifact attestations".to_string()); | ||||||
|
|
||||||
| // Parse owner/repo from the repo string | ||||||
| let repo = self.repo(); | ||||||
|
|
@@ -1157,8 +1158,8 @@ impl UnifiedGitBackend { | |||||
| Ok(verified) => { | ||||||
| if verified { | ||||||
| ctx.pr | ||||||
| .set_message("✓ GitHub attestations verified".to_string()); | ||||||
| debug!("GitHub attestations verified successfully for {tv}"); | ||||||
| .set_message("✓ GitHub artifact attestations verified".to_string()); | ||||||
| debug!("GitHub artifact attestations verified successfully for {tv}"); | ||||||
| } | ||||||
| Ok(verified) | ||||||
| } | ||||||
|
|
||||||
This file contains hidden or 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
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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.
For consistency with the rest of the codebase, could you please use "artifact attestations" in lowercase?