(u safeurl.SafeURL)
| 298 | } |
| 299 | |
| 300 | func (c *LiveClient) getTrustDomain(u safeurl.SafeURL) (string, error) { |
| 301 | var resp MetaResponse |
| 302 | |
| 303 | bo := backoff.NewConstantBackOff(getAttestationRetryInterval) |
| 304 | err := backoff.Retry(func() error { |
| 305 | restErr := c.githubAPI.REST(c.host, http.MethodGet, u.String(), nil, &resp) |
| 306 | if restErr != nil { |
| 307 | if shouldRetry(restErr) { |
| 308 | return restErr |
| 309 | } else { |
| 310 | return backoff.Permanent(restErr) |
| 311 | } |
| 312 | } |
| 313 | |
| 314 | return nil |
| 315 | }, backoff.WithMaxRetries(bo, 3)) |
| 316 | |
| 317 | if err != nil { |
| 318 | return "", err |
| 319 | } |
| 320 | |
| 321 | return resp.Domains.ArtifactAttestations.TrustDomain, nil |
| 322 | } |
no test coverage detected