caddyfile: reject cyclic imports (#4022)

* caddyfile: reject recursive self-imports

* caddyfile: detect and reject cyclic imports of snippets and files

* caddyfile: do not be stickler about connected nodes not being connected already

* caddyfile: include missing test artifacts of cyclic imports

* address review comments
This commit is contained in:
Mohammed Al Sahaf 2021-04-09 18:06:25 +00:00 committed by GitHub
parent 03b5debd95
commit 3903642aa7
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
8 changed files with 193 additions and 5 deletions

View file

@ -35,9 +35,11 @@ type (
// Token represents a single parsable unit.
Token struct {
File string
Line int
Text string
File string
Line int
Text string
inSnippet bool
snippetName string
}
)