From 3903642aa7cf711cb20f27958e7ee5b15fe2bbb3 Mon Sep 17 00:00:00 2001 From: Mohammed Al Sahaf Date: Fri, 9 Apr 2021 18:06:25 +0000 Subject: 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 --- caddyconfig/caddyfile/testdata/import_recursive0.txt | 1 + caddyconfig/caddyfile/testdata/import_recursive1.txt | 1 + caddyconfig/caddyfile/testdata/import_recursive2.txt | 1 + caddyconfig/caddyfile/testdata/import_recursive3.txt | 1 + 4 files changed, 4 insertions(+) create mode 100644 caddyconfig/caddyfile/testdata/import_recursive0.txt create mode 100644 caddyconfig/caddyfile/testdata/import_recursive1.txt create mode 100644 caddyconfig/caddyfile/testdata/import_recursive2.txt create mode 100644 caddyconfig/caddyfile/testdata/import_recursive3.txt (limited to 'caddyconfig/caddyfile/testdata') diff --git a/caddyconfig/caddyfile/testdata/import_recursive0.txt b/caddyconfig/caddyfile/testdata/import_recursive0.txt new file mode 100644 index 0000000..4d827b3 --- /dev/null +++ b/caddyconfig/caddyfile/testdata/import_recursive0.txt @@ -0,0 +1 @@ +import import_recursive0.txt \ No newline at end of file diff --git a/caddyconfig/caddyfile/testdata/import_recursive1.txt b/caddyconfig/caddyfile/testdata/import_recursive1.txt new file mode 100644 index 0000000..9b6102e --- /dev/null +++ b/caddyconfig/caddyfile/testdata/import_recursive1.txt @@ -0,0 +1 @@ +import import_recursive2.txt \ No newline at end of file diff --git a/caddyconfig/caddyfile/testdata/import_recursive2.txt b/caddyconfig/caddyfile/testdata/import_recursive2.txt new file mode 100644 index 0000000..5553dea --- /dev/null +++ b/caddyconfig/caddyfile/testdata/import_recursive2.txt @@ -0,0 +1 @@ +import import_recursive3.txt \ No newline at end of file diff --git a/caddyconfig/caddyfile/testdata/import_recursive3.txt b/caddyconfig/caddyfile/testdata/import_recursive3.txt new file mode 100644 index 0000000..fcf0237 --- /dev/null +++ b/caddyconfig/caddyfile/testdata/import_recursive3.txt @@ -0,0 +1 @@ +import import_recursive1.txt \ No newline at end of file -- cgit v1.2.3