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 7 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

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
10 changes: 10 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,11 @@ spec:
nullable: true
type: integer
type: object
headerValidationSettings:
properties:
allowCustomHeaderMethods:
type: boolean
type: object
healthCheck:
properties:
path:
Expand Down Expand Up @@ -2737,6 +2742,11 @@ spec:
nullable: true
type: integer
type: object
headerValidationSettings:
properties:
allowCustomHeaderMethods:
type: boolean
type: object
healthCheck:
properties:
path:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -809,6 +809,11 @@ spec:
nullable: true
type: integer
type: object
headerValidationSettings:
properties:
allowCustomHeaderMethods:
type: boolean
type: object
healthCheck:
properties:
path:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -812,6 +812,11 @@ spec:
nullable: true
type: integer
type: object
headerValidationSettings:
properties:
allowCustomHeaderMethods:
type: boolean
type: object
healthCheck:
properties:
path:
Expand Down
5 changes: 5 additions & 0 deletions install/helm/gloo/crds/gateway.solo.io_v1_RouteOption.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -386,6 +386,11 @@ spec:
type: string
type: array
type: object
headerValidationSettings:
properties:
allowCustomHeaderMethods:
type: boolean
type: object
hostRewrite:
type: string
hostRewriteHeader:
Expand Down
5 changes: 5 additions & 0 deletions install/helm/gloo/crds/gateway.solo.io_v1_RouteTable.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -496,6 +496,11 @@ spec:
type: string
type: array
type: object
headerValidationSettings:
properties:
allowCustomHeaderMethods:
type: boolean
type: object
hostRewrite:
type: string
hostRewriteHeader:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -356,6 +356,11 @@ spec:
type: string
type: array
type: object
headerValidationSettings:
properties:
allowCustomHeaderMethods:
type: boolean
type: object
includeAttemptCountInResponse:
nullable: true
type: boolean
Expand Down
10 changes: 10 additions & 0 deletions install/helm/gloo/crds/gateway.solo.io_v1_VirtualService.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -446,6 +446,11 @@ spec:
type: string
type: array
type: object
headerValidationSettings:
properties:
allowCustomHeaderMethods:
type: boolean
type: object
includeAttemptCountInResponse:
nullable: true
type: boolean
Expand Down Expand Up @@ -3329,6 +3334,11 @@ spec:
type: string
type: array
type: object
headerValidationSettings:
properties:
allowCustomHeaderMethods:
type: boolean
type: object
hostRewrite:
type: string
hostRewriteHeader:
Expand Down
21 changes: 21 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,12 @@ message HttpListenerOptions {

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

// Whether custom HTTP methods should be allowed. Defaults to false (custom
ashishb-solo marked this conversation as resolved.
Show resolved Hide resolved
// HTTP methods are not allowed). The list of default-allowed HTTP methods
// can be found here:
// https://github.com/envoyproxy/envoy/blob/2970ddbd4ade787dd51dfbe605ae2e8c5d8ffcf7/source/common/http/http1/balsa_parser.cc#L54
header_validation.options.gloo.solo.io.HeaderValidationSettings header_validation_settings = 36;
}

// Optional, feature-specific configuration that lives on tcp listeners
Expand Down Expand Up @@ -373,6 +380,12 @@ message VirtualHostOptions {
// Enterprise-only: External Processing filter settings for the virtual host. This can be used to
// override certain HttpListenerOptions settings, and can be overridden by RouteOptions settings.
extproc.options.gloo.solo.io.RouteSettings ext_proc = 30;

// Whether custom HTTP methods should be allowed. Defaults to false (custom
// HTTP methods are not allowed). The list of default-allowed HTTP methods
// can be found here:
// https://github.com/envoyproxy/envoy/blob/2970ddbd4ade787dd51dfbe605ae2e8c5d8ffcf7/source/common/http/http1/balsa_parser.cc#L54
header_validation.options.gloo.solo.io.HeaderValidationSettings header_validation_settings = 31;
}

// Optional, feature-specific configuration that lives on routes.
Expand Down Expand Up @@ -577,7 +590,15 @@ message RouteOptions {
// Enterprise-only: External Processing filter settings for the route. This can be used to
// override certain HttpListenerOptions or VirtualHostOptions settings.
extproc.options.gloo.solo.io.RouteSettings ext_proc = 30;

// Header Validation Settings. These can be used to configure Gloo with
// rules to customize whether requests should be accepted or rejected,
// based on the contents of the HTTP header.
// TODO: include some kind of warning that the behavior of these fields may
// change when we update Envoy to a new version.
header_validation.options.gloo.solo.io.HeaderValidationSettings header_validation_settings = 31;
}

// 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,32 @@
syntax = "proto3";
package header_validation.options.gloo.solo.io;

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

message HeaderValidationSettings {
// Whether custom HTTP methods should be allowed. Defaults to false (custom
// HTTP methods are not allowed). The list of default-allowed HTTP methods
// can be found here:
// https://github.com/envoyproxy/envoy/blob/2970ddbd4ade787dd51dfbe605ae2e8c5d8ffcf7/source/common/http/http1/balsa_parser.cc#L54
// **BREAKING API COMPATIBILITY WARNING**:
nfuden marked this conversation as resolved.
Show resolved Hide resolved
// Note that right now, this field only changes whether custom header methods are allowed on HTTP/1 connections only.
ashishb-solo marked this conversation as resolved.
Show resolved Hide resolved
// In a future release of Gloo, this option will change to allow custom
// HTTP methods not just on HTTP/1, but also on all other HTTP protocols as
// well.

// As of right now, this field is only supported on HTTP/1 connections.
// When Universal Header Validation is enabled in Envoy, this field will
// apply to all HTTP protocols.
// TODO: let's think a bit more carefully about how we want to design this
// for future-proofing purposes. I think we may want to consider having an
// oneof here instead that could be something like (allow default
// methods/allow all methods/custom allow-list).
ashishb-solo marked this conversation as resolved.
Show resolved Hide resolved
// we may also want to model our API similarly to upstream Envoy's UHV API
// WARNING: these options should not be considered stable, and this API is
// subject to change in the future.
// question: alternately, we could enable this as an HTTP/1-only option,
// mark it as deprecated, and then when UHV is enabled, we could remove the
// deprecated option and introduce a new option for all HTTP protocols.
bool allow_custom_header_methods = 1;
ashishb-solo marked this conversation as resolved.
Show resolved Hide resolved
}

Loading
Loading