Skip to content

Commit 8c0a2c6

Browse files
committed
change provenance to attestation
Signed-off-by: Appu Goundan <[email protected]>
1 parent 0bc8f38 commit 8c0a2c6

File tree

6 files changed

+24
-24
lines changed

6 files changed

+24
-24
lines changed

cli/slsa-verifier/verify.go

+4-4
Original file line numberDiff line numberDiff line change
@@ -199,10 +199,10 @@ func verifyGithubAttestation() *cobra.Command {
199199
Short: "Verifies SLSA provenance for a github attestation [experimental]",
200200
Run: func(cmd *cobra.Command, args []string) {
201201
v := verify.VerifyGithubAttestationCommand{
202-
ProvenancePath: o.ProvenancePath,
203-
SourceURI: o.SourceURI,
204-
PrintProvenance: o.PrintProvenance,
205-
BuilderID: &o.BuilderID,
202+
AttestationPath: o.AttestationPath,
203+
SourceURI: o.SourceURI,
204+
PrintAttestation: o.PrintAttestation,
205+
BuilderID: &o.BuilderID,
206206
}
207207
if _, err := v.Exec(cmd.Context(), args[0]); err != nil {
208208
fmt.Fprintf(os.Stderr, "%s: %v\n", FAILURE, err)

cli/slsa-verifier/verify/options.go

+9-9
Original file line numberDiff line numberDiff line change
@@ -129,10 +129,10 @@ func (o *VerifyNpmOptions) AddFlags(cmd *cobra.Command) {
129129

130130
// VerifyGithubAttestationOptions is the top-level options for the `verify-github-attestation` command.
131131
type VerifyGithubAttestationOptions struct {
132-
SourceURI string
133-
BuilderID string
134-
ProvenancePath string
135-
PrintProvenance bool
132+
SourceURI string
133+
BuilderID string
134+
AttestationPath string
135+
PrintAttestation bool
136136
}
137137

138138
var _ Interface = (*VerifyGithubAttestationOptions)(nil)
@@ -146,14 +146,14 @@ func (o *VerifyGithubAttestationOptions) AddFlags(cmd *cobra.Command) {
146146
"expected source repository that should have produced the binary, e.g. github.com/some/repo")
147147

148148
/* Other options */
149-
cmd.Flags().StringVar(&o.ProvenancePath, "provenance-path", "",
150-
"path to an provenance file")
149+
cmd.Flags().StringVar(&o.AttestationPath, "attestation-path", "",
150+
"path to an attestation file")
151151

152-
cmd.Flags().BoolVar(&o.PrintProvenance, "print-provenance", false,
153-
"[optional] print the verified provenance to stdout")
152+
cmd.Flags().BoolVar(&o.PrintAttestation, "print-attestation", false,
153+
"[optional] print the verified attestation to stdout")
154154

155155
cmd.MarkFlagRequired("source-uri")
156-
cmd.MarkFlagRequired("provenance-path")
156+
cmd.MarkFlagRequired("attestation-path")
157157
cmd.MarkFlagRequired("builder-id")
158158
}
159159

cli/slsa-verifier/verify/verify_github_attestation.go

+6-6
Original file line numberDiff line numberDiff line change
@@ -27,11 +27,11 @@ import (
2727
)
2828

2929
type VerifyGithubAttestationCommand struct {
30-
ProvenancePath string
30+
AttestationPath string
3131
BuilderID *string
3232
SourceURI string
3333
BuildWorkflowInputs map[string]string
34-
PrintProvenance bool
34+
PrintAttestation bool
3535
}
3636

3737
func (c *VerifyGithubAttestationCommand) Exec(ctx context.Context, artifact string) (*utils.TrustedBuilderID, error) {
@@ -57,20 +57,20 @@ func (c *VerifyGithubAttestationCommand) Exec(ctx context.Context, artifact stri
5757
ExpectedID: c.BuilderID,
5858
}
5959

60-
provenance, err := os.ReadFile(c.ProvenancePath)
60+
attestation, err := os.ReadFile(c.AttestationPath)
6161
if err != nil {
6262
fmt.Fprintf(os.Stderr, "Verifying artifact %s: FAILED: %v\n\n", artifact, err)
6363
return nil, err
6464
}
6565

66-
verifiedProvenance, outBuilderID, err := verifiers.VerifyGithubAttestation(ctx, provenance, provenanceOpts, builderOpts)
66+
verifiedAttestation, outBuilderID, err := verifiers.VerifyGithubAttestation(ctx, attestation, provenanceOpts, builderOpts)
6767
if err != nil {
6868
fmt.Fprintf(os.Stderr, "Verifying artifact %s: FAILED: %v\n\n", artifact, err)
6969
return nil, err
7070
}
7171

72-
if c.PrintProvenance {
73-
fmt.Fprintf(os.Stdout, "%s\n", string(verifiedProvenance))
72+
if c.PrintAttestation {
73+
fmt.Fprintf(os.Stdout, "%s\n", string(verifiedAttestation))
7474
}
7575

7676
fmt.Fprintf(os.Stderr, "Verifying artifact %s: PASSED\n\n", artifact)

register/register.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ type SLSAVerifier interface {
3131

3232
// VerifyGithubAttestation verifies provenance for a Github Attestations.
3333
VerifyGithubAttestation(ctx context.Context,
34-
provenance []byte,
34+
attestation []byte,
3535
provenanceOpts *options.ProvenanceOpts,
3636
builderOpts *options.BuilderOpts,
3737
) ([]byte, *utils.TrustedBuilderID, error)

verifiers/internal/gcb/verifier.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@ func (v *GCBVerifier) VerifyArtifact(ctx context.Context,
4141

4242
// VerifyGithubAttestation verifies provenance for a Github Attestations.
4343
func (v *GCBVerifier) VerifyGithubAttestation(ctx context.Context,
44-
provenance []byte,
44+
attestation []byte,
4545
provenanceOpts *options.ProvenanceOpts,
4646
builderOpts *options.BuilderOpts,
4747
) ([]byte, *utils.TrustedBuilderID, error) {

verifiers/internal/gha/verifier.go

+3-3
Original file line numberDiff line numberDiff line change
@@ -244,11 +244,11 @@ func (v *GHAVerifier) VerifyArtifact(ctx context.Context,
244244

245245
// VerifyGithubAttestation verifies provenance for a Github Attestations.
246246
func (v *GHAVerifier) VerifyGithubAttestation(ctx context.Context,
247-
provenance []byte,
247+
attestation []byte,
248248
provenanceOpts *options.ProvenanceOpts,
249249
builderOpts *options.BuilderOpts,
250250
) ([]byte, *utils.TrustedBuilderID, error) {
251-
if !IsSigstoreBundle(provenance) {
251+
if !IsSigstoreBundle(attestation) {
252252
return nil, nil, errors.New("github attestations must be signed by Sigstore")
253253
}
254254

@@ -258,7 +258,7 @@ func (v *GHAVerifier) VerifyGithubAttestation(ctx context.Context,
258258
}
259259

260260
/* Verify signature on the intoto attestation. */
261-
signedAtt, err := VerifyProvenanceBundle(ctx, provenance, trustedRoot)
261+
signedAtt, err := VerifyProvenanceBundle(ctx, attestation, trustedRoot)
262262
if err != nil {
263263
return nil, nil, err
264264
}

0 commit comments

Comments
 (0)