mirror of
https://github.com/eigent-ai/eigent.git
synced 2026-07-09 17:28:35 +00:00
fix: correct PUT /api/v1/provider silently dropping model_type, endpoint_url, encrypted_config (#1627)
The _UPDATABLE_FIELDS whitelist used obsolete field names (api_base, extra_config) that no longer exist in the ModelProvider model. When updating a provider via PUT, the actual fields model_type, endpoint_url and encrypted_config were silently ignored. Updated the whitelist to use the correct field names matching the ModelProvider model definition. Closes #1627
This commit is contained in:
parent
247b4553d7
commit
4c0feade12
1 changed files with 1 additions and 1 deletions
|
|
@ -66,7 +66,7 @@ class ProviderService:
|
|||
if not model:
|
||||
return {"success": False, "error_code": "PROVIDER_NOT_FOUND"}
|
||||
# H10: only allow updating safe fields
|
||||
_UPDATABLE_FIELDS = {"provider_name", "api_key", "api_base", "extra_config", "prefer", "is_vaild"}
|
||||
_UPDATABLE_FIELDS = {"provider_name", "model_type", "api_key", "endpoint_url", "encrypted_config", "prefer", "is_vaild"}
|
||||
for key, value in data.items():
|
||||
if key in _UPDATABLE_FIELDS:
|
||||
setattr(model, key, value)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue