Skip to content
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

attestation: handle multiple subjects #18883

Merged
merged 3 commits into from
Dec 5, 2024

Conversation

woodruffw
Copy link
Member

@woodruffw woodruffw commented Dec 5, 2024

  • Have you followed the guidelines in our Contributing document?
  • Have you checked to ensure there aren't other open Pull Requests for the same change?
  • Have you added an explanation of what your changes do and why you'd like us to include them?
  • Have you written new tests for your changes? Here's an example.
  • Have you successfully run brew style with your changes locally?
  • Have you successfully run brew typecheck with your changes locally?
  • Have you successfully run brew tests with your changes locally?

GitHub's Artifact Attestations feature began putting multiple subjects in a single bundle yesterday. This broke our assumption that each attestation has only one subject. To fix this, we generalize our search of the attestation's subject from just the first subject name to any name in the subject set.

This should fix the behavior observed in Homebrew/homebrew-core#177384 (comment) and below.

See also: https://github.blog/changelog/2024-12-04-artifact-attestations-now-support-multiple-subjects/

This should fix the behavior observed in
Homebrew/homebrew-core#177384 (comment)
and below.

Signed-off-by: William Woodruff <[email protected]>
@woodruffw
Copy link
Member Author

(Draft while I shore this up.)

Library/Homebrew/attestation.rb Show resolved Hide resolved
@woodruffw woodruffw marked this pull request as ready for review December 5, 2024 19:18
@woodruffw
Copy link
Member Author

woodruffw commented Dec 5, 2024

Tests are green locally, but I haven't added a new multi-subject test yet. I can do that in a moment, or with a follow-up.

Edit: Done.

@woodruffw woodruffw self-assigned this Dec 5, 2024
@woodruffw woodruffw added the bug Reproducible Homebrew/brew bug label Dec 5, 2024
Signed-off-by: William Woodruff <[email protected]>
@woodruffw woodruffw requested a review from p-linnane December 5, 2024 19:27
@woodruffw woodruffw enabled auto-merge December 5, 2024 19:28
@woodruffw woodruffw merged commit 8c868ba into master Dec 5, 2024
28 checks passed
@woodruffw woodruffw deleted the ww/attestations-verify-multiple-subjects branch December 5, 2024 19:36
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Reproducible Homebrew/brew bug
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants