mirror of
https://github.com/dograh-hq/dograh.git
synced 2026-07-25 12:01:04 +02:00
fix: masked secret saves
This commit is contained in:
parent
d383729f50
commit
eb09aea6ca
8 changed files with 143 additions and 19 deletions
|
|
@ -326,7 +326,7 @@ async def save_model_configuration_v2(
|
|||
existing = await get_organization_ai_model_configuration_v2(organization_id)
|
||||
configuration = merge_ai_model_configuration_v2_secrets(request, existing)
|
||||
try:
|
||||
check_for_masked_keys_in_ai_model_configuration_v2(configuration)
|
||||
check_for_masked_keys_in_ai_model_configuration_v2(configuration, existing)
|
||||
effective = compile_ai_model_configuration_v2(configuration)
|
||||
await UserConfigurationValidator().validate(
|
||||
effective,
|
||||
|
|
|
|||
|
|
@ -155,7 +155,7 @@ async def update_user_configurations(
|
|||
raise HTTPException(status_code=422, detail=str(e))
|
||||
|
||||
try:
|
||||
check_for_masked_keys(user_configurations)
|
||||
check_for_masked_keys(user_configurations, existing_config)
|
||||
except ValueError as e:
|
||||
raise HTTPException(status_code=400, detail=str(e))
|
||||
|
||||
|
|
|
|||
|
|
@ -1078,6 +1078,7 @@ async def update_workflow(
|
|||
incoming_v2_override,
|
||||
existing_v2_override_config,
|
||||
)
|
||||
mask_check_existing = existing_v2_override_config
|
||||
if existing_v2_override_config is None:
|
||||
resolved_config = await get_resolved_ai_model_configuration(
|
||||
user_id=user.id,
|
||||
|
|
@ -1087,7 +1088,11 @@ async def update_workflow(
|
|||
v2_override,
|
||||
resolved_config.organization_configuration,
|
||||
)
|
||||
check_for_masked_keys_in_ai_model_configuration_v2(v2_override)
|
||||
mask_check_existing = resolved_config.organization_configuration
|
||||
check_for_masked_keys_in_ai_model_configuration_v2(
|
||||
v2_override,
|
||||
mask_check_existing,
|
||||
)
|
||||
effective = compile_ai_model_configuration_v2(v2_override)
|
||||
await UserConfigurationValidator().validate(
|
||||
effective,
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue