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

xds: Update xDS protos #9223

Merged
merged 1 commit into from May 27, 2022
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.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
2 changes: 1 addition & 1 deletion xds/third_party/envoy/LICENSE
Expand Up @@ -187,7 +187,7 @@
same "printed page" as the copyright notice for easier
identification within third-party archives.

Copyright [yyyy] [name of copyright owner].
Copyright [yyyy] [name of copyright owner]

Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
Expand Down
5 changes: 3 additions & 2 deletions xds/third_party/envoy/import.sh
Expand Up @@ -17,8 +17,8 @@

set -e
BRANCH=main
# import VERSION from one of the google internal CLs
VERSION=5d74719102f461bc57e85acdda706e0a8df9b12d
# import VERSION from the google internal copybara_version.txt for Envoy
VERSION=2f99e0c9f83b6c91b42d215a148ed49ce0f174fd
GIT_REPO="https://github.com/envoyproxy/envoy.git"
GIT_BASE_DIR=envoy
SOURCE_PROTO_BASE_DIR=envoy/api
Expand Down Expand Up @@ -129,6 +129,7 @@ envoy/extensions/filters/http/fault/v3/fault.proto
envoy/extensions/filters/http/rbac/v3/rbac.proto
envoy/extensions/filters/http/router/v3/router.proto
envoy/extensions/filters/network/http_connection_manager/v3/http_connection_manager.proto
envoy/extensions/load_balancing_policies/least_request/v3/least_request.proto
envoy/extensions/load_balancing_policies/ring_hash/v3/ring_hash.proto
envoy/extensions/load_balancing_policies/round_robin/v3/round_robin.proto
envoy/extensions/load_balancing_policies/wrr_locality/v3/wrr_locality.proto
Expand Down
Expand Up @@ -110,7 +110,7 @@ message ComparisonFilter {
Op op = 1 [(validate.rules).enum = {defined_only: true}];

// Value to compare against.
core.v3.RuntimeUInt32 value = 2;
core.v3.RuntimeUInt32 value = 2 [(validate.rules).message = {required: true}];
}

// Filters on HTTP response/status code.
Expand Down
Expand Up @@ -131,7 +131,9 @@ message Cluster {
// IPv4 family and fallback to a lookup for addresses in the IPv6 family. i.e., the callback
// target will only get v6 addresses if there were NO v4 addresses to return.
// If ALL is specified, the DNS resolver will perform a lookup for both IPv4 and IPv6 families,
// and return all resolved addresses.
// and return all resolved addresses. When this is used, Happy Eyeballs will be enabled for
// upstream connections. Refer to :ref:`Happy Eyeballs Support <arch_overview_happy_eyeballs>`
// for more information.
// For cluster types other than
// :ref:`STRICT_DNS<envoy_v3_api_enum_value_config.cluster.v3.Cluster.DiscoveryType.STRICT_DNS>` and
// :ref:`LOGICAL_DNS<envoy_v3_api_enum_value_config.cluster.v3.Cluster.DiscoveryType.LOGICAL_DNS>`,
Expand Down
Expand Up @@ -336,7 +336,9 @@ message KeepaliveSettings {
google.protobuf.Duration interval = 1 [(validate.rules).duration = {gte {nanos: 1000000}}];

// How long to wait for a response to a keepalive PING. If a response is not received within this
// time period, the connection will be aborted.
// time period, the connection will be aborted. Note that in order to prevent the influence of
// Head-of-line (HOL) blocking the timeout period is extended when *any* frame is received on
// the connection, under the assumption that if a frame is received the connection is healthy.
google.protobuf.Duration timeout = 2 [(validate.rules).duration = {
required: true
gte {nanos: 1000000}
Expand Down
Expand Up @@ -16,6 +16,26 @@ option (udpa.annotations.file_status).package_version_status = ACTIVE;

// Generic socket option message. This would be used to set socket options that
// might not exist in upstream kernels or precompiled Envoy binaries.
//
// For example:
//
// .. code-block:: json
//
// {
// "description": "support tcp keep alive",
// "state": 0,
// "level": 1,
// "name": 9,
// "int_value": 1,
// }
//
// 1 means SOL_SOCKET and 9 means SO_KEEPALIVE on Linux.
// With the above configuration, `TCP Keep-Alives <https://www.freesoft.org/CIE/RFC/1122/114.htm>`_
// can be enabled in socket with Linux, which can be used in
// :ref:`listener's<envoy_v3_api_field_config.listener.v3.Listener.socket_options>` or
// :ref:`admin's <envoy_v3_api_field_config.bootstrap.v3.Admin.socket_options>` socket_options etc.
//
// It should be noted that the name or level may have different values on different platforms.
// [#next-free-field: 7]
message SocketOption {
option (udpa.annotations.versioning).previous_message_type = "envoy.api.v2.core.SocketOption";
Expand Down
Expand Up @@ -106,7 +106,8 @@ message SubstitutionFormatString {
//
// content_type: "text/html; charset=UTF-8"
//
string content_type = 4;
string content_type = 4
[(validate.rules).string = {well_known_regex: HTTP_HEADER_VALUE strict: false}];

// Specifies a collection of Formatter plugins that can be called from the access log configuration.
// See the formatters extensions documentation for details.
Expand Down
Expand Up @@ -122,9 +122,8 @@ message LedsClusterLocalityConfig {
}

// A group of endpoints belonging to a Locality.
// One can have multiple LocalityLbEndpoints for a locality, but this is
// generally only done if the different groups need to have different load
// balancing weights or different priorities.
// One can have multiple LocalityLbEndpoints for a locality, but only if
// they have different priorities.
// [#next-free-field: 9]
message LocalityLbEndpoints {
option (udpa.annotations.versioning).previous_message_type =
Expand Down
Expand Up @@ -13,7 +13,9 @@ import "envoy/config/listener/v3/udp_listener_config.proto";
import "google/protobuf/duration.proto";
import "google/protobuf/wrappers.proto";

import "xds/annotations/v3/status.proto";
import "xds/core/v3/collection_entry.proto";
import "xds/type/matcher/v3/matcher.proto";

import "envoy/annotations/deprecation.proto";
import "udpa/annotations/security.proto";
Expand All @@ -36,7 +38,7 @@ message ListenerCollection {
repeated xds.core.v3.CollectionEntry entries = 1;
}

// [#next-free-field: 32]
// [#next-free-field: 33]
message Listener {
option (udpa.annotations.versioning).previous_message_type = "envoy.api.v2.Listener";

Expand Down Expand Up @@ -104,7 +106,8 @@ message Listener {
// The address that the listener should listen on. In general, the address must be unique, though
// that is governed by the bind rules of the OS. E.g., multiple listeners can listen on port 0 on
// Linux as the actual port will be allocated by the OS.
core.v3.Address address = 2 [(validate.rules).message = {required: true}];
// Required unless *api_listener* or *listener_specifier* is populated.
core.v3.Address address = 2;

// Optional prefix to use on listener stats. If empty, the stats will be rooted at
// `listener.<address as string>.`. If non-empty, stats will be rooted at
Expand All @@ -120,6 +123,25 @@ message Listener {
// :ref:`FAQ entry <faq_how_to_setup_sni>`.
repeated FilterChain filter_chains = 3;

// :ref:`Matcher API <arch_overview_matching_listener>` resolving the filter chain name from the
// network properties. This matcher is used as a replacement for the filter chain match condition
// :ref:`filter_chain_match
// <envoy_v3_api_field_config.listener.v3.FilterChain.filter_chain_match>`. If specified, all
// :ref:`filter_chains <envoy_v3_api_field_config.listener.v3.Listener.filter_chains>` must have a
// non-empty and unique :ref:`name <envoy_v3_api_field_config.listener.v3.FilterChain.name>` field
// and not specify :ref:`filter_chain_match
// <envoy_v3_api_field_config.listener.v3.FilterChain.filter_chain_match>` field.
//
// .. note::
//
// Once matched, each connection is permanently bound to its filter chain.
// If the matcher changes but the filter chain remains the same, the
// connections bound to the filter chain are not drained. If, however, the
// filter chain is removed or structurally modified, then the drain for its
// connections is initiated.
xds.type.matcher.v3.Matcher filter_chain_matcher = 32
[(xds.annotations.v3.field_status).work_in_progress = true];

// If a connection is redirected using *iptables*, the port on which the proxy
// receives it might be different from the original destination address. When this flag is set to
// true, the listener hands off redirected connections to the listener associated with the
Expand Down
Expand Up @@ -11,6 +11,8 @@ import "google/protobuf/any.proto";
import "google/protobuf/duration.proto";
import "google/protobuf/wrappers.proto";

import "xds/annotations/v3/status.proto";

import "envoy/annotations/deprecation.proto";
import "udpa/annotations/status.proto";
import "udpa/annotations/versioning.proto";
Expand Down Expand Up @@ -258,10 +260,11 @@ message FilterChain {
// establishment, the connection is summarily closed.
google.protobuf.Duration transport_socket_connect_timeout = 9;

// [#not-implemented-hide:] The unique name (or empty) by which this filter chain is known. If no
// name is provided, Envoy will allocate an internal UUID for the filter chain. If the filter
// chain is to be dynamically updated or removed via FCDS a unique name must be provided.
string name = 7;
// The unique name (or empty) by which this filter chain is known.
// Note: :ref:`filter_chain_matcher
// <envoy_v3_api_field_config.listener.v3.Listener.filter_chain_matcher>`
// requires that filter chains are uniquely named within a listener.
string name = 7 [(xds.annotations.v3.field_status).work_in_progress = true];

// [#not-implemented-hide:] The configuration to specify whether the filter chain will be built on-demand.
// If this field is not empty, the filter chain will be built on-demand.
Expand Down
Expand Up @@ -4,7 +4,6 @@ package envoy.config.route.v3;

import "envoy/config/core/v3/base.proto";
import "envoy/config/core/v3/config_source.proto";
import "envoy/config/core/v3/extension.proto";
import "envoy/config/route/v3/route_components.proto";

import "google/protobuf/wrappers.proto";
Expand All @@ -23,7 +22,7 @@ option (udpa.annotations.file_status).package_version_status = ACTIVE;
// * Routing :ref:`architecture overview <arch_overview_http_routing>`
// * HTTP :ref:`router filter <config_http_filters_router>`

// [#next-free-field: 14]
// [#next-free-field: 15]
message RouteConfiguration {
option (udpa.annotations.versioning).previous_message_type = "envoy.api.v2.RouteConfiguration";

Expand Down Expand Up @@ -122,28 +121,20 @@ message RouteConfiguration {
//
google.protobuf.UInt32Value max_direct_response_body_size_bytes = 11;

// [#not-implemented-hide:]
// A list of plugins and their configurations which may be used by a
// :ref:`envoy_v3_api_field_config.route.v3.RouteAction.cluster_specifier_plugin`
// :ref:`cluster specifier plugin name <envoy_v3_api_field_config.route.v3.RouteAction.cluster_specifier_plugin>`
// within the route. All *extension.name* fields in this list must be unique.
repeated ClusterSpecifierPlugin cluster_specifier_plugins = 12;

// Specify a set of default request mirroring policies which apply to all routes under its virtual hosts.
// Note that policies are not merged, the most specific non-empty one becomes the mirror policies.
repeated RouteAction.RequestMirrorPolicy request_mirror_policies = 13;
}

// Configuration for a cluster specifier plugin.
message ClusterSpecifierPlugin {
// The name of the plugin and its opaque configuration.
core.v3.TypedExtensionConfig extension = 1;

// If is_optional is not set and the plugin defined by this message is not
// a supported type, the containing resource is NACKed. If is_optional is
// set, the resource would not be NACKed for this reason. In this case,
// routes referencing this plugin's name would not be treated as an illegal
// configuration, but would result in a failure if the route is selected.
bool is_optional = 2;
// By default, port in :authority header (if any) is used in host matching.
// With this option enabled, Envoy will ignore the port number in the :authority header (if any) when picking VirtualHost.
// NOTE: this option will not strip the port number (if any) contained in route config
// :ref:`envoy_v3_api_msg_config.route.v3.VirtualHost`.domains field.
bool ignore_port_in_host_matching = 14;
}

message Vhds {
Expand Down
Expand Up @@ -453,6 +453,19 @@ message WeightedCluster {
}
}

// Configuration for a cluster specifier plugin.
message ClusterSpecifierPlugin {
// The name of the plugin and its opaque configuration.
core.v3.TypedExtensionConfig extension = 1 [(validate.rules).message = {required: true}];

// If is_optional is not set or is set to false and the plugin defined by this message is not a
// supported type, the containing resource is NACKed. If is_optional is set to true, the resource
// would not be NACKed for this reason. In this case, routes referencing this plugin's name would
// not be treated as an illegal configuration, but would result in a failure if the route is
// selected.
bool is_optional = 2;
}

// [#next-free-field: 15]
message RouteMatch {
option (udpa.annotations.versioning).previous_message_type = "envoy.api.v2.route.RouteMatch";
Expand Down Expand Up @@ -643,7 +656,7 @@ message CorsPolicy {
core.v3.RuntimeFractionalPercent shadow_enabled = 10;
}

// [#next-free-field: 39]
// [#next-free-field: 40]
message RouteAction {
option (udpa.annotations.versioning).previous_message_type = "envoy.api.v2.route.RouteAction";

Expand Down Expand Up @@ -675,6 +688,7 @@ message RouteAction {
// .. note::
//
// Shadowing will not be triggered if the primary cluster does not exist.
// [#next-free-field: 6]
message RequestMirrorPolicy {
option (udpa.annotations.versioning).previous_message_type =
"envoy.api.v2.route.RouteAction.RequestMirrorPolicy";
Expand All @@ -683,9 +697,30 @@ message RouteAction {

reserved "runtime_key";

// Only one of *cluster* and *cluster_header* can be specified.
// [#next-major-version: Need to add back the validation rule: (validate.rules).string = {min_len: 1}]
// Specifies the cluster that requests will be mirrored to. The cluster must
// exist in the cluster manager configuration.
string cluster = 1 [(validate.rules).string = {min_len: 1}];
string cluster = 1 [(udpa.annotations.field_migrate).oneof_promotion = "cluster_specifier"];

// Only one of *cluster* and *cluster_header* can be specified.
// Envoy will determine the cluster to route to by reading the value of the
// HTTP header named by cluster_header from the request headers. Only the first value in header is used,
// and no shadow request will happen if the value is not found in headers. Envoy will not wait for
// the shadow cluster to respond before returning the response from the primary cluster.
//
// .. attention::
//
// Internally, Envoy always uses the HTTP/2 *:authority* header to represent the HTTP/1
// *Host* header. Thus, if attempting to match on *Host*, match on *:authority* instead.
//
// .. note::
//
// If the header appears multiple times only the first value is used.
string cluster_header = 5 [
(validate.rules).string = {well_known_regex: HTTP_HEADER_NAME strict: false},
(udpa.annotations.field_migrate).oneof_promotion = "cluster_specifier"
];

// If not specified, all requests to the target cluster will be mirrored.
//
Expand Down Expand Up @@ -920,13 +955,15 @@ message RouteAction {
// for additional documentation.
WeightedCluster weighted_clusters = 3;

// [#not-implemented-hide:]
// Name of the cluster specifier plugin to use to determine the cluster for
// requests on this route. The plugin name must be defined in the associated
// :ref:`envoy_v3_api_field_config.route.v3.RouteConfiguration.cluster_specifier_plugins`
// in the
// :ref:`envoy_v3_api_field_config.core.v3.TypedExtensionConfig.name` field.
// Name of the cluster specifier plugin to use to determine the cluster for requests on this route.
// The cluster specifier plugin name must be defined in the associated
// :ref:`cluster specifier plugins <envoy_v3_api_field_config.route.v3.RouteConfiguration.cluster_specifier_plugins>`
// in the :ref:`name <envoy_v3_api_field_config.core.v3.TypedExtensionConfig.name>` field.
string cluster_specifier_plugin = 37;

// Custom cluster specifier plugin configuration to use to determine the cluster for requests
// on this route.
ClusterSpecifierPlugin inline_cluster_specifier_plugin = 39;
}

// The HTTP status code to use when configured cluster is not found.
Expand Down Expand Up @@ -1711,7 +1748,7 @@ message VirtualCluster {
message RateLimit {
option (udpa.annotations.versioning).previous_message_type = "envoy.api.v2.route.RateLimit";

// [#next-free-field: 10]
// [#next-free-field: 11]
message Action {
option (udpa.annotations.versioning).previous_message_type =
"envoy.api.v2.route.RateLimit.Action";
Expand Down Expand Up @@ -1785,6 +1822,28 @@ message RateLimit {
"envoy.api.v2.route.RateLimit.Action.RemoteAddress";
}

// The following descriptor entry is appended to the descriptor and is populated using the
// masked address from :ref:`x-forwarded-for <config_http_conn_man_headers_x-forwarded-for>`:
//
// .. code-block:: cpp
//
// ("masked_remote_address", "<masked address from x-forwarded-for>")
message MaskedRemoteAddress {
// Length of prefix mask len for IPv4 (e.g. 0, 32).
// Defaults to 32 when unset.
// For example, trusted address from x-forwarded-for is `192.168.1.1`,
// the descriptor entry is ("masked_remote_address", "192.168.1.1/32");
// if mask len is 24, the descriptor entry is ("masked_remote_address", "192.168.1.0/24").
google.protobuf.UInt32Value v4_prefix_mask_len = 1 [(validate.rules).uint32 = {lte: 32}];

// Length of prefix mask len for IPv6 (e.g. 0, 128).
// Defaults to 128 when unset.
// For example, trusted address from x-forwarded-for is `2001:abcd:ef01:2345:6789:abcd:ef01:234`,
// the descriptor entry is ("masked_remote_address", "2001:abcd:ef01:2345:6789:abcd:ef01:234/128");
// if mask len is 64, the descriptor entry is ("masked_remote_address", "2001:abcd:ef01:2345::/64").
google.protobuf.UInt32Value v6_prefix_mask_len = 2 [(validate.rules).uint32 = {lte: 128}];
}

// The following descriptor entry is appended to the descriptor:
//
// .. code-block:: cpp
Expand Down Expand Up @@ -1917,8 +1976,17 @@ message RateLimit {
MetaData metadata = 8;

// Rate limit descriptor extension. See the rate limit descriptor extensions documentation.
//
// :ref:`HTTP matching input functions <arch_overview_matching_api>` are
// permitted as descriptor extensions. The input functions are only
// looked up if there is no rate limit descriptor extension matching
// the type URL.
//
// [#extension-category: envoy.rate_limit_descriptors]
core.v3.TypedExtensionConfig extension = 9;

// Rate limit on masked remote address.
MaskedRemoteAddress masked_remote_address = 10;
}
}

Expand Down