{"record":{"id":"be9cc058081033c6","repo":"goharbor/harbor","slug":"10011","errorCode":"10011","errorMessage":"header '%s' missing","messagePattern":"header '(.+?)' missing","errorType":"http","errorClass":"errs.baseError","httpStatus":401,"severity":"error","filePath":"src/jobservice/api/authenticator.go","lineNumber":56,"sourceCode":"\t//\n\t// Returns:\n\t// nil returned if successfully done\n\t// otherwise an error returned\n\tDoAuth(req *http.Request) error\n}\n\n// SecretAuthenticator implements interface 'Authenticator' based on simple secret.\ntype SecretAuthenticator struct{}\n\n// DoAuth implements same method in interface 'Authenticator'.\nfunc (sa *SecretAuthenticator) DoAuth(req *http.Request) error {\n\tif req == nil {\n\t\treturn errors.New(\"nil request\")\n\t}\n\n\th := strings.TrimSpace(req.Header.Get(authHeader))\n\tif utils.IsEmptyStr(h) {\n\t\treturn fmt.Errorf(\"header '%s' missing\", authHeader)\n\t}\n\n\tif !strings.HasPrefix(h, secretPrefix) {\n\t\treturn fmt.Errorf(\"'%s' should start with '%s'\", authHeader, secretPrefix)\n\t}\n\n\tsecret := strings.TrimSpace(strings.TrimPrefix(h, secretPrefix))\n\t// incase both two are empty\n\tif utils.IsEmptyStr(secret) {\n\t\treturn errors.New(\"empty secret is not allowed\")\n\t}\n\n\texpectedSecret := config.GetUIAuthSecret()\n\tif subtle.ConstantTimeCompare([]byte(expectedSecret), []byte(secret)) == 0 {\n\t\treturn errors.New(\"unauthorized\")\n\t}\n\n\treturn nil","sourceCodeStart":38,"sourceCodeEnd":74,"githubUrl":"https://github.com/goharbor/harbor/blob/7b2fd08cc568955cca339afeefab27372840d936/src/jobservice/api/authenticator.go#L38-L74","documentation":"Error \"header '%s' missing\" thrown in goharbor/harbor.","triggerScenarios":"Thrown at src/jobservice/api/authenticator.go:56 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"}