{"record":{"id":"0a8becad53768cd2","repo":"goharbor/harbor","slug":"challengesunsupportedcode","errorCode":"ChallengesUnsupportedCode","errorMessage":"bearer auth scheme isn't supported: %v","messagePattern":"bearer auth scheme isn't supported: (.+?)","errorType":"error_code","errorClass":"lib/errors.Error","httpStatus":null,"severity":"error","filePath":"src/pkg/reg/util/util.go","lineNumber":58,"sourceCode":"}\n\nfunc Ping(registry *model.Registry) (string, string, error) {\n\tclient := &http.Client{\n\t\tTransport: GetHTTPTransport(registry.Insecure, registry.CACertificate),\n\t}\n\n\tresp, err := client.Get(registry.URL + \"/v2/\")\n\tif err != nil {\n\t\treturn \"\", \"\", err\n\t}\n\tdefer resp.Body.Close()\n\tchallenges := challenge.ResponseChallenges(resp)\n\tfor _, challenge := range challenges {\n\t\tif challenge.Scheme == \"bearer\" {\n\t\t\treturn challenge.Parameters[\"realm\"], challenge.Parameters[\"service\"], nil\n\t\t}\n\t}\n\treturn \"\", \"\", errors.New(nil).WithCode(errors.ChallengesUnsupportedCode).WithMessagef(\"bearer auth scheme isn't supported: %v\", challenges)\n}\n\n// ParseRepository parses the \"repository\" provided into two parts: namespace and the rest\n// the string before the last \"/\" is the namespace part\n// c -> [,c]\n// b/c -> [b,c]\n// a/b/c -> [a/b,c]\nfunc ParseRepository(repository string) (string, string) {\n\tif len(repository) == 0 {\n\t\treturn \"\", \"\"\n\t}\n\tindex := strings.LastIndex(repository, \"/\")\n\tif index == -1 {\n\t\treturn \"\", repository\n\t}\n\treturn repository[:index], repository[index+1:]\n}\n","sourceCodeStart":40,"sourceCodeEnd":76,"githubUrl":"https://github.com/goharbor/harbor/blob/7b2fd08cc568955cca339afeefab27372840d936/src/pkg/reg/util/util.go#L40-L76","documentation":"Error \"bearer auth scheme isn't supported: %v\" thrown in goharbor/harbor.","triggerScenarios":"Thrown at src/pkg/reg/util/util.go:58 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":[],"exampleFix":null,"handlingStrategy":null,"validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"7b2fd08cc568955cca339afeefab27372840d936","analyzedAt":"2026-08-16T00:00:10.961Z","schemaVersion":2},"datasetVersion":"2026-08-16T03:17:38.424Z"}