Server returns the base URL for the trust server.
(indexName string)
| 80 | |
| 81 | // Server returns the base URL for the trust server. |
| 82 | func 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 | |
| 97 | type simpleCredentialStore struct { |
| 98 | auth registrytypes.AuthConfig |
no outgoing calls
searching dependent graphs…