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

cli: search for {input}.sigstore.json by default #820

Merged
merged 11 commits into from
Dec 7, 2023
Merged

Conversation

woodruffw
Copy link
Member

@woodruffw woodruffw commented Dec 4, 2023

This tweaks the default input collection in sigstore verify, allowing {input}.sigstore.json to take priority when attempting to discover "implicit" inputs.

{input}.sigstore is also still discovered, preserving compatibility with existing outputs. However, discovering it now produces a logged warning telling the user that a future release will deprecate .sigstore in favor of .sigstore.json.

We also produce a hard error when both {input}.sigstore and {input}.sigstore.json are present -- this should really only happen in cases of user confusion, so we just prevent it outright.

See #814.

Signed-off-by: William Woodruff <william@trailofbits.com>
@woodruffw woodruffw added the component:cli CLI components label Dec 4, 2023
@woodruffw woodruffw self-assigned this Dec 4, 2023
@woodruffw woodruffw requested a review from di December 4, 2023 22:39
Signed-off-by: William Woodruff <william@trailofbits.com>
They can be the same if the user explicitly passes in `--bundle`.

Signed-off-by: William Woodruff <william@trailofbits.com>
sigstore/_cli.py Outdated Show resolved Hide resolved
Copy link
Member

@jku jku left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This combines two items:

  • handling implicit vs explicit bundle and
  • handling legacy implicit bundle vs sigstore.json implicit bundle.

There's at least one issue left from that: if an explicit bundle is used, but the file does not exist then we use legacy implicit bundle. This seems wrong.

@woodruffw
Copy link
Member Author

There's at least one issue left from that: if an explicit bundle is used, but the file does not exist then we use legacy implicit bundle. This seems wrong.

Good catch, thanks -- that does seem wrong. I'll fix that.

dependabot bot and others added 5 commits December 5, 2023 19:27
Updates the requirements on [ruff](https://github.com/astral-sh/ruff) to permit the latest version.
- [Release notes](https://github.com/astral-sh/ruff/releases)
- [Changelog](https://github.com/astral-sh/ruff/blob/main/CHANGELOG.md)
- [Commits](astral-sh/ruff@v0.0.18...v0.1.7)

---
updated-dependencies:
- dependency-name: ruff
  dependency-type: direct:production
...

Signed-off-by: dependabot[bot] <support@github.com>
Signed-off-by: William Woodruff <william@trailofbits.com>
This prevents us from accidentally falling back on the legacy
implicit bundle when the user's explicitly specified `--bundle`
is specified but does not exist.

Signed-off-by: William Woodruff <william@trailofbits.com>
@woodruffw woodruffw requested a review from jku December 5, 2023 20:38
@woodruffw woodruffw merged commit 02565a3 into main Dec 7, 2023
23 checks passed
@woodruffw woodruffw deleted the ww/sigstore-json branch December 7, 2023 14:20
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
component:cli CLI components
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants