From 1b101df2c0715cc86083186c444db4d4a53e22e3 Mon Sep 17 00:00:00 2001 From: Ettore Di Giacinto Date: Sat, 16 Aug 2025 16:30:13 +0200 Subject: [PATCH] chore: InTrustedRoot -> VerifyPath Signed-off-by: Ettore Di Giacinto --- core/http/endpoints/localai/edit_model.go | 2 +- core/http/endpoints/localai/import_model.go | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/core/http/endpoints/localai/edit_model.go b/core/http/endpoints/localai/edit_model.go index c040ee1d6..919615098 100644 --- a/core/http/endpoints/localai/edit_model.go +++ b/core/http/endpoints/localai/edit_model.go @@ -158,7 +158,7 @@ func EditModelEndpoint(cl *config.ModelConfigLoader, appConfig *config.Applicati // Load the existing configuration configPath := filepath.Join(appConfig.SystemState.Model.ModelsPath, modelName+".yaml") - if err := utils.InTrustedRoot(configPath, appConfig.SystemState.Model.ModelsPath); err != nil { + if err := utils.VerifyPath(modelName+".yaml", appConfig.SystemState.Model.ModelsPath); err != nil { response := ModelResponse{ Success: false, Error: "Model configuration not trusted: " + err.Error(), diff --git a/core/http/endpoints/localai/import_model.go b/core/http/endpoints/localai/import_model.go index bdb84334d..c6ff6bb96 100644 --- a/core/http/endpoints/localai/import_model.go +++ b/core/http/endpoints/localai/import_model.go @@ -94,7 +94,7 @@ func ImportModelEndpoint(cl *config.ModelConfigLoader, appConfig *config.Applica // Create the configuration file configPath := filepath.Join(appConfig.SystemState.Model.ModelsPath, modelConfig.Name+".yaml") - if err := utils.InTrustedRoot(configPath, appConfig.SystemState.Model.ModelsPath); err != nil { + if err := utils.VerifyPath(modelConfig.Name+".yaml", appConfig.SystemState.Model.ModelsPath); err != nil { response := ModelResponse{ Success: false, Error: "Model path not trusted: " + err.Error(),