MCPcopy Create free account
hub / github.com/cli/cli / getTrustDomain

Method getTrustDomain

pkg/cmd/attestation/api/client.go:300–322  ·  view source on GitHub ↗
(u safeurl.SafeURL)

Source from the content-addressed store, hash-verified

298}
299
300func (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}

Callers 1

GetTrustDomainMethod · 0.95

Calls 3

shouldRetryFunction · 0.70
RESTMethod · 0.65
StringMethod · 0.65

Tested by

no test coverage detected