MCPcopy Create free account
hub / github.com/chainloop-dev/chainloop / NewCredentialsFromRegistry

Function NewCredentialsFromRegistry

internal/ociauth/auth.go:33–41  ·  view source on GitHub ↗

Get and validate OCI credentials by providing a registry URL (no path)

(repoURI, username, password string)

Source from the content-addressed store, hash-verified

31
32// Get and validate OCI credentials by providing a registry URL (no path)
33func 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
44func NewCredentials(repoURI, username, password string) (authn.Keychain, error) {

Callers 1

WithOCIAuthFunction · 0.92

Calls 1

validateOCICredentialsFunction · 0.85

Tested by

no test coverage detected