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