Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: adds OriginRequest field to UnvalidatedIngressRule struct. #1138

Merged
merged 3 commits into from
May 23, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions .changelog/1138.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
```release-note:enhancement
adds OriginRequest field to UnvalidatedIngressRule struct.
```
2 changes: 1 addition & 1 deletion testdata/fixtures/tunnel/configuration.json
Original file line number Diff line number Diff line change
Expand Up @@ -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" }
]
},
Expand Down
7 changes: 4 additions & 3 deletions tunnel.go
Original file line number Diff line number Diff line change
Expand Up @@ -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"`
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@jacobbednarz Should I make a new struct like IngressOriginRequestConfig since I believe ingress.originRequest is not identical to top-level originRequest?

https://developers.cloudflare.com/cloudflare-one/connections/connect-apps/install-and-setup/tunnel-guide/local/local-management/ingress/#origin-configuration

}

// OriginRequestConfig is a set of optional fields that users may set to
Expand Down
9 changes: 9 additions & 0 deletions tunnel_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand All @@ -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",
Expand Down Expand Up @@ -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",
Expand Down
Loading