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. +``` 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 5d9498e13e..702be8fbc8 100644 --- a/tunnel.go +++ b/tunnel.go @@ -106,9 +106,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 ced320c74c..cacc12fb60 100644 --- a/tunnel_test.go +++ b/tunnel_test.go @@ -198,6 +198,9 @@ func TestUpdateTunnelConfiguration(t *testing.T) { { Hostname: "test.example.com", Service: "https://localhost:8000", + OriginRequest: &OriginRequestConfig{ + NoTLSVerify: BoolPtr(true), + }, }, { Service: "http_status:404", @@ -218,6 +221,9 @@ func TestUpdateTunnelConfiguration(t *testing.T) { { Hostname: "test.example.com", Service: "https://localhost:8000", + OriginRequest: &OriginRequestConfig{ + NoTLSVerify: BoolPtr(true), + }, }, { Service: "http_status:404", @@ -257,6 +263,9 @@ func TestGetTunnelConfiguration(t *testing.T) { { Hostname: "test.example.com", Service: "https://localhost:8000", + OriginRequest: &OriginRequestConfig{ + NoTLSVerify: BoolPtr(true), + }, }, { Service: "http_status:404",