router-for-me/CLIProxyAPI · error
plugin store auth missing header-name
Error message
plugin store auth missing header-name
What it means
When a plugin store's auth config declares type "header", the config must also provide header-name; the env-based auth applier rejects the config otherwise. The env var supplying the header value (header-value-env) is only read after this check, so the error is purely a config-completeness failure.
Source
Thrown at internal/pluginstore/auth.go:255
token, errToken := envValueRequired(item.TokenEnv, "token-env")
if errToken != nil {
return false, errToken
}
headers.Set("Authorization", "Bearer "+token)
case AuthTypeBasic:
username, errUsername := envValueRequired(item.UsernameEnv, "username-env")
if errUsername != nil {
return false, errUsername
}
password, errPassword := envValueRequired(item.PasswordEnv, "password-env")
if errPassword != nil {
return false, errPassword
}
encoded := base64.StdEncoding.EncodeToString([]byte(username + ":" + password))
headers.Set("Authorization", "Basic "+encoded)
case AuthTypeHeader:
if strings.TrimSpace(item.HeaderName) == "" {
return false, fmt.Errorf("plugin store auth missing header-name")
}
value, errValue := envValueRequired(item.HeaderValueEnv, "header-value-env")
if errValue != nil {
return false, errValue
}
headers.Set(item.HeaderName, value)
case AuthTypeGitHubToken:
token, errToken := envValueRequired(item.TokenEnv, "token-env")
if errToken != nil {
return false, errToken
}
headers.Set("Authorization", "Bearer "+token)
default:
return false, fmt.Errorf("unsupported plugin store auth type %q", item.Type)
}
return true, nil
}
View on GitHub (pinned to 78f0c4079e)
Solutions
- Add header-name to the store's auth block in the plugin store config
- Validate the store config with a schema/lint step before deploying
- Check for YAML indentation errors that silently detach header-name from the auth map
Example fix
# before auth: type: header header-value-env: MY_HEADER # after auth: type: header header-name: X-Custom-Token header-value-env: MY_HEADER
Defensive patterns
Strategy: validation
Validate before calling
func validateStoreAuth(item StoreAuthConfig) error {
switch strings.ToLower(strings.TrimSpace(item.Type)) {
case "", "none":
return nil
case "header":
if strings.TrimSpace(item.HeaderName) == "" {
return fmt.Errorf("auth.type 'header' requires auth.header-name")
}
}
return nil
} Prevention
- Lint plugin store config in CI before deploy
- Copy auth blocks from config.example.yaml to get field names right
When it happens
Trigger: A plugin store entry in config.yaml with auth.type: header but missing or blank auth.header-name.
Common situations: Hand-edited YAML where the header-name key was typo'd (e.g. headerName) or omitted; migrating a bearer-auth store to header auth and forgetting the new field.
Related errors
- unsupported plugin store auth type %q
- plugin store resolved auth missing header-name
- plugin store resolved auth token is empty
- plugin store resolved basic auth is incomplete
- plugin store resolved auth header value is empty
AI-assisted analysis of router-for-me/CLIProxyAPI@78f0c4079e (2026-08-15).
Data as JSON: /api/errors/6be8f80b13c76a18.
Report an issue: GitHub.