refactor(credentials): move provider validation into handler layer
- Add BaseProviderHandler.validate_credentials() with default api_key check
- Implement provider-specific validate_credentials() overrides:
- Kiro: validates creds_file/sqlite_db/token persistence (file for admin,
DB path for users)
- OpenAI/Anthropic/Google: validate api_key presence/format
- Claude/Codex/Kilo/Qwen: validate OAuth2 or API key
- Ollama: always valid (no authentication required)
- get_provider_handler() now calls handler.validate_credentials() after
instantiation, raising ValueError on failure
- Replace all credential validation in main.py API endpoints with
handler-level checks, removing duplicate logic
- get_provider_models() now uses get_provider_handler() for unified validation
instead of scattered inline checks
- Remove obsolete validate_kiro_credentials() function from main.py
- All validation respects user vs admin credential storage (DB vs files)
Showing
This diff is collapsed.
This diff is collapsed.
Please
register
or
sign in
to comment