Repository navigation
_cli: add sigstore verify identity - #379
Conversation
This adds `sigstore verify identity`, which is aliased (through some `argparse` hackery) back to `sigstore verify`. This allows us to remain compatible with the existing CLI, while also giving us the flexibility we need to extend verification (e.g. `sigstore verify github`). Signed-off-by: William Woodruff <[email protected]>
|
NB: This PR doesn't add |
|
/gcbrun |
Signed-off-by: William Woodruff <[email protected]>
Signed-off-by: William Woodruff <[email protected]>
Signed-off-by: William Woodruff <[email protected]>
Signed-off-by: William Woodruff <[email protected]>
Signed-off-by: William Woodruff <[email protected]>
Signed-off-by: William Woodruff <[email protected]>
|
/gcbrun |
|
Hmm, this doesn't quite work yet: $ sigstore verify README.mdusage: sigstore verify [-h] {identity} ...
sigstore verify: error: argument verify_subcommand: invalid choice: 'README.md' (choose from 'identity') |
Signed-off-by: William Woodruff <[email protected]>
|
/gcbrun |
Signed-off-by: William Woodruff <[email protected]>
|
/gcbrun |
Signed-off-by: William Woodruff <[email protected]>
|
/gcbrun |
|
Confirmed that each of the following work with these changes: $ sigstore sign --staging README.md --overwrite
$ sigstore verify README.md --cert-identity '[email protected]' --cert-oidc-issuer 'https://github.com/login/oauth' --staging
$ sigstore verify identity README.md --cert-identity '[email protected]' --cert-oidc-issuer 'https://github.com/login/oauth' --staging |
|
Implementation details: we do a little bit of
|
Signed-off-by: William Woodruff <[email protected]>
| for arg in sys.argv[1:]: | ||
| if arg in ["-h", "--help"]: # global help if no subparser | ||
| break | ||
| else: |
There was a problem hiding this comment.
Whoa... how did I not know that this exists.
| # within `sys.argv`. To do that, we get the index of the `verify` | ||
| # subcommand, and insert it directly after it. | ||
| verify_idx = sys.argv.index("verify") | ||
| sys.argv.insert(verify_idx + 1, name) |
There was a problem hiding this comment.
Can we maybe log a warning here? I realise we don't want to make a breaking change but perhaps we can at least mark it as deprecated and slate it for future removal.
There was a problem hiding this comment.
Yeah, a log sounds good. I'll do that in a moment.
Signed-off-by: William Woodruff <[email protected]>
a2589d5 to
088714b
Compare
This adds
sigstore verify identity, which is aliased (through someargparsehackery) back tosigstore verify.This allows us to remain compatible with the existing CLI, while also giving us the flexibility we need to extend verification (e.g.
sigstore verify github).See #322.
Signed-off-by: William Woodruff [email protected]