Skip to content

Commit f6aee43

Browse files
committed
Add Rekor to e2e test
Make constant for cosign sign in-toto predicate Update experimental OCI help string Signed-off-by: Zach Steindler <[email protected]>
1 parent bc3d48f commit f6aee43

File tree

11 files changed

+52
-26
lines changed

11 files changed

+52
-26
lines changed

cmd/cosign/cli/options/verify.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,7 @@ func (o *CommonVerifyOptions) AddFlags(cmd *cobra.Command) {
5454
"skip transparency log verification when verifying artifacts in a privately deployed infrastructure")
5555

5656
cmd.Flags().BoolVar(&o.ExperimentalOCI11, "experimental-oci11", false,
57-
"set to true to enable experimental OCI 1.1 behaviour")
57+
"set to true to enable experimental OCI 1.1 behaviour (unrelated to bundle format)")
5858

5959
cmd.Flags().IntVar(&o.MaxWorkers, "max-workers", cosign.DefaultMaxWorkers,
6060
"the amount of maximum workers for parallel executions")

cmd/cosign/cli/sign/sign.go

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -239,12 +239,11 @@ func signDigestBundle(ctx context.Context, digest name.Digest, ko options.KeyOpt
239239
subject := intotov1.ResourceDescriptor{
240240
Digest: map[string]string{digestParts[0]: digestParts[1]},
241241
}
242-
predicateType := "https://sigstore.dev/cosign/sign/v1"
243242

244243
statement := &intotov1.Statement{
245244
Type: intotov1.StatementTypeUri,
246245
Subject: []*intotov1.ResourceDescriptor{&subject},
247-
PredicateType: predicateType,
246+
PredicateType: types.CosignSignPredicateType,
248247
}
249248

250249
payload, err := protojson.Marshal(statement)
@@ -316,7 +315,7 @@ func signDigestBundle(ctx context.Context, digest name.Digest, ko options.KeyOpt
316315
if err != nil {
317316
return err
318317
}
319-
return ociremote.WriteAttestationNewBundleFormat(digest, bundleBytes, predicateType, ociremoteOpts...)
318+
return ociremote.WriteAttestationNewBundleFormat(digest, bundleBytes, types.CosignSignPredicateType, ociremoteOpts...)
320319
}
321320

322321
func signDigest(ctx context.Context, digest name.Digest, payload []byte, ko options.KeyOpts, signOpts options.SignOptions,

doc/cosign_dockerfile_verify.md

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

doc/cosign_manifest_verify.md

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

doc/cosign_verify-attestation.md

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

doc/cosign_verify-blob-attestation.md

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

doc/cosign_verify-blob.md

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

doc/cosign_verify.md

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

pkg/cosign/bundle/protobundle.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -76,7 +76,7 @@ func MakeProtobufBundle(hint string, rawCert []byte, rekorEntry *models.LogEntry
7676
}
7777

7878
func MakeNewBundle(pubKey *crypto.PublicKey, rekorEntry *models.LogEntryAnon, payload, sig, signer, timestampBytes []byte) ([]byte, error) {
79-
// Determine if signature is certificate or not
79+
// Determine if the signer is a certificate or not
8080
var hint string
8181
var rawCert []byte
8282

pkg/types/predicate.go

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
//
2+
// Copyright 2021 The Sigstore Authors.
3+
//
4+
// Licensed under the Apache License, Version 2.0 (the "License");
5+
// you may not use this file except in compliance with the License.
6+
// You may obtain a copy of the License at
7+
//
8+
// http://www.apache.org/licenses/LICENSE-2.0
9+
//
10+
// Unless required by applicable law or agreed to in writing, software
11+
// distributed under the License is distributed on an "AS IS" BASIS,
12+
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13+
// See the License for the specific language governing permissions and
14+
// limitations under the License.
15+
16+
package types //nolint: revive // that is a valid package name :)
17+
18+
const (
19+
CosignSignPredicateType = "https://sigstore.dev/cosign/sign/v1"
20+
)

0 commit comments

Comments
 (0)