feat(cli): add trustpub subcommand#17113
Conversation
|
Thanks for the pull request, and welcome! The Rust Project is excited to review your changes, and you should hear from @epage (or someone else) some time within the next two weeks. Please see the contribution instructions for more information. Namely, in order to ensure the minimum review times lag, PR authors and assigned reviewers should ensure that the review label (
Why was this reviewer chosen?The reviewer was selected based on:
|
|
Moving this to a draft as the problem, requirements, and a high level design have not been discussed and accepted by the cargo team in an issue per our contrib guide |
|
☔ The latest upstream changes (possibly #17230) made this pull request unmergeable. Please resolve the merge conflicts. |
What does this PR try to resolve?
It already supports the trusted publishing token scope and API, but it looks like Cargo doesn't support it yet.
How to test and review this PR?
I used the
ownercommand as a template and added this new command.cargo trustpub list [--crate foo]GET /api/v1/trusted_publishing/github_configs?crate=foocargo trustpub add --owner O --repo R --pipeline ci.yml [--env E]POST /api/v1/trusted_publishing/github_configscargo trustpub remove --id 42DELETE /api/v1/trusted_publishing/github_configs/42cargo trustpub set --trustpub-only truePATCH /api/v1/crates/foo {"crate":{"trustpub_only":true}}there are 2 global args
below is what these commands look like with some use cases
cargo trustpub --helpcargo trustpub list --helpcargo trustpub --token _TOKEN_ list [--crate ruleset-playground]cargo trustpub add --helpcargo trustpub --token _TOKEN_ add [--crate ruleset-playground] --owner org101org101 --repo ruleset-playground --pipeline release.ymlcargo trustpub --token _TOKEN_ add [--crate ruleset-playground] --owner org101org101 --repo ruleset-playground --pipeline release.yml --env prodcargo trustpub remove --helpcargo trustpub --token _TOKEN_ remove --id 10691cargo trustpub set --helpcargo trustpub --token _TOKEN_ set --trustpub-only true