77 references to ProvenanceVerificationOutcome
aspire (36)
Agents\AspireSkills\GitHubArtifactAttestationVerifier.cs (9)
53
return new ProvenanceVerificationResult { Outcome =
ProvenanceVerificationOutcome
.AttestationFetchFailed };
61
return new ProvenanceVerificationResult { Outcome =
ProvenanceVerificationOutcome
.AttestationFetchFailed };
70
?
ProvenanceVerificationOutcome
.AttestationParseFailed
71
:
ProvenanceVerificationOutcome
.SlsaProvenanceNotFound
83
return new ProvenanceVerificationResult { Outcome =
ProvenanceVerificationOutcome
.AttestationParseFailed };
89
return new ProvenanceVerificationResult { Outcome =
ProvenanceVerificationOutcome
.SourceRepositoryMismatch };
110
return new ProvenanceVerificationResult { Outcome =
ProvenanceVerificationOutcome
.AttestationParseFailed };
117
return new ProvenanceVerificationResult { Outcome =
ProvenanceVerificationOutcome
.AttestationParseFailed };
130
return new ProvenanceVerificationResult { Outcome =
ProvenanceVerificationOutcome
.AttestationParseFailed };
Npm\INpmProvenanceChecker.cs (3)
116
public required
ProvenanceVerificationOutcome
Outcome { get; init; }
127
public 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)
76
return new ProvenanceVerificationResult { Outcome =
ProvenanceVerificationOutcome
.AttestationFetchFailed };
83
var
outcome = parseFailed
84
?
ProvenanceVerificationOutcome
.AttestationParseFailed
85
:
ProvenanceVerificationOutcome
.SlsaProvenanceNotFound;
101
return new ProvenanceVerificationResult { Outcome =
ProvenanceVerificationOutcome
.AttestationParseFailed };
115
var
subjectOutcome = VerifyNpmSubject(
120
if (subjectOutcome is not
ProvenanceVerificationOutcome
.Verified)
134
return new ProvenanceVerificationResult { Outcome =
ProvenanceVerificationOutcome
.AttestationParseFailed };
255
return (new ProvenanceVerificationResult { Outcome =
ProvenanceVerificationOutcome
.SourceRepositoryMismatch }, null);
275
return (new ProvenanceVerificationResult { Outcome =
ProvenanceVerificationOutcome
.AttestationParseFailed }, null);
287
return (new ProvenanceVerificationResult { Outcome =
ProvenanceVerificationOutcome
.AttestationParseFailed }, null);
327
internal static
ProvenanceVerificationOutcome
VerifyNpmSubject(
335
return
ProvenanceVerificationOutcome
.PackageIdentityMismatch;
347
return
ProvenanceVerificationOutcome
.PackageIdentityMismatch;
354
return
ProvenanceVerificationOutcome
.PackageDigestMismatch;
365
return
ProvenanceVerificationOutcome
.PackageDigestMismatch;
369
?
ProvenanceVerificationOutcome
.Verified
370
:
ProvenanceVerificationOutcome
.PackageDigestMismatch;
469
Outcome =
ProvenanceVerificationOutcome
.SourceRepositoryMismatch,
478
Outcome =
ProvenanceVerificationOutcome
.WorkflowMismatch,
487
Outcome =
ProvenanceVerificationOutcome
.BuildTypeMismatch,
498
Outcome =
ProvenanceVerificationOutcome
.WorkflowRefMismatch,
507
Outcome =
ProvenanceVerificationOutcome
.WorkflowRefMismatch,
515
Outcome =
ProvenanceVerificationOutcome
.Verified,
Aspire.Cli.Tests (41)
Agents\AspireSkillsInstallerTests.cs (2)
1761
Result = new ProvenanceVerificationResult { Outcome =
ProvenanceVerificationOutcome
.WorkflowMismatch }
2228
Outcome =
ProvenanceVerificationOutcome
.Verified,
Agents\PlaywrightCliInstallerTests.cs (5)
443
var provenanceChecker = new TestNpmProvenanceChecker { ProvenanceOutcome =
ProvenanceVerificationOutcome
.SourceRepositoryMismatch };
480
var provenanceChecker = new TestNpmProvenanceChecker { ProvenanceOutcome =
ProvenanceVerificationOutcome
.AttestationFetchFailed };
1040
public
ProvenanceVerificationOutcome
ProvenanceOutcome { get; set; } =
ProvenanceVerificationOutcome
.Verified;
1053
Provenance = ProvenanceOutcome is
ProvenanceVerificationOutcome
.Verified
Agents\SigstoreNpmProvenanceCheckerTests.cs (33)
125
nameof(
ProvenanceVerificationOutcome
.PackageIdentityMismatch))]
129
nameof(
ProvenanceVerificationOutcome
.PackageDigestMismatch))]
140
Assert.Equal(Enum.Parse<
ProvenanceVerificationOutcome
>(expectedOutcome), result.Outcome);
151
Assert.Equal(
ProvenanceVerificationOutcome
.WorkflowMismatch, result.Outcome);
302
Assert.Equal(
ProvenanceVerificationOutcome
.Verified, result.Outcome);
325
Assert.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))]
355
Assert.Equal(Enum.Parse<
ProvenanceVerificationOutcome
>(expectedOutcome), result.Outcome);
375
Assert.Equal(
ProvenanceVerificationOutcome
.SourceRepositoryMismatch, result.Outcome);
395
Assert.Equal(
ProvenanceVerificationOutcome
.WorkflowMismatch, result.Outcome);
415
Assert.Equal(
ProvenanceVerificationOutcome
.BuildTypeMismatch, result.Outcome);
436
Assert.Equal(
ProvenanceVerificationOutcome
.WorkflowRefMismatch, result.Outcome);
456
var
outcome = SigstoreNpmProvenanceChecker.VerifyNpmSubject(
462
Assert.Equal(
ProvenanceVerificationOutcome
.Verified, outcome);
478
var
outcome = SigstoreNpmProvenanceChecker.VerifyNpmSubject(
484
Assert.Equal(
ProvenanceVerificationOutcome
.PackageIdentityMismatch, outcome);
500
var
outcome = SigstoreNpmProvenanceChecker.VerifyNpmSubject(
506
Assert.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))]
526
nameof(
ProvenanceVerificationOutcome
.PackageIdentityMismatch))]
531
var
outcome = SigstoreNpmProvenanceChecker.VerifyNpmSubject(
537
Assert.Equal(Enum.Parse<
ProvenanceVerificationOutcome
>(expectedOutcome), outcome);
713
Assert.Equal(
ProvenanceVerificationOutcome
.Verified, result.Outcome);
717
Assert.Equal(
ProvenanceVerificationOutcome
.SourceRepositoryMismatch, result.Outcome);
742
Assert.Equal(
ProvenanceVerificationOutcome
.WorkflowMismatch, result.Outcome);
770
Assert.Equal(
ProvenanceVerificationOutcome
.WorkflowRefMismatch, result.Outcome);
791
Assert.Equal(
ProvenanceVerificationOutcome
.WorkflowRefMismatch, result.Outcome);
818
Assert.Equal(
ProvenanceVerificationOutcome
.BuildTypeMismatch, result.Outcome);
838
Assert.Equal(
ProvenanceVerificationOutcome
.BuildTypeMismatch, result.Outcome);
TestServices\FakePlaywrightServices.cs (1)
39
Outcome =
ProvenanceVerificationOutcome
.Verified,