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

Method getTrustDomain

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

Source from the content-addressed store, hash-verified

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

Callers 1

GetTrustDomainMethod · 0.95

Calls 3

shouldRetryFunction · 0.70
RESTMethod · 0.65
StringMethod · 0.65

Tested by

no test coverage detected