Skip to content

Commit a62a875

Browse files
author
soloio-bot
committed
Sync Gloo APIs. Destination Branch: gloo-main
1 parent 0450e13 commit a62a875

File tree

12 files changed

+681
-399
lines changed

12 files changed

+681
-399
lines changed

api/gloo/gateway/v1/virtual_service.proto

+2-5
Original file line numberDiff line numberDiff line change
@@ -113,11 +113,8 @@ import "github.com/solo-io/solo-apis/api/gloo/gloo/v1/core/matchers/matchers.pro
113113
message VirtualServiceSpec {
114114

115115

116-
// The VirtualHost contains the
117-
// The list of HTTP routes define routing actions to be taken
118-
// for incoming HTTP requests whose host header matches
119-
// this virtual host. If the request matches more than one route in the list, the first route matched will be selected.
120-
// If the list of routes is empty, the virtual host will be ignored by Gloo.
116+
// The VirtualHost contains configuration for serving a list of routes for a set of domains along with options for
117+
// configuring traffic
121118
VirtualHost virtual_host = 1;
122119

123120
// If provided, the Gateway will serve TLS/SSL traffic for this set of routes

api/gloo/gloo/v1/options.proto

+7-2
Original file line numberDiff line numberDiff line change
@@ -274,7 +274,8 @@ message VirtualHostOptions {
274274
headers.options.gloo.solo.io.HeaderManipulation header_manipulation = 2;
275275
// Defines a CORS policy for the virtual host
276276
// If a CORS policy is also defined on the route matched by the request, the route policy
277-
// overrides the virtual host policy for any configured field.
277+
// overrides the virtual host policy for any configured field unless CorsMergeSettings are specified that define an
278+
// alternate behavior.
278279
cors.options.gloo.solo.io.CorsPolicy cors = 3;
279280
// Transformations to apply. Note: this field is superseded by `staged_transformations`.
280281
// If `staged_transformations.regular` is set, this field will be ignored.
@@ -384,6 +385,9 @@ message VirtualHostOptions {
384385
// Enterprise-only: External Processing filter settings for the virtual host. This can be used to
385386
// override certain HttpListenerOptions settings, and can be overridden by RouteOptions settings.
386387
extproc.options.gloo.solo.io.RouteSettings ext_proc = 30;
388+
389+
// Settings for determining merge strategy for CORS settings when present at both Route and VH level
390+
cors.options.gloo.solo.io.CorsPolicyMergeSettings cors_policy_merge_settings = 20;
387391
}
388392

389393
// Optional, feature-specific configuration that lives on routes.
@@ -441,7 +445,8 @@ message RouteOptions {
441445
// If true and there is a host rewrite, appends the x-forwarded-host header to requests.
442446
google.protobuf.BoolValue append_x_forwarded_host = 146;
443447
// Defines a CORS policy for the route
444-
// If a CORS policy is also defined on the route's virtual host any fields set here override the virtual host configuration
448+
// If a CORS policy is defined on both the route and the virtual host, the merge behavior for these policies is
449+
// determined by the CorsPolicyMergeSettings defined on the VirtualHost.
445450
cors.options.gloo.solo.io.CorsPolicy cors = 11;
446451
// For routes served by a hashing load balancer, this defines the input to the hash key
447452
// Gloo configures Envoy with the first available RouteActionHashConfig among the following ordered list of providers:

api/gloo/gloo/v1/options/cors/cors.proto

+39
Original file line numberDiff line numberDiff line change
@@ -39,4 +39,43 @@ message CorsPolicy {
3939
// Optional, only applies to route-specific CORS Policies, defaults to false.
4040
// If set, the CORS Policy (specified on the virtual host) will be disabled for this route.
4141
bool disable_for_route = 8;
42+
}
43+
44+
// Settings for determining how CORS settings are merged when present on both VirtualHost and Route
45+
// This may be useful if different teams/personas are responsible for managing VirtualService and Route resources and policies
46+
// on VirtualServices set by one team or persona should be enforced or inherited on Routes
47+
message CorsPolicyMergeSettings {
48+
enum MergeStrategy{
49+
// Follow the default Envoy behavior, which is for Route settings to override VH settings if non-nil
50+
DEFAULT = 0;
51+
// When a setting is present on both VH and Route CORS policy, merge by concatenating for list fields and by
52+
// ORing for boolean fields
53+
UNION = 1;
54+
55+
// Eventually we may want to add additional mergeStrategies
56+
57+
// When a setting is present on both VH and Route CORS policy, merge by taking only values present in both for
58+
// list fields and by ANDing for boolean fields
59+
// INTERSECTION = 2;
60+
61+
// When a setting is present on both VH and Route CORS policy, use the Route-level field
62+
// This is Envoy's underlying behavior, so effectively the same as default
63+
// ROUTE = 3;
64+
65+
// When a setting is present on both VH and Route CORS policy, use the VH-level field
66+
// VH = 4;
67+
}
68+
69+
// Eventually we may want to allow each CORS setting to be configured, so we reserve fields for them
70+
71+
// mimicking the CorsPolicy message
72+
// mergeStrategy allow_origin = 1;
73+
// mergeStrategy allow_origin_regex = 2;
74+
// mergeStrategy allow_methods = 3;
75+
// mergeStrategy allow_headers = 4;
76+
77+
MergeStrategy expose_headers = 5;
78+
79+
// mergeStrategy max_age = 6;
80+
// mergeStrategy allow_credentials = 7;
4281
}

pkg/api/gateway.solo.io/v1/virtual_service.pb.go

+2-5
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

pkg/api/gloo.solo.io/v1/options.pb.clone.go

+6
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

pkg/api/gloo.solo.io/v1/options.pb.equal.go

+10
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)