From c25767abbae6a33d1bf210f93abccdbce3c7d454 Mon Sep 17 00:00:00 2001 From: laurentsimon Date: Wed, 19 Apr 2023 18:44:15 +0000 Subject: [PATCH] update Signed-off-by: laurentsimon --- verifiers/internal/gcb/provenance_test.go | 6 +++--- verifiers/internal/gha/builder_test.go | 5 ++--- verifiers/internal/gha/npm.go | 1 - 3 files changed, 5 insertions(+), 7 deletions(-) diff --git a/verifiers/internal/gcb/provenance_test.go b/verifiers/internal/gcb/provenance_test.go index dd92f67a1..d35e7bbe0 100644 --- a/verifiers/internal/gcb/provenance_test.go +++ b/verifiers/internal/gcb/provenance_test.go @@ -236,7 +236,7 @@ func Test_VerifyBuilder(t *testing.T) { panic("outBuilderID is nil") } - if err := outBuilderID.Matches(tt.builderID, false); err != nil { + if err := outBuilderID.MatchesLoose(tt.builderID, false); err != nil { t.Errorf(fmt.Sprintf("matches failed: %v", err)) } }) @@ -299,7 +299,7 @@ func Test_validateRecipeType(t *testing.T) { t.Run(tt.name, func(t *testing.T) { t.Parallel() - builderID, err := utils.TrustedBuilderIDNew(tt.builderID) + builderID, err := utils.TrustedBuilderIDNew(tt.builderID, true) if err != nil { panic(fmt.Errorf("BuilderIDNew: %w", err)) } @@ -489,7 +489,7 @@ func Test_VerifySourceURI(t *testing.T) { panic(fmt.Errorf("setStatement: %w", err)) } - builderID, err := utils.TrustedBuilderIDNew(tt.builderID) + builderID, err := utils.TrustedBuilderIDNew(tt.builderID, true) if err != nil { panic(fmt.Errorf("BuilderIDNew: %w", err)) } diff --git a/verifiers/internal/gha/builder_test.go b/verifiers/internal/gha/builder_test.go index aa99ee488..4c3abb380 100644 --- a/verifiers/internal/gha/builder_test.go +++ b/verifiers/internal/gha/builder_test.go @@ -274,7 +274,7 @@ func Test_VerifyBuilderIdentity(t *testing.T) { return } - if err := id.Matches(tt.builderID, true); err != nil { + if err := id.MatchesLoose(tt.builderID, true); err != nil { t.Errorf("matches failed:%v", err) } }) @@ -480,7 +480,7 @@ func Test_verifyTrustedBuilderID(t *testing.T) { return } expectedID := "https://github.com/" + tt.path + "@" + tt.tag - if err := id.Matches(expectedID, true); err != nil { + if err := id.MatchesLoose(expectedID, true); err != nil { t.Errorf("matches failed:%v", err) } }) @@ -607,7 +607,6 @@ func Test_verifyTrustedBuilderRef(t *testing.T) { expected: serrors.ErrorInvalidRef, }, { - name: "full semver for other repos", callerRepo: "some/repo", builderRef: "refs/tags/v1.2.3", diff --git a/verifiers/internal/gha/npm.go b/verifiers/internal/gha/npm.go index 69e503630..37291ef24 100644 --- a/verifiers/internal/gha/npm.go +++ b/verifiers/internal/gha/npm.go @@ -22,7 +22,6 @@ import ( const ( publishAttestationV01 = "https://github.com/npm/attestation/tree/main/specs/publish/" builderGitHubRunnerID = "https://github.com/actions/runner" - ossfNpmBuilderID = "https://github.com/slsa-framework/slsa-github-generator/.github/workflows/builder_nodejs_slsa3.yml" ) var errrorInvalidAttestations = errors.New("invalid npm attestations")