MCPcopy Create free account
hub / github.com/docker/cli / Server

Function Server

cmd/docker-trust/internal/trust/trust.go:82–95  ·  view source on GitHub ↗

Server returns the base URL for the trust server.

(indexName string)

Source from the content-addressed store, hash-verified

80
81// Server returns the base URL for the trust server.
82func Server(indexName string) (string, error) {
83 if s := os.Getenv("DOCKER_CONTENT_TRUST_SERVER"); s != "" {
84 urlObj, err := url.Parse(s)
85 if err != nil || urlObj.Scheme != "https" {
86 return "", fmt.Errorf("valid https URL required for trust server, got %s", s)
87 }
88
89 return s, nil
90 }
91 if indexName == "docker.io" || indexName == "index.docker.io" {
92 return NotaryServer, nil
93 }
94 return "https://" + indexName, nil
95}
96
97type simpleCredentialStore struct {
98 auth registrytypes.AuthConfig

Callers 5

TestENVTrustServerFunction · 0.85
TestHTTPENVTrustServerFunction · 0.85
TestOfficialTrustServerFunction · 0.85
GetNotaryRepositoryFunction · 0.85

Calls

no outgoing calls

Tested by 4

TestENVTrustServerFunction · 0.68
TestHTTPENVTrustServerFunction · 0.68
TestOfficialTrustServerFunction · 0.68

Used in the wild real call sites across dependent graphs

searching dependent graphs…