chore: InTrustedRoot -> VerifyPath

Signed-off-by: Ettore Di Giacinto <mudler@localai.io>
This commit is contained in:
Ettore Di Giacinto
2025-08-16 16:30:13 +02:00
parent 784bd5db33
commit 1b101df2c0
2 changed files with 2 additions and 2 deletions

View File

@@ -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(),

View File

@@ -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(),