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

5579 extended http methods #9633

Merged
merged 37 commits into from
Jun 25, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
37 commits
Select commit Hold shift + click to select a range
1af810c
Check-in before codegen
ashishb-solo Jun 4, 2024
3c71fa2
Initial commit
ashishb-solo Jun 5, 2024
1a72c4a
Get the implementation working
ashishb-solo Jun 6, 2024
b6276ff
Add plugin README
ashishb-solo Jun 6, 2024
1f76a43
Move configuration to a new plugin
ashishb-solo Jun 17, 2024
9dbf53a
Merge branch 'master' into 5579-extended-http-methods
ashishb-solo Jun 17, 2024
92b80bd
Codegen/formatting updates
ashishb-solo Jun 17, 2024
409ff11
Add makefile documentation on building docker images
ashishb-solo Jun 17, 2024
2025d2b
Update projects/gloo/api/v1/options/header_validation/header_validati…
ashishb-solo Jun 17, 2024
d66a9ce
Address some review comments
ashishb-solo Jun 20, 2024
9c94b4f
Merge branch '5579-extended-http-methods' of github.com:solo-io/gloo …
ashishb-solo Jun 20, 2024
ba0aff3
Only allow header validation on gateway
ashishb-solo Jun 20, 2024
956e2ef
Update documentation
ashishb-solo Jun 20, 2024
4cf28f6
Update protobuf API to use a oneof
ashishb-solo Jun 20, 2024
be9df12
Add unit test
ashishb-solo Jun 20, 2024
d862343
Add changelog
ashishb-solo Jun 20, 2024
527d08b
Merge branch 'master' into 5579-extended-http-methods
ashishb-solo Jun 20, 2024
2bf9e75
Fix a compilation error
ashishb-solo Jun 20, 2024
28f0fe5
Add http/2 test
ashishb-solo Jun 20, 2024
e1327f5
Revert "Add http/2 test"
ashishb-solo Jun 20, 2024
15b26cb
Re-run codegen
ashishb-solo Jun 20, 2024
25c9b34
Move changelog
ashishb-solo Jun 20, 2024
b420eb8
Update e2e test documentation
ashishb-solo Jun 20, 2024
871f7b2
Update API and documentation
ashishb-solo Jun 20, 2024
42b5c72
Rename API to disable_method_validation
ashishb-solo Jun 21, 2024
00c2faa
Rename custom_methods `oneof`
ashishb-solo Jun 21, 2024
dd7331b
Change disableMethodValidation to disableHttp1MethodValidation
ashishb-solo Jun 21, 2024
eb239d7
Update a renamed proto variable
ashishb-solo Jun 21, 2024
e69f029
Update e2e test to use new framework
ashishb-solo Jun 25, 2024
c91ce09
Fix some ginkgo methods
ashishb-solo Jun 25, 2024
c7fe0aa
Remove duplicated test
ashishb-solo Jun 25, 2024
6c19ce0
Update projects/gloo/api/v1/options/header_validation/header_validati…
ashishb-solo Jun 25, 2024
072a229
Add negative test to plugin unit test
ashishb-solo Jun 25, 2024
aa42f8a
Merge branch '5579-extended-http-methods' of github.com:solo-io/gloo …
ashishb-solo Jun 25, 2024
b918316
Add an additional test
ashishb-solo Jun 25, 2024
576323e
Re-run codegen
ashishb-solo Jun 25, 2024
257e0ac
Merge branch 'main' into 5579-extended-http-methods
nfuden Jun 25, 2024
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
12 changes: 9 additions & 3 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,12 @@ VERSION ?= 1.0.1-dev

SOURCES := $(shell find . -name "*.go" | grep -v test.go)

# ATTENTION: when updating to a new major version of Envoy, check if
# universal header validation has been enabled and if so, we expect
# failures in `test/e2e/header_validation_test.go`
# for more information, see https://github.com/solo-io/gloo/pull/9633
# and
# https://soloio.slab.com/posts/extended-http-methods-design-doc-40j7pjeu
ENVOY_GLOO_IMAGE ?= quay.io/solo-io/envoy-gloo:1.30.2-patch2
LDFLAGS := "-X github.com/solo-io/gloo/pkg/version.Version=$(VERSION)"
GCFLAGS ?=
Expand Down Expand Up @@ -932,7 +938,7 @@ docker-push-%:
docker push $(IMAGE_REGISTRY)/$*:$(VERSION)

.PHONY: docker-standard
docker-standard: check-go-version
docker-standard: check-go-version ## Build docker images (standard only)
docker-standard: gloo-docker
docker-standard: discovery-docker
docker-standard: gloo-envoy-wrapper-docker
Expand All @@ -943,7 +949,7 @@ docker-standard: access-logger-docker
docker-standard: kubectl-docker

.PHONY: docker-distroless
docker-distroless: check-go-version
docker-distroless: check-go-version ## Build docker images (distroless only)
docker-distroless: gloo-distroless-docker
docker-distroless: discovery-distroless-docker
docker-distroless: gloo-envoy-wrapper-distroless-docker
Expand All @@ -956,7 +962,7 @@ docker-distroless: kubectl-distroless-docker
IMAGE_VARIANT ?= all
# Build docker images using the defined IMAGE_REGISTRY, VERSION
.PHONY: docker
docker: check-go-version
docker: check-go-version ## Build all docker images (standard and distroless)
docker: # Standard images
ifeq ($(IMAGE_VARIANT),$(filter $(IMAGE_VARIANT),all standard))
docker: docker-standard
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
changelog:
- type: NEW_FEATURE
issueLink: https://github.com/solo-io/gloo/issues/5579
resolvesIssue: true
description: >-
Enable Envoy to accept requests with extended HTTP methods (such as `LABEL`
or `UPDATE`). Previously, requests with these methods would return an HTTP
400 response. Currently, this functionality is supported for HTTP/1 only.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

3 changes: 3 additions & 0 deletions docs/data/ProtoMap.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -1208,6 +1208,9 @@ apis:
hcm.options.gloo.solo.io.HttpConnectionManagerSettings:
relativepath: reference/api/github.com/solo-io/gloo/projects/gloo/api/v1/options/hcm/hcm.proto.sk/#HttpConnectionManagerSettings
package: hcm.options.gloo.solo.io
header_validation.options.gloo.solo.io.HeaderValidationSettings:
relativepath: reference/api/github.com/solo-io/gloo/projects/gloo/api/v1/options/header_validation/header_validation.proto.sk/#HeaderValidationSettings
package: header_validation.options.gloo.solo.io
headers.options.gloo.solo.io.HeaderManipulation:
relativepath: reference/api/github.com/solo-io/gloo/projects/gloo/api/v1/options/headers/headers.proto.sk/#HeaderManipulation
package: headers.options.gloo.solo.io
Expand Down
12 changes: 12 additions & 0 deletions install/helm/gloo/crds/gateway.solo.io_v1_Gateway.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -818,6 +818,12 @@ spec:
nullable: true
type: integer
type: object
headerValidationSettings:
properties:
disableHttp1MethodValidation:
maxProperties: 0
type: object
type: object
healthCheck:
properties:
path:
Expand Down Expand Up @@ -2737,6 +2743,12 @@ spec:
nullable: true
type: integer
type: object
headerValidationSettings:
properties:
disableHttp1MethodValidation:
maxProperties: 0
type: object
type: object
healthCheck:
properties:
path:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -809,6 +809,12 @@ spec:
nullable: true
type: integer
type: object
headerValidationSettings:
properties:
disableHttp1MethodValidation:
maxProperties: 0
type: object
type: object
healthCheck:
properties:
path:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -812,6 +812,12 @@ spec:
nullable: true
type: integer
type: object
headerValidationSettings:
properties:
disableHttp1MethodValidation:
maxProperties: 0
type: object
type: object
healthCheck:
properties:
path:
Expand Down
7 changes: 7 additions & 0 deletions projects/gloo/api/v1/options.proto
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ import "github.com/solo-io/gloo/projects/gloo/api/v1/options/proxy_protocol/prox
import "github.com/solo-io/gloo/projects/gloo/api/v1/options/grpc_web/grpc_web.proto";
import "github.com/solo-io/gloo/projects/gloo/api/v1/options/grpc_json/grpc_json.proto";
import "github.com/solo-io/gloo/projects/gloo/api/v1/options/hcm/hcm.proto";
import "github.com/solo-io/gloo/projects/gloo/api/v1/options/header_validation/header_validation.proto";
import "github.com/solo-io/gloo/projects/gloo/api/v1/options/lbhash/lbhash.proto";
import "github.com/solo-io/gloo/projects/gloo/api/v1/options/shadowing/shadowing.proto";
import "github.com/solo-io/gloo/projects/gloo/api/v1/options/tcp/tcp.proto";
Expand Down Expand Up @@ -231,6 +232,11 @@ message HttpListenerOptions {

// Enterprise only: Listener-level stateful session settings
stateful_session.options.gloo.solo.io.StatefulSession stateful_session = 35;

// Header validation settings - fields in this message can be used to
// determine whether requests should be rejected based on the contents of
// the header.
header_validation.options.gloo.solo.io.HeaderValidationSettings header_validation_settings = 36;
}

// Optional, feature-specific configuration that lives on tcp listeners
Expand Down Expand Up @@ -578,6 +584,7 @@ message RouteOptions {
// override certain HttpListenerOptions or VirtualHostOptions settings.
extproc.options.gloo.solo.io.RouteSettings ext_proc = 30;
}

// Configuration for Destinations that are tied to the UpstreamSpec or ServiceSpec on that destination
message DestinationSpec {
// Note to developers: new DestinationSpecs must be added to this oneof field
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
syntax = "proto3";
package header_validation.options.gloo.solo.io;

import "google/protobuf/empty.proto";

option go_package = "github.com/solo-io/gloo/projects/gloo/pkg/api/v1/options/header_validation";

message HeaderValidationSettings {
// How header methods will be validated. By default, Envoy will
// validate HTTP methods for HTTP/1 connections against the default set of allowed methods.
// The default allowed methods can be found here:
// https://github.com/envoyproxy/envoy/blob/2970ddbd4ade787dd51dfbe605ae2e8c5d8ffcf7/source/common/http/http1/balsa_parser.cc#L54
ashishb-solo marked this conversation as resolved.
Show resolved Hide resolved
// or here, if Universal Header Validation is enabled:
// https://github.com/envoyproxy/envoy/blob/0b9f67e7f71bcba3ff49575dc61676478cb68614/source/extensions/http/header_validators/envoy_default/header_validator.cc#L53
// Invalid methods on HTTP/1 requests will be rejected with a HTTP 400
// response.
// For HTTP/2, Envoy does not validate header methods by default.
oneof header_method_validation {
// Disable method validation. Envoy will not perform any validation on
// the method provided in the HTTP header.
google.protobuf.Empty disable_http1_method_validation = 1;
}
}

8 changes: 8 additions & 0 deletions projects/gloo/pkg/api/v1/options.pb.clone.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

10 changes: 10 additions & 0 deletions projects/gloo/pkg/api/v1/options.pb.equal.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading
Loading