Get and validate OCI credentials by providing a registry URL (no path)
(repoURI, username, password string)
| 31 | |
| 32 | // Get and validate OCI credentials by providing a registry URL (no path) |
| 33 | func NewCredentialsFromRegistry(repoURI, username, password string) (authn.Keychain, error) { |
| 34 | reg, err := name.NewRegistry(repoURI) |
| 35 | if err != nil { |
| 36 | return nil, fmt.Errorf("invalid registry server URI: %w", err) |
| 37 | } |
| 38 | |
| 39 | c := &Credentials{username, password, reg.RegistryStr()} |
| 40 | return validateOCICredentials(c) |
| 41 | } |
| 42 | |
| 43 | // Get and validate OCI credentials by providing a repository URL |
| 44 | func NewCredentials(repoURI, username, password string) (authn.Keychain, error) { |
no test coverage detected