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

Method getTrustDomain

pkg/cmd/attestation/api/client.go:285–307  ·  view source on GitHub ↗
(url string)

Source from the content-addressed store, hash-verified

283}
284
285func (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}

Callers 1

GetTrustDomainMethod · 0.95

Calls 2

shouldRetryFunction · 0.70
RESTMethod · 0.65

Tested by

no test coverage detected