Skip to content

Commit e86a602

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

File tree

3 files changed

+19
-19
lines changed

3 files changed

+19
-19
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)

0 commit comments

Comments
 (0)