From 689f51f80ec1c6bd6d9dd2603c3539df6a6476ef Mon Sep 17 00:00:00 2001 From: keita Date: Sun, 4 Dec 2022 04:23:07 +0900 Subject: [PATCH 1/2] adds OriginRequest to UnvalidatedIngressRule. Signed-off-by: keita --- testdata/fixtures/tunnel/configuration.json | 2 +- tunnel.go | 7 ++++--- tunnel_test.go | 9 +++++++++ 3 files changed, 14 insertions(+), 4 deletions(-) diff --git a/testdata/fixtures/tunnel/configuration.json b/testdata/fixtures/tunnel/configuration.json index 3267b8556f..41e642cb40 100644 --- a/testdata/fixtures/tunnel/configuration.json +++ b/testdata/fixtures/tunnel/configuration.json @@ -7,7 +7,7 @@ "warp-routing": { "enabled": true }, "originRequest": { "connectTimeout": 10 }, "ingress": [ - { "hostname": "test.example.com", "service": "https://localhost:8000" }, + { "hostname": "test.example.com", "service": "https://localhost:8000", "originRequest": { "noTLSVerify": true } }, { "service": "http_status:404" } ] }, diff --git a/tunnel.go b/tunnel.go index d933eedfc8..a2273d1598 100644 --- a/tunnel.go +++ b/tunnel.go @@ -97,9 +97,10 @@ type TunnelUpdateParams struct { } type UnvalidatedIngressRule struct { - Hostname string `json:"hostname,omitempty"` - Path string `json:"path,omitempty"` - Service string `json:"service,omitempty"` + Hostname string `json:"hostname,omitempty"` + Path string `json:"path,omitempty"` + Service string `json:"service,omitempty"` + OriginRequest *OriginRequestConfig `json:"originRequest,omitempty"` } // OriginRequestConfig is a set of optional fields that users may set to diff --git a/tunnel_test.go b/tunnel_test.go index 48f8f386c6..8cfb50fc75 100644 --- a/tunnel_test.go +++ b/tunnel_test.go @@ -141,6 +141,9 @@ func TestUpdateTunnelConfiguration(t *testing.T) { { Hostname: "test.example.com", Service: "https://localhost:8000", + OriginRequest: &OriginRequestConfig{ + NoTLSVerify: BoolPtr(true), + }, }, { Service: "http_status:404", @@ -161,6 +164,9 @@ func TestUpdateTunnelConfiguration(t *testing.T) { { Hostname: "test.example.com", Service: "https://localhost:8000", + OriginRequest: &OriginRequestConfig{ + NoTLSVerify: BoolPtr(true), + }, }, { Service: "http_status:404", @@ -200,6 +206,9 @@ func TestGetTunnelConfiguration(t *testing.T) { { Hostname: "test.example.com", Service: "https://localhost:8000", + OriginRequest: &OriginRequestConfig{ + NoTLSVerify: BoolPtr(true), + }, }, { Service: "http_status:404", From 1d20e1b5955da21a2a5a617dd258a731a72e2b0b Mon Sep 17 00:00:00 2001 From: keita Date: Sun, 4 Dec 2022 04:41:02 +0900 Subject: [PATCH 2/2] adds changelog entry. Signed-off-by: keita --- .changelog/1138.txt | 3 +++ 1 file changed, 3 insertions(+) create mode 100644 .changelog/1138.txt diff --git a/.changelog/1138.txt b/.changelog/1138.txt new file mode 100644 index 0000000000..69b22055c3 --- /dev/null +++ b/.changelog/1138.txt @@ -0,0 +1,3 @@ +```release-note:enhancement +adds OriginRequest field to UnvalidatedIngressRule struct. +```