File tree Expand file tree Collapse file tree 3 files changed +40
-8
lines changed
sigstore-cli/src/main/java/dev/sigstore/cli Expand file tree Collapse file tree 3 files changed +40
-8
lines changed Original file line number Diff line number Diff line change 5
5
branches :
6
6
- ' **'
7
7
pull_request :
8
+ # TODO: add cron
8
9
9
10
jobs :
10
11
conformance :
11
12
strategy :
13
+ max-parallel : 1
12
14
matrix :
13
15
java-version : [11, 17]
16
+ sigstore-env : [production, staging]
14
17
fail-fast : false
15
18
16
19
runs-on : ubuntu-latest
35
38
- uses : sigstore/sigstore-conformance@ee4de0e602873beed74cf9e49d5332529fe69bf6 # v0.0.11
36
39
with :
37
40
entrypoint : ${{ github.workspace }}/bin/sigstore-cli
41
+ environment : ${{ matrix.sigstore-env }}
38
42
xfail : " test_verify_dsse_bundle_with_trust_root"
Original file line number Diff line number Diff line change @@ -41,6 +41,13 @@ public class Sign implements Callable<Integer> {
41
41
@ ArgGroup (multiplicity = "1" , exclusive = true )
42
42
SignatureFiles signatureFiles ;
43
43
44
+ @ Option (
45
+ names = {"--staging" },
46
+ description = "test against staging" ,
47
+ required = false ,
48
+ defaultValue = "false" )
49
+ Boolean staging ;
50
+
44
51
@ Option (
45
52
names = {"--identity-token" },
46
53
description = "the OIDC identity token to use" ,
@@ -49,7 +56,10 @@ public class Sign implements Callable<Integer> {
49
56
50
57
@ Override
51
58
public Integer call () throws Exception {
52
- var signerBuilder = KeylessSigner .builder ().sigstorePublicDefaults ();
59
+ var signerBuilder =
60
+ staging
61
+ ? KeylessSigner .builder ().sigstoreStagingDefaults ()
62
+ : KeylessSigner .builder ().sigstorePublicDefaults ();
53
63
if (identityToken != null ) {
54
64
// If we've explicitly provided an identity token, customize the signer to only use the token
55
65
// string OIDC client.
Original file line number Diff line number Diff line change @@ -51,11 +51,27 @@ public class Verify implements Callable<Integer> {
51
51
@ ArgGroup (multiplicity = "0..1" , exclusive = false )
52
52
Policy policy ;
53
53
54
- @ Option (
55
- names = {"--trusted-root" },
56
- description = "an alternative to the TUF managed sigstore public good trusted root" ,
57
- required = false )
58
- Path trustedRoot ;
54
+ @ ArgGroup (multiplicity = "0..1" , exclusive = true )
55
+ Target target ;
56
+
57
+ /**
58
+ * Chose one trusted root provider target, (staging or prod or custom trusted_root), default is
59
+ * prod.
60
+ */
61
+ static class Target {
62
+ @ Option (
63
+ names = {"--staging" },
64
+ description = "test against staging" ,
65
+ required = false ,
66
+ defaultValue = "false" )
67
+ Boolean staging ;
68
+
69
+ @ Option (
70
+ names = {"--trusted-root" },
71
+ description = "an alternative to the TUF managed sigstore public good trusted root" ,
72
+ required = false )
73
+ Path trustedRoot ;
74
+ }
59
75
60
76
static class Policy {
61
77
@ Option (
@@ -101,9 +117,11 @@ public Integer call() throws Exception {
101
117
var verificationOptions = verificationOptionsBuilder .alwaysUseRemoteRekorEntry (false ).build ();
102
118
103
119
var verifier =
104
- ( trustedRoot == null )
120
+ target == null
105
121
? new KeylessVerifier .Builder ().sigstorePublicDefaults ().build ()
106
- : new KeylessVerifier .Builder ().fromTrustedRoot (trustedRoot ).build ();
122
+ : target .staging
123
+ ? new KeylessVerifier .Builder ().sigstoreStagingDefaults ().build ()
124
+ : new KeylessVerifier .Builder ().fromTrustedRoot (target .trustedRoot ).build ();
107
125
verifier .verify (
108
126
artifact ,
109
127
KeylessVerificationRequest .builder ()
You can’t perform that action at this time.
0 commit comments