GetByDigest fetches the attestation by digest and either owner or repo depending on which is provided
(params FetchParams)
| 86 | // GetByDigest fetches the attestation by digest and either owner or repo |
| 87 | // depending on which is provided |
| 88 | func (c *LiveClient) GetByDigest(params FetchParams) ([]*Attestation, error) { |
| 89 | c.logger.VerbosePrintf("Fetching attestations for artifact digest %s\n\n", params.Digest) |
| 90 | attestations, err := c.getAttestations(params) |
| 91 | if err != nil { |
| 92 | return nil, err |
| 93 | } |
| 94 | |
| 95 | bundles, err := c.fetchBundleFromAttestations(attestations) |
| 96 | if err != nil { |
| 97 | return nil, fmt.Errorf("failed to fetch bundle with URL: %w", err) |
| 98 | } |
| 99 | |
| 100 | return bundles, nil |
| 101 | } |
| 102 | |
| 103 | func (c *LiveClient) buildRequestURL(params FetchParams) (string, error) { |
| 104 | if err := params.Validate(); err != nil { |