{"record":{"id":"e9dfea61f95844eb","repo":"router-for-me/CLIProxyAPI","slug":"unsupported-plugin-store-resolved-auth-type-q","errorCode":null,"errorMessage":"unsupported plugin store resolved auth type %q","messagePattern":"unsupported plugin store resolved auth type %q","errorType":"http","errorClass":null,"httpStatus":502,"severity":"error","filePath":"internal/pluginstore/auth.go","lineNumber":305,"sourceCode":"\t\tcredential := make([]byte, 0, len(item.Username)+1+len(item.Password))\n\t\tcredential = append(credential, item.Username...)\n\t\tcredential = append(credential, ':')\n\t\tcredential = append(credential, item.Password...)\n\t\tencoded := base64.StdEncoding.EncodeToString(credential)\n\t\tfor index := range credential {\n\t\t\tcredential[index] = 0\n\t\t}\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 resolved auth missing header-name\")\n\t\t}\n\t\tif len(item.HeaderValue) == 0 {\n\t\t\treturn false, fmt.Errorf(\"plugin store resolved auth header value is empty\")\n\t\t}\n\t\theaders.Set(item.HeaderName, string(item.HeaderValue))\n\tdefault:\n\t\treturn false, fmt.Errorf(\"unsupported plugin store resolved auth type %q\", item.Type)\n\t}\n\treturn true, nil\n}\n\nfunc validatePluginStoreRequestURL(auth []AuthConfig, requestURL string, kind string) error {\n\tparsed, errParse := url.Parse(strings.TrimSpace(requestURL))\n\tif errParse != nil || parsed.Scheme == \"\" || parsed.Host == \"\" {\n\t\treturn fmt.Errorf(\"invalid plugin store url\")\n\t}\n\tif parsed.User != nil {\n\t\treturn fmt.Errorf(\"plugin store url must not contain credentials\")\n\t}\n\tif hasSensitiveQueryParameter(parsed) {\n\t\treturn fmt.Errorf(\"plugin store url contains sensitive query parameter\")\n\t}\n\tif strings.EqualFold(parsed.Scheme, \"http\") && !allowInsecurePluginStoreURL(auth, requestURL, kind) {\n\t\treturn fmt.Errorf(\"insecure plugin store url requires matching allow-insecure auth rule\")\n\t}","sourceCodeStart":287,"sourceCodeEnd":323,"githubUrl":"https://github.com/router-for-me/CLIProxyAPI/blob/78f0c4079e3e6273d65d03b5549cffc898703264/internal/pluginstore/auth.go#L287-L323","documentation":"The auth applier in internal/pluginstore/auth.go hit its default case: the resolved auth entry's Type string is not one of none, bearer, basic, header, or github-token. The switch cannot guess how to authenticate the request, so it refuses rather than sending an unauthenticated call. Almost always a typo or a version mismatch where config uses a type this build does not know.","triggerScenarios":"A matching auth rule has type: apikey (or 'Bearer ' with trailing space and different casing after normalization failure, or any unsupported string) and a request hits applyResolvedAuth for that rule.","commonSituations":"Typo in config.yaml (apikey vs header); config written for a newer/older CLIProxyAPI version with different type names; copied auth block from another tool (e.g. npm registry auth syntax) into plugin-store config.","solutions":["Change type to one of: none, bearer, basic, header, github-token","Check for trailing spaces/quotes around the type value in YAML","Verify against the version's config.example.yaml which auth types this build supports"],"exampleFix":"# before\n- match: https://plugins.example.com\n  type: apikey\n  token-env: PLUGIN_TOKEN\n\n# after\n- match: https://plugins.example.com\n  type: bearer\n  token-env: PLUGIN_TOKEN","handlingStrategy":"validation","validationCode":"var validAuthTypes = map[string]bool{\"none\": true, \"bearer\": true, \"basic\": true, \"header\": true, \"github-token\": true}\n\nfunc authTypeValid(t string) bool { return validAuthTypes[strings.ToLower(strings.TrimSpace(t))] }","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Validate every auth rule's type against the supported set before the first request","Treat unknown auth types in config as a startup error, not a runtime surprise"],"tags":["config","auth","plugin-store","typo"],"backgroundTag":null,"analyzedSha":"78f0c4079e3e6273d65d03b5549cffc898703264","analyzedAt":"2026-08-15T12:26:37.444Z","schemaVersion":2},"datasetVersion":"2026-08-15T22:17:37.221Z"}