{"record":{"id":"60a8361ff1914a19","repo":"router-for-me/CLIProxyAPI","slug":"unsupported-plugin-store-auth-type-q","errorCode":null,"errorMessage":"unsupported plugin store auth type %q","messagePattern":"unsupported plugin store auth type %q","errorType":"http","errorClass":null,"httpStatus":502,"severity":"error","filePath":"internal/pluginstore/auth.go","lineNumber":269,"sourceCode":"\t\tencoded := base64.StdEncoding.EncodeToString([]byte(username + \":\" + password))\n\t\theaders.Set(\"Authorization\", \"Basic \"+encoded)\n\tcase AuthTypeHeader:\n\t\tif strings.TrimSpace(item.HeaderName) == \"\" {\n\t\t\treturn false, fmt.Errorf(\"plugin store auth missing header-name\")\n\t\t}\n\t\tvalue, errValue := envValueRequired(item.HeaderValueEnv, \"header-value-env\")\n\t\tif errValue != nil {\n\t\t\treturn false, errValue\n\t\t}\n\t\theaders.Set(item.HeaderName, value)\n\tcase AuthTypeGitHubToken:\n\t\ttoken, errToken := envValueRequired(item.TokenEnv, \"token-env\")\n\t\tif errToken != nil {\n\t\t\treturn false, errToken\n\t\t}\n\t\theaders.Set(\"Authorization\", \"Bearer \"+token)\n\tdefault:\n\t\treturn false, fmt.Errorf(\"unsupported plugin store auth type %q\", item.Type)\n\t}\n\treturn true, nil\n}\n\nfunc applyResolvedPluginStoreAuth(headers http.Header, item ResolvedAuthConfig) (bool, error) {\n\tswitch strings.ToLower(strings.TrimSpace(item.Type)) {\n\tcase \"\", AuthTypeNone:\n\t\treturn false, nil\n\tcase AuthTypeBearer, AuthTypeGitHubToken:\n\t\tif len(item.Token) == 0 {\n\t\t\treturn false, fmt.Errorf(\"plugin store resolved auth token is empty\")\n\t\t}\n\t\theaders.Set(\"Authorization\", \"Bearer \"+string(item.Token))\n\tcase AuthTypeBasic:\n\t\tif len(item.Username) == 0 || len(item.Password) == 0 {\n\t\t\treturn false, fmt.Errorf(\"plugin store resolved basic auth is incomplete\")\n\t\t}\n\t\tcredential := make([]byte, 0, len(item.Username)+1+len(item.Password))","sourceCodeStart":251,"sourceCodeEnd":287,"githubUrl":"https://github.com/router-for-me/CLIProxyAPI/blob/78f0c4079e3e6273d65d03b5549cffc898703264/internal/pluginstore/auth.go#L251-L287","documentation":"The env-based plugin store auth switch hit a default case: item.Type is not one of \"\", none, bearer, basic, header, github-token. The message embeds the offending value verbatim, so typos are easy to spot.","triggerScenarios":"auth.type set to a misspelled or renamed value (e.g. \"token\", \"githubtoken\", \"ApiKey\", trailing whitespace is trimmed but casing of unknown words is not corrected).","commonSituations":"Copy-pasted config from other tools using different auth type names; store schema changes between versions introducing a type the running binary does not know.","solutions":["Set auth.type to one of: none, bearer, basic, header, github-token (or omit it for none)","After upgrading, re-check the store config against the current config.example.yaml for renamed types"],"exampleFix":"# before\nauth:\n  type: token\n  token-env: GITHUB_TOKEN\n\n# after\nauth:\n  type: github-token\n  token-env: GITHUB_TOKEN","handlingStrategy":"validation","validationCode":"var validAuthTypes = map[string]bool{\"\": true, \"none\": true, \"bearer\": true, \"basic\": true, \"header\": true, \"github-token\": true}\n\nfunc validAuthType(t string) bool {\n    return validAuthTypes[strings.ToLower(strings.TrimSpace(t))]\n}","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Validate auth.type against the documented enum before applying config","Re-read the example config after upgrades for renamed auth types"],"tags":["config","plugin-store","auth","validation"],"backgroundTag":null,"analyzedSha":"78f0c4079e3e6273d65d03b5549cffc898703264","analyzedAt":"2026-08-15T12:26:37.444Z","schemaVersion":2},"datasetVersion":"2026-08-15T22:17:37.221Z"}