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

bump sigstore-protobuf-specs #1013

Merged
merged 2 commits into from May 13, 2024
Merged

bump sigstore-protobuf-specs #1013

merged 2 commits into from May 13, 2024

Conversation

woodruffw
Copy link
Member

Bumps us to ~= 0.3.2. This patch release enables type hinting, allowing us to refine the types a bit here.

Signed-off-by: William Woodruff <william@trailofbits.com>
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.

If this works, great. If you can explain how Signature works without keyid, that's appreciated.

@@ -217,7 +216,7 @@ def _sign(key: ec.EllipticCurvePrivateKey, stmt: Statement) -> Envelope:
_Envelope(
payload=stmt._contents,
payload_type=Envelope._TYPE,
signatures=[Signature(sig=signature, keyid=None)],
signatures=[Signature(sig=signature)],
Copy link
Member

Choose a reason for hiding this comment

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

How does this work if keyid is not marked optional in the protobuf -- am I missing something?

@jku jku linked an issue May 13, 2024 that may be closed by this pull request
@woodruffw woodruffw enabled auto-merge (squash) May 13, 2024 13:16
@woodruffw woodruffw merged commit c7f4e19 into main May 13, 2024
24 checks passed
@woodruffw woodruffw deleted the ww/bump-protos branch May 13, 2024 13:18
@woodruffw
Copy link
Member Author

If you can explain how Signature works without keyid, that's appreciated.

From looking at the proto definition, the keyid field is entirely optional. But the code generator isn't smart enough to understand that optional means that the kwarg is also nullable, so I just removed it outright instead of explicitly setting it to None 😅

TL;DR: The generated message is completely unchanged, we're just correctly handling an overly strict type hint now.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
chore refactoring Refactoring tasks.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

lint fails on main
2 participants