{"record":{"id":"3501dc8f4f7343c5","repo":"goharbor/harbor","slug":"unauthorized-3501dc","errorCode":null,"errorMessage":"Unauthorized","messagePattern":"Unauthorized","errorType":"http","errorClass":null,"httpStatus":401,"severity":"error","filePath":"src/registryctl/handlers/handler.go","lineNumber":79,"sourceCode":"func (a *authHandler) ServeHTTP(w http.ResponseWriter, r *http.Request) {\n\tif a.authenticator == nil {\n\t\tlog.Errorf(\"No authenticator found in registry controller.\")\n\t\thttp.Error(w, http.StatusText(http.StatusInternalServerError),\n\t\t\thttp.StatusInternalServerError)\n\t\treturn\n\t}\n\n\tif a.insecureAPIs != nil && a.insecureAPIs[r.URL.Path] {\n\t\tif a.handler != nil {\n\t\t\ta.handler.ServeHTTP(w, r)\n\t\t}\n\t\treturn\n\t}\n\n\terr := a.authenticator.AuthorizeRequest(r)\n\tif err != nil {\n\t\tlog.Errorf(\"failed to authenticate request: %v\", err)\n\t\thttp.Error(w, http.StatusText(http.StatusUnauthorized),\n\t\t\thttp.StatusUnauthorized)\n\t\treturn\n\t}\n\n\tif a.handler != nil {\n\t\ta.handler.ServeHTTP(w, r)\n\t}\n}\n","sourceCodeStart":61,"sourceCodeEnd":88,"githubUrl":"https://github.com/goharbor/harbor/blob/7b2fd08cc568955cca339afeefab27372840d936/src/registryctl/handlers/handler.go#L61-L88","documentation":"Error \"Unauthorized\" thrown in goharbor/harbor.","triggerScenarios":"Thrown at src/registryctl/handlers/handler.go:79 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"}