(params FetchParams)
| 36 | } |
| 37 | |
| 38 | func OnGetByDigestSuccess(params FetchParams) ([]*Attestation, error) { |
| 39 | att1 := makeTestAttestation() |
| 40 | att2 := makeTestAttestation() |
| 41 | att3 := makeTestReleaseAttestation() |
| 42 | attestations := []*Attestation{&att1, &att2} |
| 43 | if params.PredicateType != "" { |
| 44 | // "release" is a sentinel value that returns all release attestations (v0.1, v0.2, etc.) |
| 45 | // This mimics the GitHub API behavior which handles this server-side |
| 46 | if params.PredicateType == "release" { |
| 47 | return []*Attestation{&att3}, nil |
| 48 | } |
| 49 | return FilterAttestations(params.PredicateType, attestations) |
| 50 | } |
| 51 | |
| 52 | return attestations, nil |
| 53 | } |
| 54 | |
| 55 | func OnGetByDigestFailure(params FetchParams) ([]*Attestation, error) { |
| 56 | if params.Repo != "" { |
nothing calls this directly
no test coverage detected