diff --git a/xds/src/main/java/io/grpc/xds/ExternalProcessorClientInterceptor.java b/xds/src/main/java/io/grpc/xds/ExternalProcessorClientInterceptor.java index 2238ac5a4de..1b4a3341155 100644 --- a/xds/src/main/java/io/grpc/xds/ExternalProcessorClientInterceptor.java +++ b/xds/src/main/java/io/grpc/xds/ExternalProcessorClientInterceptor.java @@ -586,7 +586,9 @@ public void onNext(ProcessingResponse response) { } } - if (response.getRequestDrain()) { + @SuppressWarnings("deprecation") // Replaced by request_drain_requests/responses. + boolean requestDrain = response.getRequestDrain(); + if (requestDrain) { extProcStreamState.set(ExtProcStreamState.DRAINING); halfCloseExtProcStream(); activateCall(); diff --git a/xds/src/test/java/io/grpc/xds/ExternalProcessorClientInterceptorTest.java b/xds/src/test/java/io/grpc/xds/ExternalProcessorClientInterceptorTest.java index 9a9be9c1e45..a7074d6d438 100644 --- a/xds/src/test/java/io/grpc/xds/ExternalProcessorClientInterceptorTest.java +++ b/xds/src/test/java/io/grpc/xds/ExternalProcessorClientInterceptorTest.java @@ -112,6 +112,7 @@ * Unit tests for {@link ExternalProcessorFilter}. */ @RunWith(JUnit4.class) +@SuppressWarnings("deprecation") // request_drain, replaced by request_drain_requests/responses. public class ExternalProcessorClientInterceptorTest { private static final String INSECURE_CREDENTIALS_TYPE_URL = "type.googleapis.com/envoy.extensions.grpc_service." diff --git a/xds/third_party/envoy/import.sh b/xds/third_party/envoy/import.sh index 97ad0e90aa9..93848dedb7f 100755 --- a/xds/third_party/envoy/import.sh +++ b/xds/third_party/envoy/import.sh @@ -17,7 +17,7 @@ set -e # import VERSION from the google internal go/envoy-import-status -VERSION=ddf9f6788e3b5c103c496784f04890acbc6628e5 +VERSION=c282cb6c80e173a79cc0e989adae694f7556f7e9 DOWNLOAD_URL="https://github.com/envoyproxy/envoy/archive/${VERSION}.tar.gz" DOWNLOAD_BASE_DIR="envoy-${VERSION}" SOURCE_PROTO_BASE_DIR="${DOWNLOAD_BASE_DIR}/api" @@ -93,6 +93,7 @@ envoy/extensions/grpc_service/channel_credentials/insecure/v3/insecure_credentia envoy/extensions/grpc_service/channel_credentials/local/v3/local_credentials.proto envoy/extensions/grpc_service/channel_credentials/tls/v3/tls_credentials.proto envoy/extensions/grpc_service/channel_credentials/xds/v3/xds_credentials.proto +envoy/extensions/load_balancing_policies/autosharding/v3/autosharding.proto envoy/extensions/load_balancing_policies/client_side_weighted_round_robin/v3/client_side_weighted_round_robin.proto envoy/extensions/load_balancing_policies/common/v3/common.proto envoy/extensions/load_balancing_policies/least_request/v3/least_request.proto diff --git a/xds/third_party/envoy/src/main/proto/envoy/config/bootstrap/v3/bootstrap.proto b/xds/third_party/envoy/src/main/proto/envoy/config/bootstrap/v3/bootstrap.proto index 90c2b62d5c5..f9277902518 100644 --- a/xds/third_party/envoy/src/main/proto/envoy/config/bootstrap/v3/bootstrap.proto +++ b/xds/third_party/envoy/src/main/proto/envoy/config/bootstrap/v3/bootstrap.proto @@ -42,7 +42,7 @@ option (udpa.annotations.file_status).package_version_status = ACTIVE; // ` for more detail. // Bootstrap :ref:`configuration overview `. -// [#next-free-field: 44] +// [#next-free-field: 45] message Bootstrap { option (udpa.annotations.versioning).previous_message_type = "envoy.config.bootstrap.v2.Bootstrap"; @@ -239,6 +239,14 @@ message Bootstrap { // are marked as unused. Must be a multiple of the ``stats_flush_interval``. google.protobuf.Duration stats_eviction_interval = 42 [(validate.rules).duration = {gte {nanos: 1000000}}]; + + // Optional runtime derived duration, in milliseconds, to perform metric eviction. The runtime + // key is read on every stats flush, so the interval can be changed without restarting Envoy. + // ``default_value`` is used if the runtime key is not set, or if its value is not a multiple of + // the ``stats_flush_interval``. A value of 0 disables eviction. ``default_value`` must also be a + // multiple of the ``stats_flush_interval``. See ``stats_eviction_interval`` for how eviction + // works. + core.v3.RuntimeUInt64 runtime_stats_eviction_interval = 44; } // Optional watchdog configuration. @@ -431,7 +439,8 @@ message Bootstrap { GrpcAsyncClientManagerConfig grpc_async_client_manager_config = 40; // Optional configuration for memory allocation manager. - // Memory releasing is only supported for `tcmalloc allocator `_. + // Memory releasing is supported with `tcmalloc `_ and + // `gperftools `_. MemoryAllocatorManager memory_allocator_manager = 41; // When enabled, Envoy pins each worker thread to a distinct CPU from the process affinity mask, @@ -790,13 +799,14 @@ message CustomInlineHeader { // [#next-free-field: 6] message MemoryAllocatorManager { - // Configures tcmalloc to perform background release of free memory in amount of bytes per ``memory_release_interval`` interval. - // If equals to ``0``, no memory release will occur. Defaults to ``0``. + // Configures tcmalloc to perform background release of free memory in amount of bytes per + // ``memory_release_interval`` interval. If equals to ``0``, no memory release will occur. + // Defaults to ``0``. uint64 bytes_to_release = 1; - // Interval in milliseconds for memory releasing. If specified, during every - // interval Envoy will try to release ``bytes_to_release`` of free memory back to operating system for reuse. - // Defaults to ``1000`` milliseconds. + // Interval in milliseconds for memory releasing. If specified, during every interval Envoy will + // try to release ``bytes_to_release`` of free memory back to operating system for reuse. If set + // to ``0``, no memory release will occur. Defaults to ``1000`` milliseconds. google.protobuf.Duration memory_release_interval = 2; // Sets the soft memory limit for tcmalloc. When the total memory used by tcmalloc exceeds this diff --git a/xds/third_party/envoy/src/main/proto/envoy/config/cluster/v3/cluster.proto b/xds/third_party/envoy/src/main/proto/envoy/config/cluster/v3/cluster.proto index f9ae4dd194b..05c23a7a31e 100644 --- a/xds/third_party/envoy/src/main/proto/envoy/config/cluster/v3/cluster.proto +++ b/xds/third_party/envoy/src/main/proto/envoy/config/cluster/v3/cluster.proto @@ -934,7 +934,7 @@ message Cluster { // configuration for the cluster. If no // configuration is specified no health checking will be done and all cluster // members will be considered healthy at all times. - repeated core.v3.HealthCheck health_checks = 8; + repeated core.v3.HealthCheck health_checks = 8 [(validate.rules).repeated = {max_items: 8}]; // Optional maximum requests for a single upstream connection. This parameter // is respected by both the HTTP/1.1 and HTTP/2 connection pool @@ -1129,12 +1129,35 @@ message Cluster { // [#extension-category: envoy.network.dns_resolver] core.v3.TypedExtensionConfig typed_dns_resolver_config = 55; - // Optional configuration for having cluster readiness block on warm-up. Currently, only applicable for - // :ref:`STRICT_DNS`, - // or :ref:`LOGICAL_DNS`, - // or :ref:`Redis Cluster`. - // If true, cluster readiness blocks on warm-up. If false, the cluster will complete - // initialization whether or not warm-up has completed. Defaults to true. + // Controls whether a warming cluster gates the CDS ACK sent to the management server. + // Defaults to true. + // + // When ``true`` (default), Envoy holds back the CDS ACK while the cluster is warming, so an + // ADS implementation can detect cluster readiness before sending dependent RDS updates. This + // reduces 503s from routes referencing clusters that are not yet ready. + // + // When ``false``, the cluster is excluded from that hold: it continues warming normally but + // no longer gates the CDS ACK. Set this to ``false`` when a cluster may warm slowly or + // indefinitely (e.g. a missing SDS secret or EDS endpoints not yet delivered by the control + // plane) and you want to avoid stalling all other ADS updates. + // + // .. note:: + // Clusters added during server initialization are not subject to CDS pause gating; this + // field only affects clusters added or updated via CDS after initialization completes. + // + // .. note:: + // Setting this to ``false`` accepts a window where requests may receive 503 responses if + // routes reference this cluster before it finishes warming. + // + // For :ref:`STRICT_DNS`, + // :ref:`LOGICAL_DNS`, + // and :ref:`Redis Cluster`, setting this to ``false`` additionally causes + // the cluster to complete initialization immediately without waiting for DNS to resolve, + // making the cluster active right away with zero hosts. Hosts are added as DNS and (for Redis) + // ``CLUSTER SLOTS`` responses arrive. If SDS-backed TLS is configured, the cluster still waits + // for the secret regardless of this field; set ``initial_fetch_timeout`` on the + // :ref:`SdsSecretConfig.sds_config` + // to bound that wait. google.protobuf.BoolValue wait_for_warm_on_init = 54; // If specified, outlier detection will be enabled for this upstream cluster. diff --git a/xds/third_party/envoy/src/main/proto/envoy/config/core/v3/address.proto b/xds/third_party/envoy/src/main/proto/envoy/config/core/v3/address.proto index 6e8205d7cbe..b9140f623c3 100644 --- a/xds/third_party/envoy/src/main/proto/envoy/config/core/v3/address.proto +++ b/xds/third_party/envoy/src/main/proto/envoy/config/core/v3/address.proto @@ -144,7 +144,7 @@ message ExtraSourceAddress { SocketOptionsOverride socket_options = 2; } -// [#next-free-field: 7] +// [#next-free-field: 8] message BindConfig { option (udpa.annotations.versioning).previous_message_type = "envoy.api.v2.core.BindConfig"; @@ -180,6 +180,24 @@ message BindConfig { // `). // [#extension-category: envoy.upstream.local_address_selector] TypedExtensionConfig local_address_selector = 6; + + // If set to true, the :ref:`network_namespace_filepath + // ` of every source + // address in this bind config is validated when the configuration is loaded, and the + // configuration is rejected if a referenced network namespace cannot be opened. + // + // By default no such validation is performed: a network namespace that does not exist when the + // configuration is loaded may be created later, before connections are actually established, so + // eager validation would wrongly reject such configurations. If a namespace is unavailable when + // a connection is created, the connection attempt fails gracefully. + // + // Listener addresses do not need an equivalent option: a listener creates and binds its socket + // in the configured network namespace when the listener configuration is loaded, so an + // unavailable namespace always rejects the listener configuration. + // + // .. attention:: + // Network namespaces are only configurable on Linux. Otherwise, this field has no effect. + bool validate_network_namespaces = 7; } // Addresses specify either a logical or physical address and port, which are diff --git a/xds/third_party/envoy/src/main/proto/envoy/config/core/v3/base.proto b/xds/third_party/envoy/src/main/proto/envoy/config/core/v3/base.proto index 8d2ede9e65e..a4e4acc1cb8 100644 --- a/xds/third_party/envoy/src/main/proto/envoy/config/core/v3/base.proto +++ b/xds/third_party/envoy/src/main/proto/envoy/config/core/v3/base.proto @@ -9,6 +9,7 @@ import "envoy/type/v3/percent.proto"; import "envoy/type/v3/semantic_version.proto"; import "google/protobuf/any.proto"; +import "google/protobuf/duration.proto"; import "google/protobuf/struct.proto"; import "google/protobuf/wrappers.proto"; @@ -486,6 +487,11 @@ message HeaderValueOption { // Is the header value allowed to be empty? If false (default), custom headers with empty values are dropped, // otherwise they are added. + // + // .. note:: + // In any context other than the router filter, we always act as if keep_empty_value is true, + // regardless of the setting of this field. + // bool keep_empty_value = 4; } @@ -551,7 +557,7 @@ message DataSource { } // The message specifies the retry policy of remote data source when fetching fails. -// [#next-free-field: 7] +// [#next-free-field: 8] message RetryPolicy { option (udpa.annotations.versioning).previous_message_type = "envoy.api.v2.core.RetryPolicy"; @@ -594,6 +600,11 @@ message RetryPolicy { // For details, see :ref:`host_selection_retry_max_attempts `. int64 host_selection_retry_max_attempts = 6; + + // Specifies a non-zero upstream timeout per retry attempt (including the initial attempt). + // This parameter is optional. For details, see :ref:`per_try_timeout + // `. + google.protobuf.Duration per_try_timeout = 7 [(validate.rules).duration = {gt {}}]; } // The message specifies how to fetch data from remote and how to verify it. diff --git a/xds/third_party/envoy/src/main/proto/envoy/config/core/v3/config_source.proto b/xds/third_party/envoy/src/main/proto/envoy/config/core/v3/config_source.proto index 430562aa5bd..6fc84d9fe2a 100644 --- a/xds/third_party/envoy/src/main/proto/envoy/config/core/v3/config_source.proto +++ b/xds/third_party/envoy/src/main/proto/envoy/config/core/v3/config_source.proto @@ -157,9 +157,10 @@ message RateLimitSettings { // Local filesystem path configuration source. message PathConfigSource { - // Path on the filesystem to source and watch for configuration updates. - // When sourcing configuration for a :ref:`secret `, - // the certificate and key files are also watched for updates. + // Path on the filesystem from which to source configuration updates. + // When sourcing configuration for a + // :ref:`secret `, file-based secret + // data supported for SDS rotation is also monitored for updates. // // .. note:: // @@ -167,12 +168,14 @@ message PathConfigSource { // // .. note:: // - // If ``watched_directory`` is *not* configured, Envoy will watch the file path for *moves*. - // This is because in general only moves are atomic. The same method of swapping files as is - // demonstrated in the :ref:`runtime documentation ` can be - // used here also. If ``watched_directory`` is configured, no watch will be placed directly on - // this path. Instead, the configured ``watched_directory`` will be used to trigger reloads of - // this path. This is required in certain deployment scenarios. See below for more information. + // If neither ``poll_interval`` nor ``watched_directory`` is configured, Envoy will watch the + // file path for *moves*. This is because in general only moves are atomic. The same method of + // swapping files as is demonstrated in the + // :ref:`runtime documentation ` can be used here also. + // One of ``poll_interval`` and ``watched_directory`` can also be configured; the configuration + // is rejected if both are set. With ``poll_interval``, the same path is reloaded periodically. + // With ``watched_directory``, no watch is placed directly on this path; events in the + // configured directory trigger this path to be reloaded. string path = 1 [(validate.rules).string = {min_len: 1}]; // If configured, this directory will be watched for *moves*. When an entry in this directory is @@ -188,7 +191,24 @@ message PathConfigSource { // // The above configuration will ensure that Envoy watches the owning directory for moves which is // required due to how Kubernetes manages ConfigMap symbolic links during atomic updates. + // + // This field cannot be used together with ``poll_interval``. WatchedDirectory watched_directory = 2; + + // If configured, the ``path`` will be polled at this interval instead of watched for filesystem + // events on either the file or ``watched_directory``. This is useful when the underlying + // filesystem does not reliably provide change notifications, or when a custom deployment model + // does not generate the move or modification events handled by watching the path or directory. + // The file is read on every poll, but an update is delivered only when its parsed contents + // change. + // + // When this configuration source provides a + // :ref:`Secret `, the same secret + // files that are watched in event-based mode are polled at this interval. The last successfully + // loaded configuration or secret remains active when a poll fails. + // + // This field cannot be used together with ``watched_directory`` and must be at least 1ms. + google.protobuf.Duration poll_interval = 3 [(validate.rules).duration = {gte {nanos: 1000000}}]; } // Configuration for :ref:`listeners `, :ref:`clusters diff --git a/xds/third_party/envoy/src/main/proto/envoy/config/core/v3/grpc_service.proto b/xds/third_party/envoy/src/main/proto/envoy/config/core/v3/grpc_service.proto index 9c44006b2a9..f5686873ee7 100644 --- a/xds/third_party/envoy/src/main/proto/envoy/config/core/v3/grpc_service.proto +++ b/xds/third_party/envoy/src/main/proto/envoy/config/core/v3/grpc_service.proto @@ -29,7 +29,7 @@ option (udpa.annotations.file_status).package_version_status = ACTIVE; message GrpcService { option (udpa.annotations.versioning).previous_message_type = "envoy.api.v2.core.GrpcService"; - // [#next-free-field: 6] + // [#next-free-field: 7] message EnvoyGrpc { option (udpa.annotations.versioning).previous_message_type = "envoy.api.v2.core.GrpcService.EnvoyGrpc"; @@ -72,6 +72,28 @@ message GrpcService { // If true, the header will be removed and can not be overridden by per stream option. // Default to false. bool skip_envoy_headers = 5; + + // How many bytes each stream can buffer internally. This is the buffer limit of the + // underlying Envoy HTTP async client stream, and it has two effects: + // + // * Retries: when + // :ref:`retry_policy ` or a + // caller-provided retry policy is set, the request is buffered so that it can be replayed on + // a retry. For a streaming call this counts every message sent until the upstream sends + // response headers (initial metadata). Once the buffered data exceeds this limit, the + // request is no longer retried and the upstream cluster's ``retry_or_shadow_abandoned`` + // counter is incremented. Up to this many bytes per stream can be held in memory until the + // stream completes. + // * Flow control: this is the high watermark for data buffered before the upstream stream is + // ready to accept it. Above it, the stream reports that it is above its write buffer high + // watermark, and callers that check this, such as the streaming gRPC access loggers, stop + // sending on the stream. It also triggers the sidestream watermark callbacks, which + // ext_proc uses to push back on the downstream. + // + // A per-stream buffer limit set by the caller takes precedence over this value. If not set, + // the default buffer limit of the Envoy HTTP async client, 64 KiB, is used. + google.protobuf.UInt32Value per_stream_buffer_limit_bytes = 6 + [(validate.rules).uint32 = {gt: 0}]; } // [#next-free-field: 11] diff --git a/xds/third_party/envoy/src/main/proto/envoy/config/core/v3/health_check.proto b/xds/third_party/envoy/src/main/proto/envoy/config/core/v3/health_check.proto index a4ed6e91818..9b2c639bea0 100644 --- a/xds/third_party/envoy/src/main/proto/envoy/config/core/v3/health_check.proto +++ b/xds/third_party/envoy/src/main/proto/envoy/config/core/v3/health_check.proto @@ -63,7 +63,7 @@ message HealthStatusSet { [(validate.rules).repeated = {items {enum {defined_only: true}}}]; } -// [#next-free-field: 27] +// [#next-free-field: 28] message HealthCheck { option (udpa.annotations.versioning).previous_message_type = "envoy.api.v2.core.HealthCheck"; @@ -83,7 +83,7 @@ message HealthCheck { } } - // [#next-free-field: 15] + // [#next-free-field: 16] message HttpHealthCheck { option (udpa.annotations.versioning).previous_message_type = "envoy.api.v2.core.HealthCheck.HttpHealthCheck"; @@ -152,9 +152,24 @@ message HealthCheck { // non-200 response will result in the host being marked unhealthy. repeated type.v3.Int64Range retriable_statuses = 12; - // Use specified application protocol for health checks. + // Use specified application protocol for health checks. With :ref:`use_alpn_protocol + // ` this is + // the codec used when ALPN settles on neither ``h2`` nor ``http/1.1``. type.v3.CodecClientType codec_client_type = 10 [(validate.rules).enum = {defined_only: true}]; + // Select the codec from the protocol negotiated by ALPN on the health check connection: HTTP/2 + // when ``h2`` is negotiated, HTTP/1.1 when ``http/1.1`` is negotiated, and otherwise + // ``codec_client_type``, including when nothing is negotiated. With ``codec_client_type`` at + // its default this is the same mapping as the cluster's :ref:`auto_config + // `. Like + // ``auto_config``, it requires a transport socket that supports ALPN such as TLS and is + // rejected on a cluster whose transport sockets do not, unless the + // ``config.do_not_validate_alpn_support`` runtime key is set, as for ``auto_config``. It + // cannot be combined with ``codec_client_type`` ``HTTP3``. See :ref:`tls_options + // ` for what the connection + // advertises. + bool use_alpn_protocol = 15; + // An optional service name parameter which is used to validate the identity of // the health checked cluster using a :ref:`StringMatcher // `. See the :ref:`architecture overview @@ -260,12 +275,21 @@ message HealthCheck { // Specifies the ALPN protocols for health check connections. This is useful if the // corresponding upstream is using ALPN-based :ref:`FilterChainMatch // ` along with different protocols for health checks - // versus data connections. If empty, no ALPN protocols will be set on health check connections. + // versus data connections. If empty, health check connections advertise the ALPN protocols of + // the cluster's TLS context, if any. With :ref:`use_alpn_protocol + // `, + // the negotiated protocol selects the health check codec. repeated string alpn_protocols = 1; } reserved 10; + // Optional name for this health checker. When set, per-checker stats are emitted under + // ``health_check.name..`` instead of ``health_check.``. + // + // This is required if multiple health checks are configured on a cluster. + string name = 27; + // The time to wait for a health check response. If the timeout is reached the // health check attempt will be considered a failure. google.protobuf.Duration timeout = 1 [(validate.rules).duration = { diff --git a/xds/third_party/envoy/src/main/proto/envoy/config/core/v3/proxy_protocol.proto b/xds/third_party/envoy/src/main/proto/envoy/config/core/v3/proxy_protocol.proto index 2da5fe5fd4d..fea7dcc1453 100644 --- a/xds/third_party/envoy/src/main/proto/envoy/config/core/v3/proxy_protocol.proto +++ b/xds/third_party/envoy/src/main/proto/envoy/config/core/v3/proxy_protocol.proto @@ -109,6 +109,7 @@ message ProxyProtocolConfig { } message PerHostConfig { - // Enables per-host configuration for Proxy Protocol. + // Enables per-host configuration for Proxy Protocol. Only the static ``value`` of each + // ``TlvEntry`` is applied to host-level TLVs. The ``format_string`` field is not evaluated here. repeated TlvEntry added_tlvs = 1; } diff --git a/xds/third_party/envoy/src/main/proto/envoy/config/listener/v3/listener.proto b/xds/third_party/envoy/src/main/proto/envoy/config/listener/v3/listener.proto index e463c1246dd..1ceee92c908 100644 --- a/xds/third_party/envoy/src/main/proto/envoy/config/listener/v3/listener.proto +++ b/xds/third_party/envoy/src/main/proto/envoy/config/listener/v3/listener.proto @@ -138,9 +138,7 @@ message Listener { // The listener will use the connection balancer according to ``type_url``. If ``type_url`` is invalid, // Envoy will not attempt to balance active connections between worker threads. - // The ``envoy.network.connection_balance`` extension category is currently empty - // because the only registered member (``envoy.network.connection_balance.dlb``) - // is disabled. See https://github.com/envoyproxy/envoy/issues/45491. + // The ``envoy.network.connection_balance`` extension category is currently empty. core.v3.TypedExtensionConfig extend_balance = 2; // If specified, the listener will steer new connections to worker threads using a kernel diff --git a/xds/third_party/envoy/src/main/proto/envoy/config/listener/v3/quic_config.proto b/xds/third_party/envoy/src/main/proto/envoy/config/listener/v3/quic_config.proto index c208a58f4a4..62cb290884c 100644 --- a/xds/third_party/envoy/src/main/proto/envoy/config/listener/v3/quic_config.proto +++ b/xds/third_party/envoy/src/main/proto/envoy/config/listener/v3/quic_config.proto @@ -10,8 +10,6 @@ import "envoy/config/core/v3/socket_cmsg_headers.proto"; import "google/protobuf/duration.proto"; import "google/protobuf/wrappers.proto"; -import "xds/annotations/v3/status.proto"; - import "udpa/annotations/status.proto"; import "udpa/annotations/versioning.proto"; import "validate/validate.proto"; @@ -76,8 +74,7 @@ message QuicProtocolOptions { // The current QUICHE implementation will advertise only one of the preferred IPv4 and IPv6 addresses based on the address family the client initially connects with. // If not specified, Envoy will not advertise any server's preferred address. // [#extension-category: envoy.quic.server_preferred_address] - core.v3.TypedExtensionConfig server_preferred_address_config = 9 - [(xds.annotations.v3.field_status).work_in_progress = true]; + core.v3.TypedExtensionConfig server_preferred_address_config = 9; // Configure the server to send transport parameter `disable_active_migration `_. // Defaults to false (do not send this transport parameter). diff --git a/xds/third_party/envoy/src/main/proto/envoy/config/listener/v3/udp_listener_config.proto b/xds/third_party/envoy/src/main/proto/envoy/config/listener/v3/udp_listener_config.proto index 4e619b1f760..fc4327031ac 100644 --- a/xds/third_party/envoy/src/main/proto/envoy/config/listener/v3/udp_listener_config.proto +++ b/xds/third_party/envoy/src/main/proto/envoy/config/listener/v3/udp_listener_config.proto @@ -29,7 +29,8 @@ message UdpListenerConfig { // UDP socket configuration for the listener. The default for // :ref:`prefer_gro ` is false for - // listener sockets. If receiving a large amount of datagrams from a small number of sources, it + // listener sockets. When false, GRO is disabled on the listener socket. + // If receiving a large amount of datagrams from a small number of sources, it // may be worthwhile to enable this option after performance testing. core.v3.UdpSocketConfig downstream_socket_config = 5; diff --git a/xds/third_party/envoy/src/main/proto/envoy/config/metrics/v3/stats.proto b/xds/third_party/envoy/src/main/proto/envoy/config/metrics/v3/stats.proto index 46331c1abf0..c22e23fd573 100644 --- a/xds/third_party/envoy/src/main/proto/envoy/config/metrics/v3/stats.proto +++ b/xds/third_party/envoy/src/main/proto/envoy/config/metrics/v3/stats.proto @@ -362,6 +362,14 @@ message StatsdSink { // envoy.test_counter:1|c // envoy.test_timer:5|ms string prefix = 3; + + // If true, histogram samples are scaled to milliseconds according to the histogram's unit + // before being reported as timers: samples of histograms recording microseconds are divided by + // 1000 and reported as a fractional millisecond value, while histograms recording milliseconds + // or without a declared unit are reported unchanged. By default every sample is reported + // unchanged with an ``ms`` suffix regardless of the histogram's unit, so histograms recording + // microseconds are reported a factor of 1000 off. + bool scale_histogram_units_to_milliseconds = 4; } // Stats configuration proto schema for built-in ``envoy.stat_sinks.dog_statsd`` sink. @@ -369,6 +377,7 @@ message StatsdSink { // compatible tags. Tags are configurable via :ref:`StatsConfig // `. // [#extension: envoy.stat_sinks.dog_statsd] +// [#next-free-field: 6] message DogStatsdSink { option (udpa.annotations.versioning).previous_message_type = "envoy.config.metrics.v2.DogStatsdSink"; @@ -394,6 +403,12 @@ message DogStatsdSink { // // Note that this value may not be respected if smaller than a single metric. google.protobuf.UInt64Value max_bytes_per_datagram = 4 [(validate.rules).uint64 = {gt: 0}]; + + // If true, histogram samples are scaled to milliseconds according to the histogram's unit + // before being reported as timers. See :ref:`StatsdSink's scale_histogram_units_to_milliseconds + // field ` + // for more details. + bool scale_histogram_units_to_milliseconds = 5; } // Stats configuration proto schema for built-in ``envoy.stat_sinks.hystrix`` sink. diff --git a/xds/third_party/envoy/src/main/proto/envoy/config/overload/v3/overload.proto b/xds/third_party/envoy/src/main/proto/envoy/config/overload/v3/overload.proto index 05e6b2a1293..b01760cae08 100644 --- a/xds/third_party/envoy/src/main/proto/envoy/config/overload/v3/overload.proto +++ b/xds/third_party/envoy/src/main/proto/envoy/config/overload/v3/overload.proto @@ -157,8 +157,10 @@ message OverloadAction { option (udpa.annotations.versioning).previous_message_type = "envoy.config.overload.v2alpha.OverloadAction"; - // The name of the overload action. This is just a well-known string that - // listeners can use for registering callbacks. + // The action name. Most actions use a well-known string for listener callback registration. + // ``ScaleTimersOverloadActionConfig`` actions may use unique custom names for independently + // triggered ``reduce_timeouts`` instances. Custom names must not use the reserved + // ``envoy.overload_actions.`` prefix. No action name may duplicate a ``LoadShedPoint`` name. // Valid known overload actions include: // - envoy.overload_actions.stop_accepting_requests // - envoy.overload_actions.disable_http_keepalive @@ -178,7 +180,10 @@ message OverloadAction { // in this list. repeated Trigger triggers = 2 [(validate.rules).repeated = {min_items: 1}]; - // Configuration for the action being instantiated if applicable. + // Optional implementation configuration. Well-known names identify the action directly; for a + // custom name, this configuration's type identifies it. Currently only + // ``ScaleTimersOverloadActionConfig`` supports custom names, identifying a ``reduce_timeouts`` + // instance. google.protobuf.Any typed_config = 3; } diff --git a/xds/third_party/envoy/src/main/proto/envoy/config/rbac/v3/rbac.proto b/xds/third_party/envoy/src/main/proto/envoy/config/rbac/v3/rbac.proto index ef153ad177b..a7a58c5772c 100644 --- a/xds/third_party/envoy/src/main/proto/envoy/config/rbac/v3/rbac.proto +++ b/xds/third_party/envoy/src/main/proto/envoy/config/rbac/v3/rbac.proto @@ -348,9 +348,10 @@ message Principal { reserved 1; - // The name of the principal. If set, The URI SAN or DNS SAN in that order - // is used from the certificate, otherwise the subject field is used. If - // unset, it applies to any user that is allowed by the downstream TLS configuration. + // The name of the principal. If set, it matches if any URI SAN, any DNS SAN, or the subject + // field (in RFC 2253 format) of the peer certificate matches. All three are always checked, + // so a certificate whose URI SANs do not match can still match on a DNS SAN or its subject. + // If unset, it applies to any user that is allowed by the downstream TLS configuration. // If :ref:`require_client_certificate ` // is false or :ref:`trust_chain_verification ` // is set to :ref:`ACCEPT_UNTRUSTED `, diff --git a/xds/third_party/envoy/src/main/proto/envoy/config/route/v3/route.proto b/xds/third_party/envoy/src/main/proto/envoy/config/route/v3/route.proto index 5bd909f34c3..e90cfc3e138 100644 --- a/xds/third_party/envoy/src/main/proto/envoy/config/route/v3/route.proto +++ b/xds/third_party/envoy/src/main/proto/envoy/config/route/v3/route.proto @@ -4,6 +4,7 @@ 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/any.proto"; @@ -23,7 +24,7 @@ option (udpa.annotations.file_status).package_version_status = ACTIVE; // * Routing :ref:`architecture overview ` // * HTTP :ref:`router filter ` -// [#next-free-field: 19] +// [#next-free-field: 20] message RouteConfiguration { option (udpa.annotations.versioning).previous_message_type = "envoy.api.v2.RouteConfiguration"; @@ -40,8 +41,10 @@ message RouteConfiguration { // Both ``virtual_hosts`` and ``vhds`` fields will be used when present. ``virtual_hosts`` can be used // for a base routing table or for infrequently changing virtual hosts. ``vhds`` is used for // on-demand discovery of virtual hosts. The contents of these two fields will be merged to - // generate a routing table for a given RouteConfiguration, with ``vhds`` derived configuration - // taking precedence. + // generate a routing table for a given RouteConfiguration. When a virtual host from ``vhds`` + // has the same :ref:`name ` as a virtual host + // from ``virtual_hosts``, the ``vhds`` virtual host takes precedence and the colliding + // ``virtual_hosts`` entry is ignored. Vhds vhds = 9; // Optionally specifies a list of HTTP headers that the connection manager @@ -138,7 +141,8 @@ message RouteConfiguration { // Normally, virtual host matching is done using the :authority (or // Host: in HTTP < 2) HTTP header. Setting this will instead, use a // different HTTP header for this purpose. - string vhost_header = 18; + string vhost_header = 18 + [(validate.rules).string = {well_known_regex: HTTP_HEADER_NAME strict: false}]; // Ignore path-parameters in path-matching. // Before RFC3986, URI were like(RFC1808): :///;?# @@ -162,6 +166,34 @@ message RouteConfiguration { // For instance, if the metadata is intended for the Router filter, // the filter name should be specified as ``envoy.filters.http.router``. core.v3.Metadata metadata = 17; + + // After the route matching has resolved a route for incoming request, the route specifiers + // are applied to the route to customize or monitor it and the output of the specifiers will be + // used as the final route by Envoy for the request. The specifiers here will not modify/affect + // the request attributes (e.g., headers, path) directly. + // + // Specifiers are executed in order, and the output of each is the input of the next. The route + // that comes out of the last one is the route Envoy uses for the request. + // + // Specifiers are configured at three levels. Specifiers in three levels will run in this order: + // + // 1. The ``route_specifiers`` of resolved + // :ref:`route ` + // 2. The ``route_specifiers`` of resolved + // :ref:`virtual host ` + // 3. The ``route_specifiers`` of + // :ref:`route configuration `. + // + // .. note:: + // If the route matching resolves no route, the route specifiers at the route configuration + // and the virtual host levels will still be applied to null. This allows route specifiers to + // optionally generate a valid route even when no route is resolved for the request. + // Similarly, if the route matching resolves a valid route, the route specifiers may drop it + // and return no route. Then Envoy will treat it as route not found and result in 404 response. + // + // See :ref:`route specifiers ` for more details. + // [#extension-category: envoy.router.route_specifiers] + repeated core.v3.TypedExtensionConfig route_specifiers = 19; } message Vhds { diff --git a/xds/third_party/envoy/src/main/proto/envoy/config/route/v3/route_components.proto b/xds/third_party/envoy/src/main/proto/envoy/config/route/v3/route_components.proto index f864497f093..7c634ba6a97 100644 --- a/xds/third_party/envoy/src/main/proto/envoy/config/route/v3/route_components.proto +++ b/xds/third_party/envoy/src/main/proto/envoy/config/route/v3/route_components.proto @@ -45,7 +45,7 @@ option (udpa.annotations.file_status).package_version_status = ACTIVE; // host header. This allows a single listener to service multiple top level domain path trees. Once // a virtual host is selected based on the domain, the routes are processed in order to see which // upstream cluster to route to or whether to perform a redirect. -// [#next-free-field: 26] +// [#next-free-field: 27] message VirtualHost { option (udpa.annotations.versioning).previous_message_type = "envoy.api.v2.route.VirtualHost"; @@ -204,6 +204,7 @@ message VirtualHost { // will take precedence over this config and it'll be treated independently (e.g., values are not // inherited). :ref:`Retry policy ` should not be // set if this field is used. + // [#comment: add [#extension-category: envoy.router.retry_policy] when there are built-in extensions] google.protobuf.Any retry_policy_typed_config = 20; // Indicates the hedge policy for all routes in this virtual host. Note that setting a @@ -258,6 +259,27 @@ message VirtualHost { // For instance, if the metadata is intended for the Router filter, // the filter name should be specified as ``envoy.filters.http.router``. core.v3.Metadata metadata = 24; + + // After the route matching has resolved a route for incoming request, the route specifiers + // are applied to the route to customize or monitor it and the output of the specifiers will be + // used as the final route by Envoy for the request. The specifiers here will not modify/affect + // the request attributes (e.g., headers, path) directly. + // + // Specifiers are executed in order, and the output of each is the input of the next. The + // specifiers here will run after the ``route_specifiers`` of the resolved + // :ref:`route ` + // and before the ``route_specifiers`` of + // :ref:`route configuration `. + // + // .. note:: + // If the route matching resolves no route, the route specifiers at the route configuration + // and the virtual host levels will still be applied to null. This allows route specifiers to + // optionally generate a valid route even when no route is resolved for the request. + // Similarly, if the route matching resolves a valid route, the route specifiers may drop it + // and return no route. Then Envoy will treat it as route not found and result in 404 response. + // + // See :ref:`route specifiers ` for more details. + repeated core.v3.TypedExtensionConfig route_specifiers = 26; } // A filter-defined action type. @@ -281,7 +303,7 @@ message RouteList { // // Envoy supports routing on HTTP method via :ref:`header matching // `. -// [#next-free-field: 21] +// [#next-free-field: 22] message Route { option (udpa.annotations.versioning).previous_message_type = "envoy.api.v2.route.Route"; @@ -420,6 +442,28 @@ message Route { // Only one of :ref:`per_request_buffer_limit_bytes ` // and ``request_body_buffer_limit`` may be set. google.protobuf.UInt64Value request_body_buffer_limit = 20; + + // After the route matching has resolved this route for incoming request, the route specifiers + // are applied to the route to customize or monitor it and the output of the specifiers will be + // used as the final route by Envoy for the request. The specifiers here will not modify/affect + // the request attributes (e.g., headers, path) directly. + // + // Specifiers are executed in order, and the output of each is the input of the next. The + // specifiers here will run first, before the ``route_specifiers`` of + // :ref:`virtual host ` and + // :ref:`route configuration `, + // so the route that comes out of the last specifier here is the input of the specifiers of + // these two levels. + // + // .. note:: + // If the route matching resolves no route, the route specifiers at the route configuration + // and the virtual host levels will still be applied to null. This allows route specifiers to + // optionally generate a valid route even when no route is resolved for the request. + // Similarly, if the route matching resolves a valid route, the route specifiers may drop it + // and return no route. Then Envoy will treat it as route not found and result in 404 response. + // + // See :ref:`route specifiers ` for more details. + repeated core.v3.TypedExtensionConfig route_specifiers = 21; } // Compared to the :ref:`cluster ` field that specifies a @@ -831,8 +875,6 @@ message RouteAction { // Configures :ref:`internal redirect ` behavior. // [#next-major-version: remove this definition - it's defined in the InternalRedirectPolicy message.] enum InternalRedirectAction { - option deprecated = true; - PASS_THROUGH_INTERNAL_REDIRECT = 0; HANDLE_INTERNAL_REDIRECT = 1; } @@ -853,7 +895,7 @@ message RouteAction { // .. note:: // // Shadowing doesn't support HTTP CONNECT and upgrades. - // [#next-free-field: 9] + // [#next-free-field: 10] message RequestMirrorPolicy { option (udpa.annotations.versioning).previous_message_type = "envoy.api.v2.route.RouteAction.RequestMirrorPolicy"; @@ -921,6 +963,20 @@ message RouteAction { // is implicitly enabled if this field is set. string host_rewrite_literal = 8 [(validate.rules).string = {well_known_regex: HTTP_HEADER_VALUE strict: false}]; + + // The human readable prefix to use when emitting statistics for this mirror policy. The + // statistics are rooted at ``mirror..`` and count how many requests were + // selected for mirroring, how many mirrors were started, and how each mirror ended. See + // :ref:`mirror policy statistics `. + // + // The statistics are emitted in the server's root scope, so policies that use the same + // ``stat_prefix`` share the same counters, wherever they are configured. This includes + // cluster-level :ref:`request_mirror_policies + // `, + // which take precedence over route-level policies. + // + // If empty, no per policy statistics are emitted. + string stat_prefix = 9; } // Specifies the route's hashing policy if the upstream cluster uses a hashing :ref:`load balancer @@ -1440,8 +1496,9 @@ message RouteAction { // [#not-implemented-hide:] // Specifies the configuration for retry policy extension. Note that if this is set, it'll take // precedence over the virtual host level retry policy entirely (e.g., policies are not merged, - // the most internal one becomes the enforced policy). :ref:`Retry policy ` + // the most internal one becomes the enforced policy). :ref:`Retry policy ` // should not be set if this field is used. + // [#comment: add [#extension-category: envoy.router.retry_policy] when there are built-in extensions] google.protobuf.Any retry_policy_typed_config = 33; // Specify a set of route request mirroring policies. @@ -1799,7 +1856,9 @@ message RetryPolicy { // .. note:: // This currently works when the route cluster specifier support the dynamic refresh, // e.g. :ref:`matcher cluster specifier - // ` + // `, + // :ref:`priority group cluster specifier + // ` // and :ref:`dynamic modules cluster specifier // `. bool refresh_cluster_on_retry = 14; @@ -2762,7 +2821,11 @@ message RateLimit { // requests based on the action with this field set to true. Users should ensure that the rate limit is enforced by the actions // applied on the request path, i.e. the ones with this field set to false. // - // Currently, this is only supported by the HTTP global rate filter. + // Supported by HTTP global rate limiting. HTTP local rate limiting supports this only for the + // filter's embedded ``rate_limits``, including per-route ``typed_per_filter_config``, and ignores it + // for route and virtual-host ``rate_limits``. Local completion charges matching descriptor buckets + // in full, overdrawing them by up to one bucket of tokens when the usage exceeds the remaining + // budget; the default bucket is consumed only on requests. bool apply_on_stream_done = 6; // Descriptor level X-RateLimit headers options which may override the filter level setting. diff --git a/xds/third_party/envoy/src/main/proto/envoy/config/trace/v3/opentelemetry.proto b/xds/third_party/envoy/src/main/proto/envoy/config/trace/v3/opentelemetry.proto index 0576ff735b1..0d16daf24c0 100644 --- a/xds/third_party/envoy/src/main/proto/envoy/config/trace/v3/opentelemetry.proto +++ b/xds/third_party/envoy/src/main/proto/envoy/config/trace/v3/opentelemetry.proto @@ -10,6 +10,7 @@ import "google/protobuf/wrappers.proto"; import "udpa/annotations/migrate.proto"; import "udpa/annotations/status.proto"; +import "validate/validate.proto"; option java_package = "io.envoyproxy.envoy.config.trace.v3"; option java_outer_classname = "OpentelemetryProto"; @@ -21,18 +22,45 @@ option (udpa.annotations.file_status).package_version_status = ACTIVE; // Configuration for the OpenTelemetry tracer. // [#extension: envoy.tracers.opentelemetry] -// [#next-free-field: 10] +// [#next-free-field: 13] message OpenTelemetryConfig { + // Trace context formats that can be extracted from downstream requests and injected into + // upstream requests. + enum TraceContextFormat { + // W3C Trace Context: the :ref:`traceparent ` and + // ``tracestate`` headers. + // See `W3C Trace Context `_. + TRACE_CONTEXT = 0; + + // B3 single header: the :ref:`b3 ` header. + // See `B3 propagation `_. + // + // When extracting, both the single header and the multiple header encodings are accepted, with + // the single header taking precedence. When injecting, the single header is written, and any + // ``x-b3-*`` headers already on the request are rewritten so that they describe the same span. + B3 = 1; + + // B3 multiple headers: the :ref:`x-b3-traceid `, + // ``x-b3-spanid``, ``x-b3-sampled`` and ``x-b3-flags`` headers. + // See `B3 propagation `_. + // + // When extracting, both the single header and the multiple header encodings are accepted, with + // the single header taking precedence. When injecting, ``x-b3-traceid``, ``x-b3-spanid`` and + // ``x-b3-sampled`` are written, and a ``b3`` header already on the request is rewritten so that + // it describes the same span. + B3_MULTI = 2; + } + // The upstream gRPC cluster that will receive OTLP traces. // Note that the tracer drops traces if the server does not read data fast enough. // This field can be left empty to disable reporting traces to the gRPC service. - // Only one of ``grpc_service``, ``http_service`` may be used. + // Only one of ``grpc_service``, ``http_service``, ``exporter`` may be used. core.v3.GrpcService grpc_service = 1 [(udpa.annotations.field_migrate).oneof_promotion = "otlp_exporter"]; // The upstream HTTP cluster that will receive OTLP traces. // This field can be left empty to disable reporting traces to the HTTP service. - // Only one of ``grpc_service``, ``http_service`` may be used. + // Only one of ``grpc_service``, ``http_service``, ``exporter`` may be used. // // .. note:: // @@ -42,6 +70,14 @@ message OpenTelemetryConfig { core.v3.HttpService http_service = 3 [(udpa.annotations.field_migrate).oneof_promotion = "otlp_exporter"]; + // Specifies the custom exporter to be used by the OpenTelemetry tracer. + // Only one of ``grpc_service``, ``http_service``, ``exporter`` may be used. + // + // [#extension-category: envoy.tracers.opentelemetry.exporters] + // [#not-implemented-hide:] + core.v3.TypedExtensionConfig exporter = 10 + [(udpa.annotations.field_migrate).oneof_promotion = "otlp_exporter"]; + // The name for the service. This will be populated in the ResourceSpan Resource attributes. // If it is not provided, it will default to "unknown_service:envoy". string service_name = 2; @@ -80,4 +116,29 @@ message OpenTelemetryConfig { // Specifies whether to set the instrumentation scope name ("envoy") and version on emitted traces. // If not specified, the default is to set the instrumentation scope name and version. google.protobuf.BoolValue set_instrumentation_scope = 9; + + // The trace context formats to extract from downstream requests, in order of precedence. + // The first format whose headers are present and valid is used as the parent of the span; the + // remaining formats are ignored. A format whose headers are malformed is skipped. If headers + // were present but none of them could be extracted, the request is not traced. + // + // B3 trace context without a sampling decision joins the trace, and the span's sampling + // decision is made by Envoy as if it were the first span in the trace. + // + // B3 headers that carry a decision not to sample but no trace context, such as ``b3: 0`` or + // ``x-b3-sampled: 0`` without ``x-b3-traceid`` and ``x-b3-spanid``, start a new trace that is + // not sampled, regardless of Envoy's tracing decision or the configured sampler. A decision to + // sample without trace context is ignored. + // + // Each format may be listed at most once. If not specified, the default is ``[TRACE_CONTEXT]``. + repeated TraceContextFormat incoming_trace_context = 11 + [(validate.rules).repeated = {items {enum {defined_only: true}}}]; + + // The trace context formats to inject into upstream requests. Headers of formats that are not + // listed are left unchanged, except that injecting either B3 encoding also rewrites headers of + // the other B3 encoding that are already on the request. + // + // Each format may be listed at most once. If not specified, the default is ``[TRACE_CONTEXT]``. + repeated TraceContextFormat outgoing_trace_context = 12 + [(validate.rules).repeated = {items {enum {defined_only: true}}}]; } diff --git a/xds/third_party/envoy/src/main/proto/envoy/extensions/filters/http/ext_authz/v3/ext_authz.proto b/xds/third_party/envoy/src/main/proto/envoy/extensions/filters/http/ext_authz/v3/ext_authz.proto index 2b565dea339..38bd581b4dc 100644 --- a/xds/third_party/envoy/src/main/proto/envoy/extensions/filters/http/ext_authz/v3/ext_authz.proto +++ b/xds/third_party/envoy/src/main/proto/envoy/extensions/filters/http/ext_authz/v3/ext_authz.proto @@ -30,7 +30,7 @@ option (udpa.annotations.file_status).package_version_status = ACTIVE; // External Authorization :ref:`configuration overview `. // [#extension: envoy.filters.http.ext_authz] -// [#next-free-field: 33] +// [#next-free-field: 35] message ExtAuthz { option (udpa.annotations.versioning).previous_message_type = "envoy.config.filter.http.ext_authz.v3.ExtAuthz"; @@ -101,6 +101,24 @@ message ExtAuthz { // also use decoder_header_mutation_rules to restrict sensitive request header mutations. bool clear_route_cache = 6; + // A list of the request header names the routes match on. When this list is not empty and + // ``clear_route_cache`` is ``true``, an ``OK`` response clears the route cache only when it sets, + // appends, or removes one of these headers, or mutates a query parameter, rather than on any request + // mutation. This avoids re-resolving the route when the response only touches headers that no route + // matches on. + // + // If not specified, the route cache is cleared whenever an ``OK`` response sets, appends, or removes + // any request header, or mutates a query parameter. + // + // .. attention:: + // + // List every request header the routes match on. A route that matches on a header omitted here is + // not re-resolved when the authorization service mutates that header, which can route the request + // as if the mutation had not happened. + repeated string clear_route_cache_headers = 34 [(validate.rules).repeated = { + items {string {min_len: 1 well_known_regex: HTTP_HEADER_NAME strict: false}} + }]; + // Sets the HTTP status that is returned to the client when the authorization server returns an error // or cannot be reached. // @@ -397,6 +415,13 @@ message ExtAuthz { // // Defaults to ``false``. bool shadow_mode = 32; + + // Whether to emit client-side spans for external authorization requests (e.g. gRPC or HTTP calls). + // When set to false, client-side egress spans will not be emitted/exported to trace collectors, + // but trace context (e.g. ``traceparent``) will still be propagated to the authorization server. + // + // If unset, defaults to ``true``. + google.protobuf.BoolValue emit_client_span = 33; } // Serialized form of the shadow-mode authorization decision written to FilterState @@ -624,7 +649,7 @@ message ExtAuthzPerRoute { } // Extra settings for the check request. -// [#next-free-field: 6] +// [#next-free-field: 7] message CheckSettings { option (udpa.annotations.versioning).previous_message_type = "envoy.config.filter.http.ext_authz.v2.CheckSettings"; @@ -673,4 +698,7 @@ message CheckSettings { // Override with an HTTP service configuration. HttpService http_service = 5; } + + // Overrides the filter-level ``emit_client_span`` setting for this route. + google.protobuf.BoolValue emit_client_span = 6; } diff --git a/xds/third_party/envoy/src/main/proto/envoy/extensions/filters/http/ext_proc/v3/ext_proc.proto b/xds/third_party/envoy/src/main/proto/envoy/extensions/filters/http/ext_proc/v3/ext_proc.proto index 5f298f1b729..00962bc8222 100644 --- a/xds/third_party/envoy/src/main/proto/envoy/extensions/filters/http/ext_proc/v3/ext_proc.proto +++ b/xds/third_party/envoy/src/main/proto/envoy/extensions/filters/http/ext_proc/v3/ext_proc.proto @@ -98,7 +98,7 @@ option (udpa.annotations.file_status).package_version_status = ACTIVE; // ` object in a namespace matching the filter // name. // -// [#next-free-field: 27] +// [#next-free-field: 29] message ExternalProcessor { // Describes the route cache action to be taken when an external processor response // is received in response to request headers. @@ -386,6 +386,19 @@ message ExternalProcessor { // request smuggling. Thus, please use your own discretion when enabling this feature. // bool allow_content_length_header = 26; + + // Whether to emit client-side spans for external processing requests. + // When set to false, client-side egress spans will not be emitted/exported to trace collectors, + // but trace context (e.g. ``traceparent``) will still be propagated to the external processor. + // + // If unset, defaults to ``true``. + google.protobuf.BoolValue emit_client_span = 27; + + // Maximum size of a body chunk sent to the external processor in ``STREAMED`` or + // ``FULL_DUPLEX_STREAMED`` mode. Must be at least 1024 bytes. + // If not specified, all body data passed in a given encodeData() or decodeData() call will be sent in a single chunk. + google.protobuf.UInt32Value max_streamed_body_chunk_size = 28 + [(validate.rules).uint32 = {gte: 1024}]; } // ExtProcHttpService is used for HTTP communication between the filter and the external processing service. @@ -467,7 +480,7 @@ message ExtProcPerRoute { } // Overrides that may be set on a per-route basis -// [#next-free-field: 10] +// [#next-free-field: 12] message ExtProcOverrides { // Set a different processing mode for this route than the default. ProcessingMode processing_mode = 1; @@ -514,4 +527,15 @@ message ExtProcOverrides { // :ref:`processing_request_modifier `. config.core.v3.TypedExtensionConfig processing_request_modifier = 9 [(xds.annotations.v3.field_status).work_in_progress = true]; + + // Overrides the filter-level ``emit_client_span`` setting for this route. + google.protobuf.BoolValue emit_client_span = 10; + + // Maximum size of a body chunk sent to the external processor in ``STREAMED`` or + // ``FULL_DUPLEX_STREAMED`` mode. Must be at least 1024 bytes. + // If not specified, all body data passed in a given encodeData() or decodeData() call will be sent in a single chunk. + // This is a per-route override of + // :ref:`max_streamed_body_chunk_size `. + google.protobuf.UInt32Value max_streamed_body_chunk_size = 11 + [(validate.rules).uint32 = {gte: 1024}]; } diff --git a/xds/third_party/envoy/src/main/proto/envoy/extensions/filters/http/fault/v3/fault.proto b/xds/third_party/envoy/src/main/proto/envoy/extensions/filters/http/fault/v3/fault.proto index 01f056e7927..ec52981aa50 100644 --- a/xds/third_party/envoy/src/main/proto/envoy/extensions/filters/http/fault/v3/fault.proto +++ b/xds/third_party/envoy/src/main/proto/envoy/extensions/filters/http/fault/v3/fault.proto @@ -23,7 +23,7 @@ option (udpa.annotations.file_status).package_version_status = ACTIVE; // Fault Injection :ref:`configuration overview `. // [#extension: envoy.filters.http.fault] -// [#next-free-field: 6] +// [#next-free-field: 7] message FaultAbort { option (udpa.annotations.versioning).previous_message_type = "envoy.config.filter.http.fault.v2.FaultAbort"; @@ -54,6 +54,10 @@ message FaultAbort { // The percentage of requests/operations/connections that will be aborted with the error code // provided. type.v3.FractionalPercent percentage = 3; + + // The response body to be returned when aborting the request. + // If not specified, defaults to "fault filter abort". + string response_body = 6; } // [#next-free-field: 17] diff --git a/xds/third_party/envoy/src/main/proto/envoy/extensions/filters/http/gcp_authn/v3/gcp_authn.proto b/xds/third_party/envoy/src/main/proto/envoy/extensions/filters/http/gcp_authn/v3/gcp_authn.proto index b741120c190..dcf367f1e92 100644 --- a/xds/third_party/envoy/src/main/proto/envoy/extensions/filters/http/gcp_authn/v3/gcp_authn.proto +++ b/xds/third_party/envoy/src/main/proto/envoy/extensions/filters/http/gcp_authn/v3/gcp_authn.proto @@ -23,7 +23,7 @@ option (udpa.annotations.file_status).package_version_status = ACTIVE; // [#extension: envoy.filters.http.gcp_authn] // Filter configuration. -// [#next-free-field: 7] +// [#next-free-field: 9] message GcpAuthnFilterConfig { // The HTTP URI to fetch tokens from GCE Metadata Server(https://cloud.google.com/compute/docs/metadata/overview). // The URL format is "http://metadata.google.internal/computeMetadata/v1/instance/service-accounts/default/identity?audience=[AUDIENCE]" @@ -45,9 +45,14 @@ message GcpAuthnFilterConfig { // Request header location to extract the token. By default (i.e. if this field is not specified), the token // is extracted to the Authorization HTTP header, in the format "Authorization: Bearer ". + // If ``token_metadata_key`` is set, this field takes no effect. // Not supported by all data planes. TokenHeader token_header = 4; + // Optional dynamic metadata key to save the token. The metadata uses the filter config name as the namespace. + // Takes precedence over ``token_header``. + string token_metadata_key = 7; + // Cluster to send traffic to the GCE metadata server. Not supported // by all data planes; a data plane may instead have its own mechanism // for contacting the metadata server. @@ -59,12 +64,28 @@ message GcpAuthnFilterConfig { lt {seconds: 4294967296} gte {} }]; + + // Defines the authentication service. This field overrides the cluster's typed_filter_metadata definition. + Audience audience = 8; } // Audience is the URL of the receiving service that performs token authentication. // It will be provided to the filter through cluster's typed_filter_metadata. +// [#next-free-field: 6] message Audience { message AccessToken { + // Optional custom OAuth scopes for the access token request. + // If empty, the filter will not request scopes explicitly, so the metadata server's default + // scopes will be used. + // When populated, the filter appends "?scopes=" to the + // metadata server token request. Note that the metadata server replaces default + // scopes with the provided list rather than appending; to preserve general GCP API + // access, callers should explicitly include "https://www.googleapis.com/auth/cloud-platform". + // Validation rules require each scope to be non-empty and disallow whitespace or commas, + // as commas are used as the delimiter for the metadata server and OAuth 2.0 scopes + // cannot contain whitespace (RFC 6749 Section 3.3). + repeated string scopes = 1 + [(validate.rules).repeated = {items {string {min_len: 1 pattern: "^[^\\s,]+$"}}}]; } message BoundJwt { @@ -73,6 +94,33 @@ message Audience { } message BoundAccessToken { + // Optional custom OAuth scopes for the bound access token request. + // If empty, the filter will not request scopes explicitly, so the metadata server's default + // scopes will be used. + // When populated, the filter appends "&scopes=" to the + // metadata server token request. Note that the metadata server replaces default + // scopes with the provided list rather than appending; to preserve general GCP API + // access, callers should explicitly include "https://www.googleapis.com/auth/cloud-platform". + // Validation rules require each scope to be non-empty and disallow whitespace or commas, + // as commas are used as the delimiter for the metadata server and OAuth 2.0 scopes + // cannot contain whitespace (RFC 6749 Section 3.3). + repeated string scopes = 1 + [(validate.rules).repeated = {items {string {min_len: 1 pattern: "^[^\\s,]+$"}}}]; + } + + // Default lifetime is 1h. + message IAMAccessToken { + // A template string for the account email or unique ID for which the credentials are requested, + // e.g. ``my-sa-%DYNAMIC_METADATA(my_filter:tenant_project)%@my-project.iam.gserviceaccount.com``. + string account = 1 [(validate.rules).string = {min_len: 1}]; + + // A template string for the authorization header value, + // e.g. ``Bearer %DYNAMIC_METADATA(gcp_authn:token)%``. + string authorization = 2 [(validate.rules).string = {min_len: 1}]; + + // Optional custom scopes for the token request. + // Default scope is https://www.googleapis.com/auth/cloud-platform. + repeated string scopes = 3; } // The audience URL, used for fetching unbound JWT token. @@ -89,6 +137,11 @@ message Audience { // If defined, the filter will fetch bound Access Token instead of unbound. // It takes precedence over ``bound_jwt``, ``access_token`` and ``url``. BoundAccessToken bound_access_token = 4; + + // If defined, the filter will fetch an access token for a service account. + // It takes precedence over ``bound_access_token``, ``bound_jwt``, ``access_token``, and ``url``. + // Requires inlined audience definition in the filter configuration. + IAMAccessToken iam_access_token = 5; } // Token Cache configuration. @@ -99,13 +152,25 @@ message TokenCacheConfig { } message TokenHeader { - // The HTTP header's name. - string name = 1 - [(validate.rules).string = {min_len: 1 well_known_regex: HTTP_HEADER_NAME strict: false}]; + // Configuration options for preserving an existing token header. + message PreserveExisting { + } + + // The HTTP header's name. Defaults to ``Authorization`` if not specified. + string name = 1 [ + (validate.rules).string = {well_known_regex: HTTP_HEADER_NAME strict: false ignore_empty: true} + ]; // The header's prefix. The format is "value_prefix" // For example, for "Authorization: Bearer ", value_prefix="Bearer " with a space at the // end. string value_prefix = 2 [(validate.rules).string = {well_known_regex: HTTP_HEADER_VALUE strict: false}]; + + // If set, the filter checks if the target header is already present (by header key existence, + // even if the header value is empty). If present, it skips token fetching and preserves the + // existing header intact (``value_prefix`` has no effect on the preserved header). If absent, + // a new token is fetched and written using ``name`` and ``value_prefix``. + // If not set, the default behavior is to unconditionally overwrite the header. + PreserveExisting preserve_existing = 3; } diff --git a/xds/third_party/envoy/src/main/proto/envoy/extensions/filters/network/http_connection_manager/v3/http_connection_manager.proto b/xds/third_party/envoy/src/main/proto/envoy/extensions/filters/network/http_connection_manager/v3/http_connection_manager.proto index 00a347eda6c..669afc93e0a 100644 --- a/xds/third_party/envoy/src/main/proto/envoy/extensions/filters/network/http_connection_manager/v3/http_connection_manager.proto +++ b/xds/third_party/envoy/src/main/proto/envoy/extensions/filters/network/http_connection_manager/v3/http_connection_manager.proto @@ -39,7 +39,7 @@ option (udpa.annotations.file_status).package_version_status = ACTIVE; // HTTP connection manager :ref:`configuration overview `. // [#extension: envoy.filters.network.http_connection_manager] -// [#next-free-field: 63] +// [#next-free-field: 64] message HttpConnectionManager { option (udpa.annotations.versioning).previous_message_type = "envoy.config.filter.network.http_connection_manager.v2.HttpConnectionManager"; @@ -1131,6 +1131,11 @@ message HttpConnectionManager { // If not configured, defaults to disabled and the standard behavior applies (using connection // TLS status or trusted downstream headers). ForwardProtoConfig forward_proto_config = 61; + + // If true, records two per stream histograms, ``downstream_rq_route_resolution_time_us`` for the + // total wall time spent resolving the route and ``downstream_rq_route_resolutions`` for the number + // of resolutions. Defaults to false, so the default stat set is unchanged. + bool record_route_resolution_stats = 63; } // Configuration options for setting the ``x-forwarded-proto`` header. diff --git a/xds/third_party/envoy/src/main/proto/envoy/extensions/load_balancing_policies/autosharding/v3/autosharding.proto b/xds/third_party/envoy/src/main/proto/envoy/extensions/load_balancing_policies/autosharding/v3/autosharding.proto new file mode 100644 index 00000000000..6c673bec7fc --- /dev/null +++ b/xds/third_party/envoy/src/main/proto/envoy/extensions/load_balancing_policies/autosharding/v3/autosharding.proto @@ -0,0 +1,57 @@ +syntax = "proto3"; + +package envoy.extensions.load_balancing_policies.autosharding.v3; + +import "envoy/config/core/v3/grpc_service.proto"; + +import "google/protobuf/duration.proto"; + +import "udpa/annotations/status.proto"; +import "validate/validate.proto"; + +option java_package = "io.envoyproxy.envoy.extensions.load_balancing_policies.autosharding.v3"; +option java_outer_classname = "AutoshardingProto"; +option java_multiple_files = true; +option go_package = "github.com/envoyproxy/go-control-plane/envoy/extensions/load_balancing_policies/autosharding/v3;autoshardingv3"; +option (udpa.annotations.file_status).package_version_status = ACTIVE; + +// [#protodoc-title: Autosharding Load Balancing Policy] +// [#not-implemented-hide:] +// [#extension: envoy.load_balancing_policies.autosharding] + +// Configuration for the autosharding LB policy. +// [#not-implemented-hide:] +// [#next-free-field: 6] +message Autosharding { + // gRPC service configuration used by the LB policy to fetch sharding + // assignments. + // + // Communicates via the autosharding protocol: + // https://github.com/GoogleCloudPlatform/autosharding/blob/main/proto/autosharding/v1/autosharding.proto + config.core.v3.GrpcService grpc_service = 1 [(validate.rules).message = {required: true}]; + + // A unique ID sent to the sharding service to locate assignments. + // + // Can optionally contain a "%s" token that will be replaced with the + // "Locality" before sending. If a "%s" token is present, but the "Locality" + // information is not available to the LB policy, the token will be replaced + // with an empty string. + string autosharding_target = 2 [(validate.rules).string = {min_len: 1}]; + + // Name of the request header containing the application-defined key. This key + // is used to look up the matching key-range assigned by the sharding service. + string key_header_name = 3 + [(validate.rules).string = {min_len: 1 well_known_regex: HTTP_HEADER_NAME strict: false}]; + + // When true, enables a fallback mechanism. The LB policy chooses a random + // endpoint from the name resolver's list when: + // 1. The sharding server fails to return a valid assignment, or + // 2. All endpoints matching a key range in the assignment are unhealthy. + bool enable_fallback = 4; + + // How long to wait for the initial assignment from the sharding service. If + // no assignment is received before the timer fires, the LB policy will either + // go into fallback mode (if enable_fallback is true) or fail RPCs. + // Defaults to 60 seconds if not specified. + google.protobuf.Duration initial_assignment_timeout = 5 [(validate.rules).duration = {gt {}}]; +} diff --git a/xds/third_party/envoy/src/main/proto/envoy/extensions/transport_sockets/tls/v3/common.proto b/xds/third_party/envoy/src/main/proto/envoy/extensions/transport_sockets/tls/v3/common.proto index 3a3b753a035..fa861b14213 100644 --- a/xds/third_party/envoy/src/main/proto/envoy/extensions/transport_sockets/tls/v3/common.proto +++ b/xds/third_party/envoy/src/main/proto/envoy/extensions/transport_sockets/tls/v3/common.proto @@ -107,8 +107,7 @@ message TlsParameters { // Using TLS protocol versions below TLSv1_2 has serious security considerations and risks. TlsProtocol tls_minimum_protocol_version = 1 [(validate.rules).enum = {defined_only: true}]; - // Maximum TLS protocol version. By default, it's ``TLSv1_2`` for clients and ``TLSv1_3`` for - // servers. + // Maximum TLS protocol version. By default, it's ``TLSv1_3`` for both clients and servers. TlsProtocol tls_maximum_protocol_version = 2 [(validate.rules).enum = {defined_only: true}]; // If specified, the TLS listener will only support the specified `cipher list @@ -242,7 +241,7 @@ message PrivateKeyProvider { bool fallback = 4; } -// [#next-free-field: 9] +// [#next-free-field: 10] message TlsCertificate { option (udpa.annotations.versioning).previous_message_type = "envoy.api.v2.auth.TlsCertificate"; @@ -309,6 +308,26 @@ message TlsCertificate { // [#not-implemented-hide:] repeated config.core.v3.DataSource signed_certificate_timestamp = 5; + + // Optional per-certificate TLS parameters. When set on a server certificate, any specified + // fields override the corresponding context-level + // :ref:`tls_params ` + // for that certificate during the TLS handshake; unset fields continue to use the context-level + // values. This allows different cipher suites, ECDH curves, protocol versions, signature + // algorithms, or compliance policies per certificate. + // + // These parameters do not affect certificate selection, which continues to be based only on SNI, + // the client's ECDSA capability, and OCSP capability. They are applied after a certificate has + // been selected. For a multi-certificate configuration this means each certificate's parameters + // must be compatible with the clients that select it: if the selected certificate's parameters + // leave nothing in common with the client, the handshake fails and no other certificate is tried. + // + // Note: because these are overrides rather than constraints, a certificate-level + // ``tls_minimum_protocol_version`` can lower the floor set by the context-level + // ``tls_params``, weakening the listener's overall TLS security policy. + // Setting this on a client certificate is not supported and is ignored. + // This field has no effect on QUIC/HTTP3 downstream connections. + TlsParameters tls_params = 9; } message TlsSessionTicketKeys { diff --git a/xds/third_party/envoy/src/main/proto/envoy/extensions/transport_sockets/tls/v3/tls.proto b/xds/third_party/envoy/src/main/proto/envoy/extensions/transport_sockets/tls/v3/tls.proto index 648dd5b5671..60d0250b097 100644 --- a/xds/third_party/envoy/src/main/proto/envoy/extensions/transport_sockets/tls/v3/tls.proto +++ b/xds/third_party/envoy/src/main/proto/envoy/extensions/transport_sockets/tls/v3/tls.proto @@ -270,7 +270,8 @@ message CommonTlsContext { // TLS protocol versions, cipher suites etc. TlsParameters tls_params = 1; - // Only a single TLS certificate is supported in client contexts. In server contexts, + // Only a single TLS certificate is supported in client contexts unless + // ``custom_tls_certificate_selector`` is explicitly defined with ``max_session_keys`` set to 0. In server contexts, // :ref:`Multiple TLS certificates ` can be associated with the // same context to allow both RSA and ECDSA certificates and support SNI-based selection. // @@ -362,6 +363,7 @@ message CommonTlsContext { // Custom TLS handshaker. If empty, defaults to native TLS handshaking // behavior. + // [#extension-category: envoy.tls_handshakers] config.core.v3.TypedExtensionConfig custom_handshaker = 13; // TLS key log configuration diff --git a/xds/third_party/envoy/src/main/proto/envoy/service/auth/v3/external_auth.proto b/xds/third_party/envoy/src/main/proto/envoy/service/auth/v3/external_auth.proto index 520a4ff4f31..d612d0cb7ed 100644 --- a/xds/third_party/envoy/src/main/proto/envoy/service/auth/v3/external_auth.proto +++ b/xds/third_party/envoy/src/main/proto/envoy/service/auth/v3/external_auth.proto @@ -52,6 +52,8 @@ message DeniedHttpResponse { // This field allows the authorization service to send HTTP response headers // to the downstream client. Note that the :ref:`append field in HeaderValueOption ` defaults to // false when used in this message. + // The :ref:`keep_empty_value field in HeaderValueOption ` + // is not supported. repeated config.core.v3.HeaderValueOption headers = 2; // This field allows the authorization service to send a response body data @@ -72,6 +74,8 @@ message OkHttpResponse { // the filter will append the correspondent header value to the matched request header. // By leaving ``append`` as false, the filter will either add a new header, or override an existing // one if there is a match. + // The :ref:`keep_empty_value field in HeaderValueOption ` + // is not supported. repeated config.core.v3.HeaderValueOption headers = 2; // HTTP entity headers to remove from the original request before dispatching @@ -101,6 +105,8 @@ message OkHttpResponse { // This field allows the authorization service to send HTTP response headers // to the downstream client on success. Note that the :ref:`append field in HeaderValueOption ` // defaults to false when used in this message. + // The :ref:`keep_empty_value field in HeaderValueOption ` + // is not supported. repeated config.core.v3.HeaderValueOption response_headers_to_add = 6; // This field allows the authorization service to set (and overwrite) query diff --git a/xds/third_party/envoy/src/main/proto/envoy/service/ext_proc/v3/external_processor.proto b/xds/third_party/envoy/src/main/proto/envoy/service/ext_proc/v3/external_processor.proto index c34e9f51243..38900bd1772 100644 --- a/xds/third_party/envoy/src/main/proto/envoy/service/ext_proc/v3/external_processor.proto +++ b/xds/third_party/envoy/src/main/proto/envoy/service/ext_proc/v3/external_processor.proto @@ -242,7 +242,7 @@ message ProcessingRequest { // the server must send back exactly one ``ProcessingResponse`` message. // * If it is set to ``FULL_DUPLEX_STREAMED``, the server must follow the API defined // for this mode to send the ``ProcessingResponse`` messages. -// [#next-free-field: 15] +// [#next-free-field: 17] message ProcessingResponse { // Flow control window update. Values may be positive or negative. The // sender must immediately add these values to its flow control window, @@ -326,39 +326,127 @@ message ProcessingResponse { // particular request/response only. Servers may use this to intelligently control how requests // are processed based on the headers and other metadata that they see. // - // This field is applicable when servers are responding to the header requests. If it is set - // in the response to the body or trailer requests, it will be ignored by the data plane. + // If set in a response to body or trailer requests, it will be ignored by the data plane. // It is also ignored by the data plane when the ext_proc filter config // :ref:`allow_mode_override ` // is set to ``false``, or // :ref:`send_body_without_waiting_for_header_response ` // is set to ``true``. // - // The external processing server can override the processing mode by returning a standalone ``mode_override`` - // in the ``ProcessingResponse`` after receiving a ``ProcessingRequest`` for request headers. This standalone - // override must be sent before the request headers response is sent. - // Subsequent messages will adhere to this new mode. + // ``mode_override`` can be sent in the following scenarios: // - // Constraints: + // 1. Included in a header response: + // The server can set this field when responding to request or response headers, i.e., + // alongside a ``request_headers`` or ``response_headers`` response. // - // 1. Request Path: A standalone ``mode_override`` only supports transitioning the body processing mode - // from other mode to ``FULL_DUPLEX_STREAMED``, and the trailer mode must be set to ``SEND``. - // 2. Response Path: There are no restrictions on processing mode changes in this case. + // 2. Standalone ``mode_override`` response: + // After receiving a ``ProcessingRequest`` for request headers, the server can send a + // standalone ``mode_override`` response (i.e., a ``ProcessingResponse`` with only + // ``mode_override`` populated and no ``response`` case set) before sending the + // ``request_headers`` response. Subsequent messages will adhere to this new mode. + // + // .. note:: + // Processing mode changes in a standalone ``mode_override`` have the following constraints: + // + // * For request path: Only supports transitioning the request body processing mode from + // ``NONE`` or ``STREAMED`` to ``FULL_DUPLEX_STREAMED``. Additionally, the request + // trailer mode must be set to ``SEND``, which is required by ``FULL_DUPLEX_STREAMED`` + // mode. Responses that do not meet these constraints are treated as spurious and rejected. + // * For Response path: There are no restrictions on processing mode changes. // envoy.extensions.filters.http.ext_proc.v3.ProcessingMode mode_override = 9; // [#not-implemented-hide:] - // Used only in ``FULL_DUPLEX_STREAMED`` and ``GRPC`` body send modes. - // Instructs the data plane to stop sending body data and to send a - // half-close on the ext_proc stream. The ext_proc server should then echo - // back all subsequent body contents as-is until it sees the client's - // half-close, at which point the ext_proc server can terminate the stream - // with an OK status. This provides a safe way for the ext_proc server - // to indicate that it does not need to see the rest of the stream; - // without this, the ext_proc server could not terminate the stream - // early, because it would wind up dropping any body contents that the - // client had already sent before it saw the ext_proc stream termination. - bool request_drain = 12; + // Deprecated and not implemented. This field has been replaced with + // the request_drain_requests and request_drain_responses fields. + bool request_drain = 12 + [deprecated = true, (envoy.annotations.deprecated_at_minor_version) = "3.0"]; + + // [#not-implemented-hide:] + // Initiates a drain of request body data. Used only in + // ``FULL_DUPLEX_STREAMED`` and ``GRPC`` body send modes. + // + // The expected sequence for a drain is as follows: + // + // 1. The ext_proc server sends a message to the data plane with this + // field set to true. + // 2. The data plane pauses reading from the downstream client, applying + // any necessary flow control push-back. + // 3. The data plane sends a + // :ref:`request_body ` + // with the + // :ref:`drain_complete ` + // field set to true. + // 4. The ext_proc server continues processing all subsequent request body + // chunks until it sees the body chunk with the + // :ref:`drain_complete ` + // field set to true. When sending back its response to that last body + // chunk, the ext_proc server will set the + // :ref:`drain_complete ` + // field to true to let the data plane know that it has finished draining. + // 5. When the data plane sees the response with the + // :ref:`drain_complete ` + // field set to true, it will resume reading from the downstream + // client, passing all data directly to the upstream server, + // without going through the ext_proc sidestream. + // + // This procedure provides a safe way for the ext_proc server to indicate + // that it does not need to see the rest of the request body. + // + // Note that if the data plane is sending request body data and the + // ext_proc server wants to terminate the stream with an OK status, it + // must perform this drain before doing so. + // + // Note that the data plane may have either sent a body chunk with + // :ref:`end_of_stream ` + // set to true or may have sent trailers before it received the drain + // request from the ext_proc server. In these cases, the data plane will + // ignore the drain request, and the ext_proc will consider the drain + // complete when it sees the end-of-stream or trailers. + bool request_drain_requests = 15; + + // [#not-implemented-hide:] + // Initiates a drain of response body data. Used only in + // ``FULL_DUPLEX_STREAMED`` and ``GRPC`` body send modes. + // + // The expected sequence for a drain is as follows: + // + // 1. The ext_proc server sends a message to the data plane with this + // field set to true. + // 2. The data plane pauses reading from the upstream server, applying + // any necessary flow control push-back. + // 3. The data plane sends a + // :ref:`response_body ` + // with the + // :ref:`drain_complete ` + // field set to true. + // 4. The ext_proc server continues processing all subsequent response body + // chunks until it sees the body chunk with the + // :ref:`drain_complete ` + // field set to true. When sending back its response to that last body + // chunk, the ext_proc server will set the + // :ref:`drain_complete ` + // field to true to let the data plane know that it has finished draining. + // 5. When the data plane sees the response with the + // :ref:`drain_complete ` + // field set to true, it will resume reading from the upstream + // server, passing all data directly to the downstream client, + // without going through the ext_proc sidestream. + // + // This procedure provides a safe way for the ext_proc server to indicate + // that it does not need to see the rest of the response body. + // + // Note that if the data plane is sending response body data and the + // ext_proc server wants to terminate the stream with an OK status, it + // must perform this drain before doing so. + // + // Note that the data plane may have either sent a body chunk with + // :ref:`end_of_stream ` + // set to true or may have sent trailers before it received the drain + // request from the ext_proc server. In these cases, the data plane will + // ignore the drain request, and the ext_proc will consider the drain + // complete when it sees the end-of-stream or trailers. + bool request_drain_responses = 16; // When the ext_proc server receives a request message and needs more time to process it, it // sends back a ``ProcessingResponse`` message with a new timeout value. When the data plane @@ -420,6 +508,7 @@ message HttpHeaders { // This message is sent to the external server when the HTTP request and response bodies are // received. +// [#next-free-field: 6] message HttpBody { // The contents of the body in the HTTP request/response. Note that in streaming mode multiple // ``HttpBody`` messages may be sent. @@ -448,6 +537,15 @@ message HttpBody { // This field is used in ``GRPC`` body send mode to indicate whether the message is compressed. // This will never be set to ``true`` by gRPC but may be set to ``true`` by a proxy like Envoy. bool grpc_message_compressed = 4; + + // [#not-implemented-hide:] + // In ``FULL_DUPLEX_STREAMED`` or ``GRPC`` body send modes, if the + // data plane has seen the + // :ref:`request_drain_requests ` + // or :ref:`request_drain_responses ` + // field, it will populate this field to indicate that it has finished + // sending data to the ext_proc server. + bool drain_complete = 5; } // This message is sent to the external server when the HTTP request and @@ -600,6 +698,10 @@ message HeaderMutation { // ``:authority``, ``:scheme``, or ``host`` headers will be ignored. // The header value is encoded in the // :ref:`raw_value ` field. + // Note that the :ref:`append field in HeaderValueOption ` + // defaults to false when used in this message. + // The :ref:`keep_empty_value field in HeaderValueOption ` + // is not supported. repeated config.core.v3.HeaderValueOption set_headers = 1; // Remove these HTTP headers. Attempts to remove system headers -- @@ -608,6 +710,7 @@ message HeaderMutation { } // The body response message corresponding to ``FULL_DUPLEX_STREAMED`` or ``GRPC`` body modes. +// [#next-free-field: 6] message StreamedBodyResponse { // In ``FULL_DUPLEX_STREAMED`` body send mode, contains the body response chunk that will be // passed to the upstream/downstream by the data plane. In ``GRPC`` body send mode, contains @@ -623,16 +726,35 @@ message StreamedBodyResponse { // messages sent by the client application. bool end_of_stream = 2; - // This field is used in ``GRPC`` body send mode when ``end_of_stream`` is ``true`` and ``body`` - // is empty. Those values would normally indicate an empty message on the stream with the - // end-of-stream bit set. However, if the half-close happens after the last message on the stream - // was already sent, then this field will be ``true`` to indicate an end-of-stream with *no* - // message (as opposed to an empty message). + // This field is used only in ``GRPC`` body send mode. It is not used in any other body send + // mode. + // + // This field is used only when ``end_of_stream`` is true and ``body`` is empty. + // Normally, in ``GRPC`` body send mode, an empty ``body`` field indicates an empty message on + // the gRPC stream. However, it is possible that the gRPC client sends a half-close without + // actually sending a message on the stream, so we need a way to differentiate between + // an empty message being sent and no message being sent. If this field is true, then it + // indicates that no message has been sent; if it is false, then it indicates that an empty + // message has been sent. + // [#not-implemented-hide:] bool end_of_stream_without_message = 3; // This field is used in ``GRPC`` body send mode to indicate whether the message is compressed. // This will never be set to ``true`` by gRPC but may be set to ``true`` by a proxy like Envoy. bool grpc_message_compressed = 4; + + // [#not-implemented-hide:] + // In ``FULL_DUPLEX_STREAMED`` or ``GRPC`` body send modes, if the + // ext_proc server has seen the + // :ref:`drain_complete ` + // field, it will populate this field to indicate that it has finished + // sending data back to the data plane. + // + // If the data plane receives a message with this field set to true + // before it has sent a drain-complete message to the ext_proc server, + // the data plane will treat that as if the ext_proc stream has failed + // with a non-OK status. + bool drain_complete = 5; } // This message specifies the body mutation the server sends to the data plane. diff --git a/xds/third_party/envoy/src/main/proto/envoy/type/metadata/v3/metadata.proto b/xds/third_party/envoy/src/main/proto/envoy/type/metadata/v3/metadata.proto index d131635bf9f..2a6192924ac 100644 --- a/xds/third_party/envoy/src/main/proto/envoy/type/metadata/v3/metadata.proto +++ b/xds/third_party/envoy/src/main/proto/envoy/type/metadata/v3/metadata.proto @@ -41,7 +41,8 @@ message MetadataKey { option (udpa.annotations.versioning).previous_message_type = "envoy.type.metadata.v2.MetadataKey"; // Specifies a segment in a path for retrieving values from Metadata. - // Currently, only key-based segments (field names) are supported. + // Supports both key-based segments (field names in a Struct) and index-based + // segments (element access in a ListValue). message PathSegment { option (udpa.annotations.versioning).previous_message_type = "envoy.type.metadata.v2.MetadataKey.PathSegment"; @@ -51,6 +52,9 @@ message MetadataKey { // If specified, use this key to retrieve the value in a Struct. string key = 1 [(validate.rules).string = {min_len: 1}]; + + // If specified, use this index to retrieve a value from a ListValue. + uint32 index = 2; } } @@ -60,12 +64,12 @@ message MetadataKey { // The path used to retrieve a specific Value from the Struct. // This can be either a prefix or a full path, depending on the use case. - // For example, ``[prop, xyz]`` would retrieve a struct or ``[prop, foo]`` would retrieve a string - // in the example above. + // For example, ``[{key: prop}, {key: xyz}]`` would retrieve a struct or ``[{key: prop}, {key: foo}]`` + // would retrieve a string in the example above. // - // .. note:: - // Since only key-type segments are supported, a path cannot specify a list - // unless the list is the last segment. + // Path segments support both struct field access (via ``key``) and list element access (via ``index``). + // For example, to access the first element of a list at ``envoy.filters.http.grpc_field_extraction.tenant_id``, + // use ``path: [{key: tenant_id}, {index: 0}]``. repeated PathSegment path = 2 [(validate.rules).repeated = {min_items: 1}]; } diff --git a/xds/third_party/envoy/src/main/proto/envoy/type/tracing/v3/custom_tag.proto b/xds/third_party/envoy/src/main/proto/envoy/type/tracing/v3/custom_tag.proto index cdb42a43507..f89dca11173 100644 --- a/xds/third_party/envoy/src/main/proto/envoy/type/tracing/v3/custom_tag.proto +++ b/xds/third_party/envoy/src/main/proto/envoy/type/tracing/v3/custom_tag.proto @@ -17,10 +17,44 @@ option (udpa.annotations.file_status).package_version_status = ACTIVE; // [#protodoc-title: Custom Tag] // Describes custom tags for the active span. -// [#next-free-field: 7] +// [#next-free-field: 8] message CustomTag { option (udpa.annotations.versioning).previous_message_type = "envoy.type.tracing.v2.CustomTag"; + // Specifies how the resolved tag value should be typed on tracers that support + // typed span attributes (e.g. OpenTelemetry). The integer and floating-point + // cases are declared explicitly so the emitted attribute type is deterministic + // rather than inferred from the value. + enum ValueType { + // The value type is not set. Behaves like ``STRING``; the distinct default + // value lets consumers tell an unset ``value_type`` apart from an explicit + // ``STRING``. + UNSPECIFIED = 0; + + // Emit the tag value as a string. + STRING = 1; + + // Coerce the resolved tag value to a signed 64-bit integer. Tracers that + // support typed span attributes emit it as a native integer attribute (for + // OpenTelemetry, an OTLP ``int_value``). If the value does not parse as an + // integer, or the tracer has no typed-attribute support, it falls back to a + // string tag. + INT = 2; + + // Coerce the resolved tag value to a double. Tracers that support typed span + // attributes emit it as a native floating-point attribute (for OpenTelemetry, + // an OTLP ``double_value``). If the value does not parse as a double, or the + // tracer has no typed-attribute support, it falls back to a string tag. + DOUBLE = 3; + + // Coerce the resolved tag value to a boolean. Tracers that support typed span + // attributes emit it as a native boolean attribute (for OpenTelemetry, an OTLP + // ``bool_value``). Accepts the usual boolean spellings (``true``/``false``, + // ``1``/``0``, etc.). If the value does not parse as a boolean, or the tracer + // has no typed-attribute support, it falls back to a string tag. + BOOL = 4; + } + // Literal type custom tag with static value for the tag value. message Literal { option (udpa.annotations.versioning).previous_message_type = @@ -106,4 +140,11 @@ message CustomTag { // unknown specifier values are replaced with the empty string instead of ``-``. string value = 6; } + + // The value's type. When unset (``UNSPECIFIED``) or ``STRING`` the tag keeps the + // preexisting string behavior. When set to ``INT``, ``DOUBLE`` or ``BOOL``, tracers + // that support typed span attributes (e.g. OpenTelemetry) emit the tag as an + // integer, floating-point or boolean attribute instead of a string. Applies to + // every custom tag type. + ValueType value_type = 7 [(validate.rules).enum = {defined_only: true}]; }