Reject a folder using the reference prefix, and filter bindings only where they exist

This commit is contained in:
Mikael Göransson
2026-08-28 00:08:58 +02:00
committed by lilleman-tw
parent 095a7f2de5
commit 2d8fcae4f4
2 changed files with 14 additions and 2 deletions
+3
View File
@@ -55,6 +55,9 @@ func loadDir(dir string) (*group, error) {
for _, e := range entries {
full := filepath.Join(dir, e.Name())
if e.IsDir() {
if isRef(e.Name()) {
return nil, fmt.Errorf("%s: folder %q starts with %q, which is reserved for {..path} bindings", full, e.Name(), refPrefix)
}
child, err := loadDir(full)
if err != nil {
return nil, err