Document and validate configured secrets bootstrap

This commit is contained in:
2026-11-18 01:10:24 +00:00
parent ab6e610fb7
commit eeafc356e4
13 changed files with 172 additions and 46 deletions

View File

@@ -1,6 +1,7 @@
package engine
import (
"os"
"path"
"path/filepath"
"strings"
@@ -66,7 +67,7 @@ func parseBootstrapField(settings *bootstrapSettings, entry document.Entry) *Dia
value := entry.Value
fieldPath := Keys(directiveKey, entry.Key)
if entry.Key == "secrets_dir" {
if value == nil || value.Kind != document.String || value.Text == "" || filepath.IsAbs(value.Text) || filepath.VolumeName(value.Text) != "" {
if value == nil || value.Kind != document.String || value.Text == "" || os.IsPathSeparator(value.Text[0]) || filepath.IsAbs(value.Text) || filepath.VolumeName(value.Text) != "" {
diagnostic := nodeImportDiagnostic(CodeSecretsInvalidPath, fieldPath, "secrets directory must be a nonempty relative host path", value)
return &diagnostic
}