([]*api.Attestation, verify.PolicyBuilder)
| 19 | } |
| 20 | |
| 21 | func (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 | |
| 53 | func NewMockSigstoreVerifier(t *testing.T) *MockSigstoreVerifier { |
| 54 | result := BuildSigstoreJsMockResult(t) |
nothing calls this directly
no test coverage detected