-
Notifications
You must be signed in to change notification settings - Fork 50
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
Adapt to new sigstore api #630
Conversation
I just added a This works for non-ambient cases only (because we don't know the signing identity in ambient cases) |
33de1dd
to
f82ea38
Compare
I've got a PR about making |
9ede80e
to
cdbeaf9
Compare
Updated to 2.0.0rc3: this is the first release candidate where we manage to use public API only |
* detect_credentials() requires no arguments * token is now a IdentityToken instead of str * signing now happens in a SigningContext for the token The token improvement means that we could now also find out the identity and issuer from the token * would make sense to support this as a way to import a key * we can verify the token against the public key in the constructor The latter I intend to implement in a follow up commit, former is likely future work (not hard, just needs some testing to see how it should work).
This is now possible with sigstore 2.x. The verification is in from_priv_key_uri(). It could be in constructor but I was trying to avoid making the optional imports even more complicated... Note that there is a workaround for the fact that we do not know the signing identity at signing time in the ambient case: The signing certificate SAN is not the OIDC identity.
Cheeky rename of the unused argument: this takes us below the too-many-locals limit.
This way the user has to authenticate to the identity they want to sign with later * removes possibility of typos or misunderstanding * Still allows storing the identity and issuer in the URI (this is not implemented here)
sigstore-python 2.0.0 has been released, this is good to review/merge. Test run for ambient credentials: https://github.com/secure-systems-lab/securesystemslib/actions/runs/6377158699 Testing interactive credentials:
|
"~=2.0.0" matches 2.0.x but we actually want 2.x
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.
Very cool! I tried your example snippet with GitHub auth and it works nicely. Code looks good!
underscore prefix was used to avoid a too-many-locals warning: Workaround that otherwise to make the method signature match the parent class.
Not ready for merging as sigstore 2.0 is not released yet
This adapts SigstoreSigner to sigstore 2.x API
Please verify and check that the pull request fulfils the following requirements: