MCPcopy Index your code
hub / github.com/cli/cli / OnGetByDigestSuccess

Function OnGetByDigestSuccess

pkg/cmd/attestation/api/mock_client.go:38–53  ·  view source on GitHub ↗
(params FetchParams)

Source from the content-addressed store, hash-verified

36}
37
38func 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
55func OnGetByDigestFailure(params FetchParams) ([]*Attestation, error) {
56 if params.Repo != "" {

Callers

nothing calls this directly

Calls 3

FilterAttestationsFunction · 0.85
makeTestAttestationFunction · 0.70

Tested by

no test coverage detected