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

Method getTrustDomain

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

Source from the content-addressed store, hash-verified

301}
302
303func (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}

Callers 1

GetTrustDomainMethod · 0.95

Calls 3

shouldRetryFunction · 0.70
RESTMethod · 0.65
StringMethod · 0.65

Tested by

no test coverage detected