Document and validate configured secrets bootstrap
This commit is contained in:
@@ -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
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user