-
Notifications
You must be signed in to change notification settings - Fork 7
Add high-level APIs to sign and verify Python artifacts #8
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
Conversation
567de38 to
a487f47
Compare
src/pypi_attestation_models/_impl.py
Outdated
| def verify(self, verifier: Verifier, policy: VerificationPolicy, dist: Path) -> None: | ||
| """Verify against an existing Python artifact. | ||
| On failure, raises `sigstore.errors.InvalidAttestationError`. |
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.
Is this correct? I think InvalidAttestationError isn't a type in sigstore-python
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.
True, the docstring is wrong here. Do we want to wrap sigstore's VerificationError with our own exception class, or just use sigstore's?
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.
Hmm, I suppose we should have it be our own -- wrapping makes sense to me 🙂
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.
fixed!
woodruffw
left a comment
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.
LGTM, one question!
Adds a way to sign and verify Python artifacts, as methods of the existing
AttestationPayloadandAttestationclasses:See the new additions to the README for how they would be used in practice.
The tests added use stubs for
sigstore.Signerandsigstore.Verifier: we only care if they are called with the expected arguments.I also updated the test assets so that the
.bundleand.attestationfiles were actually generated by signing anAttestationPayload(as opposed to signing the artifact itself)