-
Notifications
You must be signed in to change notification settings - Fork 56
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
conformance: add conformance CLI and action #287
Merged
Merged
Changes from 5 commits
Commits
Show all changes
6 commits
Select commit
Hold shift + click to select a range
02e3665
conformance: cli
jleightcap b33b1de
conformance: add action+entrypoint
jleightcap d6a7b54
conformance: use child binary crate
jleightcap 7e8b6cf
conformance: remove async main
jleightcap 32b897c
conformance: trailing newlines
jleightcap f35ca2b
conformance: workflow dispatch trigger
jleightcap File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
on: [push, pull_request] | ||
|
||
name: Conformance Suite | ||
|
||
jobs: | ||
conformance: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@c85c95e3d7251135ab7dc9ce3241c5835cc595a9 # v3.5.3 | ||
- uses: actions-rs/toolchain@16499b5e05bf2e26879000db0c1d13f7e13fa3af # v1.0.7 | ||
with: | ||
profile: minimal | ||
toolchain: stable | ||
override: true | ||
- uses: actions-rs/cargo@844f36862e911db73fe0815f00a4a2602c279505 # v1.0.3 | ||
with: | ||
command: build | ||
args: --manifest-path=tests/conformance/Cargo.toml | ||
- uses: sigstore/sigstore-conformance@main | ||
with: | ||
entrypoint: ${{ github.workspace }}/tests/conformance/target/debug/sigstore |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
[package] | ||
name = "sigstore-conformance" | ||
description = "sigstore conformance testing workflow" | ||
version = "0.0.1" | ||
edition = "2021" | ||
authors = ["sigstore-rs developers"] | ||
license = "Apache-2.0" | ||
|
||
[dependencies] | ||
clap = { version = "4.0.8", features = ["derive"] } | ||
sigstore = { path = "../../" } | ||
|
||
[[bin]] | ||
name = "sigstore" | ||
path = "conformance.rs" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,109 @@ | ||
// | ||
// Copyright 2023 The Sigstore Authors. | ||
// | ||
// Licensed under the Apache License, Version 2.0 (the "License"); | ||
// you may not use this file except in compliance with the License. | ||
// You may obtain a copy of the License at | ||
// | ||
// http://www.apache.org/licenses/LICENSE-2.0 | ||
// | ||
// Unless required by applicable law or agreed to in writing, software | ||
// distributed under the License is distributed on an "AS IS" BASIS, | ||
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
// See the License for the specific language governing permissions and | ||
// limitations under the License. | ||
|
||
// CLI implemented to specification: | ||
// https://github.com/sigstore/sigstore-conformance/blob/main/docs/cli_protocol.md | ||
|
||
use clap::{Parser, Subcommand}; | ||
|
||
#[derive(Parser, Debug)] | ||
struct Cli { | ||
#[command(subcommand)] | ||
command: Commands, | ||
} | ||
|
||
#[derive(Subcommand, Debug)] | ||
enum Commands { | ||
Sign(Sign), | ||
SignBundle(SignBundle), | ||
Verify(Verify), | ||
VerifyBundle(VerifyBundle), | ||
} | ||
|
||
#[derive(Parser, Debug)] | ||
struct Sign { | ||
// The OIDC identity token to use | ||
#[clap(long)] | ||
identity_token: String, | ||
|
||
// The path to write the signature to | ||
#[clap(long)] | ||
signature: String, | ||
|
||
// The path to write the signing certificate to | ||
#[clap(long)] | ||
certificate: String, | ||
|
||
// The artifact to sign | ||
artifact: String, | ||
} | ||
|
||
#[derive(Parser, Debug)] | ||
struct SignBundle { | ||
// The OIDC identity token to use | ||
#[clap(long)] | ||
identity_token: String, | ||
|
||
// The path to write the bundle to | ||
#[clap(long)] | ||
bundle: String, | ||
|
||
// The artifact to sign | ||
artifact: String, | ||
} | ||
|
||
#[derive(Parser, Debug)] | ||
struct Verify { | ||
// The path to the signature to verify | ||
#[clap(long)] | ||
signature: String, | ||
|
||
// The path to the signing certificate to verify | ||
#[clap(long)] | ||
certificate: String, | ||
|
||
// The expected identity in the signing certificate's SAN extension | ||
#[clap(long)] | ||
certificate_identity: String, | ||
|
||
// The expected OIDC issuer for the signing certificate | ||
#[clap(long)] | ||
certificate_oidc_issuer: String, | ||
|
||
// The path to the artifact to verify | ||
artifact: String, | ||
} | ||
|
||
#[derive(Parser, Debug)] | ||
struct VerifyBundle { | ||
// The path to the Sigstore bundle to verify | ||
#[clap(long)] | ||
bundle: String, | ||
|
||
// The expected identity in the signing certificate's SAN extension | ||
#[clap(long)] | ||
certificate_identity: String, | ||
|
||
// The expected OIDC issuer for the signing certificate | ||
#[clap(long)] | ||
certificate_oidc_issuer: String, | ||
|
||
// The path to the artifact to verify | ||
artifact: String, | ||
} | ||
|
||
fn main() { | ||
let cli = Cli::parse(); | ||
} |
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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.
Maybe we should leave that commented, at least until the full specification is implemented. Otherwise it could be confusing to see the failures happen on PR and on the
main
branchThere 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.
Makes sense to me -- perhaps we should make it
workflow_dispatch
for the time being, so that it isn't triggered automatically but can be still done manually.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.
Yeah, this currently doesn't make sense. Thanks for the
workflow_dispatch
pointer @woodruffw (0e0ee5e)