Fix declared server config file reads

This commit is contained in:
npc0-hue
2026-09-21 10:05:50 +08:00
parent b481b1b798
commit 20008b4043
16 changed files with 166 additions and 33 deletions
+1 -1
View File
@@ -1949,7 +1949,7 @@ func validatePluginFileWorkspace(prefix string, workspace domain.PluginFileWorks
}
for i, item := range workspace.Files {
field := fmt.Sprintf("%s.files[%d]", prefix, i)
if !validDistributionLogicalKey(item.Key) || !directories[item.DirectoryKey] || item.Label == "" || !oneOf(item.Kind, "config", "log") || (item.Kind == "log" && item.StreamKey == "") {
if !validDistributionLogicalKey(item.Key) || !directories[item.DirectoryKey] || item.Label == "" || !oneOf(item.Kind, "config", "log") || (item.Kind == "log" && item.StreamKey == "") || (item.TargetKey != "" && len(validateSafeRelativeRuntimePath(field+".targetKey", item.TargetKey)) > 0) {
violations = append(violations, field+" is invalid")
}
if _, exists := files[item.Key]; exists {