MCPcopy Create free account
hub / github.com/cli/cli / Verify

Method Verify

pkg/cmd/attestation/verification/mock_verifier.go:21–51  ·  view source on GitHub ↗
([]*api.Attestation, verify.PolicyBuilder)

Source from the content-addressed store, hash-verified

19}
20
21func (v *MockSigstoreVerifier) Verify([]*api.Attestation, verify.PolicyBuilder) ([]*AttestationProcessingResult, error) {
22 if v.mockResults != nil {
23 return v.mockResults, nil
24 }
25
26 statement := &in_toto.Statement{}
27 statement.PredicateType = SLSAPredicateV1
28
29 result := AttestationProcessingResult{
30 Attestation: &api.Attestation{
31 Bundle: data.SigstoreBundle(v.t),
32 },
33 VerificationResult: &verify.VerificationResult{
34 Statement: statement,
35 Signature: &verify.SignatureVerificationResult{
36 Certificate: &certificate.Summary{
37 Extensions: certificate.Extensions{
38 BuildSignerURI: "https://github.com/github/example/.github/workflows/release.yml@refs/heads/main",
39 SourceRepositoryOwnerURI: "https://github.com/sigstore",
40 SourceRepositoryURI: "https://github.com/sigstore/sigstore-js",
41 Issuer: "https://token.actions.githubusercontent.com",
42 },
43 },
44 },
45 },
46 }
47
48 results := []*AttestationProcessingResult{&result}
49
50 return results, nil
51}
52
53func NewMockSigstoreVerifier(t *testing.T) *MockSigstoreVerifier {
54 result := BuildSigstoreJsMockResult(t)

Callers

nothing calls this directly

Calls 1

SigstoreBundleFunction · 0.92

Tested by

no test coverage detected