77 references to ProvenanceVerificationOutcome
aspire (36)
Agents\AspireSkills\GitHubArtifactAttestationVerifier.cs (9)
53return new ProvenanceVerificationResult { Outcome = ProvenanceVerificationOutcome.AttestationFetchFailed }; 61return new ProvenanceVerificationResult { Outcome = ProvenanceVerificationOutcome.AttestationFetchFailed }; 70? ProvenanceVerificationOutcome.AttestationParseFailed 71: ProvenanceVerificationOutcome.SlsaProvenanceNotFound 83return new ProvenanceVerificationResult { Outcome = ProvenanceVerificationOutcome.AttestationParseFailed }; 89return new ProvenanceVerificationResult { Outcome = ProvenanceVerificationOutcome.SourceRepositoryMismatch }; 110return new ProvenanceVerificationResult { Outcome = ProvenanceVerificationOutcome.AttestationParseFailed }; 117return new ProvenanceVerificationResult { Outcome = ProvenanceVerificationOutcome.AttestationParseFailed }; 130return new ProvenanceVerificationResult { Outcome = ProvenanceVerificationOutcome.AttestationParseFailed };
Npm\INpmProvenanceChecker.cs (3)
116public required ProvenanceVerificationOutcome Outcome { get; init; } 127public bool IsVerified => Outcome is ProvenanceVerificationOutcome.Verified; 194/// If the callback returns <c>false</c>, verification fails with <see cref="ProvenanceVerificationOutcome.WorkflowRefMismatch"/>.
Npm\SigstoreNpmProvenanceChecker.cs (24)
76return new ProvenanceVerificationResult { Outcome = ProvenanceVerificationOutcome.AttestationFetchFailed }; 83var outcome = parseFailed 84? ProvenanceVerificationOutcome.AttestationParseFailed 85: ProvenanceVerificationOutcome.SlsaProvenanceNotFound; 101return new ProvenanceVerificationResult { Outcome = ProvenanceVerificationOutcome.AttestationParseFailed }; 115var subjectOutcome = VerifyNpmSubject( 120if (subjectOutcome is not ProvenanceVerificationOutcome.Verified) 134return new ProvenanceVerificationResult { Outcome = ProvenanceVerificationOutcome.AttestationParseFailed }; 255return (new ProvenanceVerificationResult { Outcome = ProvenanceVerificationOutcome.SourceRepositoryMismatch }, null); 275return (new ProvenanceVerificationResult { Outcome = ProvenanceVerificationOutcome.AttestationParseFailed }, null); 287return (new ProvenanceVerificationResult { Outcome = ProvenanceVerificationOutcome.AttestationParseFailed }, null); 327internal static ProvenanceVerificationOutcome VerifyNpmSubject( 335return ProvenanceVerificationOutcome.PackageIdentityMismatch; 347return ProvenanceVerificationOutcome.PackageIdentityMismatch; 354return ProvenanceVerificationOutcome.PackageDigestMismatch; 365return ProvenanceVerificationOutcome.PackageDigestMismatch; 369? ProvenanceVerificationOutcome.Verified 370: ProvenanceVerificationOutcome.PackageDigestMismatch; 469Outcome = ProvenanceVerificationOutcome.SourceRepositoryMismatch, 478Outcome = ProvenanceVerificationOutcome.WorkflowMismatch, 487Outcome = ProvenanceVerificationOutcome.BuildTypeMismatch, 498Outcome = ProvenanceVerificationOutcome.WorkflowRefMismatch, 507Outcome = ProvenanceVerificationOutcome.WorkflowRefMismatch, 515Outcome = ProvenanceVerificationOutcome.Verified,
Aspire.Cli.Tests (41)
Agents\AspireSkillsInstallerTests.cs (2)
1761Result = new ProvenanceVerificationResult { Outcome = ProvenanceVerificationOutcome.WorkflowMismatch } 2228Outcome = ProvenanceVerificationOutcome.Verified,
Agents\PlaywrightCliInstallerTests.cs (5)
443var provenanceChecker = new TestNpmProvenanceChecker { ProvenanceOutcome = ProvenanceVerificationOutcome.SourceRepositoryMismatch }; 480var provenanceChecker = new TestNpmProvenanceChecker { ProvenanceOutcome = ProvenanceVerificationOutcome.AttestationFetchFailed }; 1040public ProvenanceVerificationOutcome ProvenanceOutcome { get; set; } = ProvenanceVerificationOutcome.Verified; 1053Provenance = ProvenanceOutcome is ProvenanceVerificationOutcome.Verified
Agents\SigstoreNpmProvenanceCheckerTests.cs (33)
125nameof(ProvenanceVerificationOutcome.PackageIdentityMismatch))] 129nameof(ProvenanceVerificationOutcome.PackageDigestMismatch))] 140Assert.Equal(Enum.Parse<ProvenanceVerificationOutcome>(expectedOutcome), result.Outcome); 151Assert.Equal(ProvenanceVerificationOutcome.WorkflowMismatch, result.Outcome); 302Assert.Equal(ProvenanceVerificationOutcome.Verified, result.Outcome); 325Assert.Equal(ProvenanceVerificationOutcome.Verified, result.Outcome); 329[InlineData("https://github.com/evil/aspire-skills", ".github/workflows/publish.yml", "refs/tags/v0.0.1", nameof(ProvenanceVerificationOutcome.SourceRepositoryMismatch))] 330[InlineData("https://github.com/microsoft/aspire-skills", ".github/workflows/evil.yml", "refs/tags/v0.0.1", nameof(ProvenanceVerificationOutcome.WorkflowMismatch))] 331[InlineData("https://github.com/microsoft/aspire-skills", ".github/workflows/publish.yml", "refs/heads/main", nameof(ProvenanceVerificationOutcome.WorkflowRefMismatch))] 355Assert.Equal(Enum.Parse<ProvenanceVerificationOutcome>(expectedOutcome), result.Outcome); 375Assert.Equal(ProvenanceVerificationOutcome.SourceRepositoryMismatch, result.Outcome); 395Assert.Equal(ProvenanceVerificationOutcome.WorkflowMismatch, result.Outcome); 415Assert.Equal(ProvenanceVerificationOutcome.BuildTypeMismatch, result.Outcome); 436Assert.Equal(ProvenanceVerificationOutcome.WorkflowRefMismatch, result.Outcome); 456var outcome = SigstoreNpmProvenanceChecker.VerifyNpmSubject( 462Assert.Equal(ProvenanceVerificationOutcome.Verified, outcome); 478var outcome = SigstoreNpmProvenanceChecker.VerifyNpmSubject( 484Assert.Equal(ProvenanceVerificationOutcome.PackageIdentityMismatch, outcome); 500var outcome = SigstoreNpmProvenanceChecker.VerifyNpmSubject( 506Assert.Equal(ProvenanceVerificationOutcome.PackageDigestMismatch, outcome); 510[InlineData("""[]""", nameof(ProvenanceVerificationOutcome.PackageIdentityMismatch))] 511[InlineData("""[{ "name": "pkg:npm/%40playwright/cli@0.1.1" }]""", nameof(ProvenanceVerificationOutcome.PackageDigestMismatch))] 512[InlineData("""[{ "digest": { "sha512": "00112233445566778899aabbccddeeff" } }]""", nameof(ProvenanceVerificationOutcome.PackageIdentityMismatch))] 526nameof(ProvenanceVerificationOutcome.PackageIdentityMismatch))] 531var outcome = SigstoreNpmProvenanceChecker.VerifyNpmSubject( 537Assert.Equal(Enum.Parse<ProvenanceVerificationOutcome>(expectedOutcome), outcome); 713Assert.Equal(ProvenanceVerificationOutcome.Verified, result.Outcome); 717Assert.Equal(ProvenanceVerificationOutcome.SourceRepositoryMismatch, result.Outcome); 742Assert.Equal(ProvenanceVerificationOutcome.WorkflowMismatch, result.Outcome); 770Assert.Equal(ProvenanceVerificationOutcome.WorkflowRefMismatch, result.Outcome); 791Assert.Equal(ProvenanceVerificationOutcome.WorkflowRefMismatch, result.Outcome); 818Assert.Equal(ProvenanceVerificationOutcome.BuildTypeMismatch, result.Outcome); 838Assert.Equal(ProvenanceVerificationOutcome.BuildTypeMismatch, result.Outcome);
TestServices\FakePlaywrightServices.cs (1)
39Outcome = ProvenanceVerificationOutcome.Verified,