(url string)
| 283 | } |
| 284 | |
| 285 | func (c *LiveClient) getTrustDomain(url string) (string, error) { |
| 286 | var resp MetaResponse |
| 287 | |
| 288 | bo := backoff.NewConstantBackOff(getAttestationRetryInterval) |
| 289 | err := backoff.Retry(func() error { |
| 290 | restErr := c.githubAPI.REST(c.host, http.MethodGet, url, nil, &resp) |
| 291 | if restErr != nil { |
| 292 | if shouldRetry(restErr) { |
| 293 | return restErr |
| 294 | } else { |
| 295 | return backoff.Permanent(restErr) |
| 296 | } |
| 297 | } |
| 298 | |
| 299 | return nil |
| 300 | }, backoff.WithMaxRetries(bo, 3)) |
| 301 | |
| 302 | if err != nil { |
| 303 | return "", err |
| 304 | } |
| 305 | |
| 306 | return resp.Domains.ArtifactAttestations.TrustDomain, nil |
| 307 | } |
no test coverage detected