goharbor/harbor · error · lib/errors.Error

ChallengesUnsupportedCode

ChallengesUnsupportedCode

Error message

bearer auth scheme isn't supported: %v

What it means

Error "bearer auth scheme isn't supported: %v" thrown in goharbor/harbor.

Source

Thrown at src/pkg/reg/util/util.go:58

}

func Ping(registry *model.Registry) (string, string, error) {
	client := &http.Client{
		Transport: GetHTTPTransport(registry.Insecure, registry.CACertificate),
	}

	resp, err := client.Get(registry.URL + "/v2/")
	if err != nil {
		return "", "", err
	}
	defer resp.Body.Close()
	challenges := challenge.ResponseChallenges(resp)
	for _, challenge := range challenges {
		if challenge.Scheme == "bearer" {
			return challenge.Parameters["realm"], challenge.Parameters["service"], nil
		}
	}
	return "", "", errors.New(nil).WithCode(errors.ChallengesUnsupportedCode).WithMessagef("bearer auth scheme isn't supported: %v", challenges)
}

// ParseRepository parses the "repository" provided into two parts: namespace and the rest
// the string before the last "/" is the namespace part
// c -> [,c]
// b/c -> [b,c]
// a/b/c -> [a/b,c]
func ParseRepository(repository string) (string, string) {
	if len(repository) == 0 {
		return "", ""
	}
	index := strings.LastIndex(repository, "/")
	if index == -1 {
		return "", repository
	}
	return repository[:index], repository[index+1:]
}

View on GitHub (pinned to 7b2fd08cc5)

When it happens

Trigger: Thrown at src/pkg/reg/util/util.go:58 when the library encounters an invalid state.

Common situations: See trigger scenarios.


AI-assisted analysis of goharbor/harbor@7b2fd08cc5 (2026-08-16). Data as JSON: /api/errors/0a8becad53768cd2. Report an issue: GitHub.