Skip to content

Commit

Permalink
Merge remote-tracking branch 'upstream/main' into zstd_upstream
Browse files Browse the repository at this point in the history
Signed-off-by: giantcroc <[email protected]>
  • Loading branch information
giantcroc committed Feb 4, 2024
2 parents 5b6ed53 + df8ebf8 commit 40edf73
Show file tree
Hide file tree
Showing 149 changed files with 3,154 additions and 994 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/envoy-macos.yml
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ jobs:
command:
container-command:
request: ${{ needs.load.outputs.request }}
runs-on: macos-12-xl
runs-on: macos-14-xlarge
steps-post:
steps-pre: ${{ matrix.steps-pre }}
target: ${{ matrix.target }}
Expand Down
6 changes: 6 additions & 0 deletions CODEOWNERS
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,12 @@

# api
/api/ @envoyproxy/api-shepherds

# docs/examples
/docs/ @envoyproxy/docs-shepherds
/examples/ @envoyproxy/docs-shepherds
/changelogs/ @envoyproxy/docs-shepherds

# access loggers
/*/extensions/access_loggers/common @auni53 @zuercher
/*/extensions/access_loggers/open_telemetry @itamarkam @yanavlasov
Expand Down
25 changes: 25 additions & 0 deletions api/envoy/config/cluster/v3/cluster.proto
Original file line number Diff line number Diff line change
Expand Up @@ -1236,13 +1236,38 @@ message UpstreamConnectionOptions {
option (udpa.annotations.versioning).previous_message_type =
"envoy.api.v2.UpstreamConnectionOptions";

enum FirstAddressFamilyVersion {
// respect the native ranking of destination ip addresses returned from dns
// resolution
DEFAULT = 0;

V4 = 1;

V6 = 2;
}

message HappyEyeballsConfig {
// Specify the IP address family to attempt connection first in happy
// eyeballs algorithm according to RFC8305#section-4.
FirstAddressFamilyVersion first_address_family_version = 1;

// Specify the number of addresses of the first_address_family_version being
// attempted for connection before the other address family.
google.protobuf.UInt32Value first_address_family_count = 2 [(validate.rules).uint32 = {gte: 1}];
}

// If set then set SO_KEEPALIVE on the socket to enable TCP Keepalives.
core.v3.TcpKeepalive tcp_keepalive = 1;

// If enabled, associates the interface name of the local address with the upstream connection.
// This can be used by extensions during processing of requests. The association mechanism is
// implementation specific. Defaults to false due to performance concerns.
bool set_local_interface_name_on_upstream_connections = 2;

// Configurations for happy eyeballs algorithm.
// Add configs for first_address_family_version and first_address_family_count
// when sorting destination ip addresses.
HappyEyeballsConfig happy_eyeballs_config = 3;
}

message TrackClusterStats {
Expand Down
6 changes: 5 additions & 1 deletion api/envoy/config/listener/v3/quic_config.proto
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ option (udpa.annotations.file_status).package_version_status = ACTIVE;
// [#protodoc-title: QUIC listener config]

// Configuration specific to the UDP QUIC listener.
// [#next-free-field: 10]
// [#next-free-field: 11]
message QuicProtocolOptions {
option (udpa.annotations.versioning).previous_message_type =
"envoy.api.v2.listener.QuicProtocolOptions";
Expand Down Expand Up @@ -77,4 +77,8 @@ message QuicProtocolOptions {
// [#extension-category: envoy.quic.server_preferred_address]
core.v3.TypedExtensionConfig server_preferred_address_config = 9
[(xds.annotations.v3.field_status).work_in_progress = true];

// Configure the server to send transport parameter `disable_active_migration <https://www.rfc-editor.org/rfc/rfc9000#section-18.2-4.30.1>`_.
// Defaults to false (do not send this transport parameter).
google.protobuf.BoolValue send_disable_active_migration = 10;
}
6 changes: 5 additions & 1 deletion api/envoy/config/rbac/v3/rbac.proto
Original file line number Diff line number Diff line change
Expand Up @@ -194,7 +194,7 @@ message Policy {
}

// Permission defines an action (or actions) that a principal can take.
// [#next-free-field: 13]
// [#next-free-field: 14]
message Permission {
option (udpa.annotations.versioning).previous_message_type = "envoy.config.rbac.v2.Permission";

Expand Down Expand Up @@ -270,6 +270,10 @@ message Permission {
// Extension for configuring custom matchers for RBAC.
// [#extension-category: envoy.rbac.matchers]
core.v3.TypedExtensionConfig matcher = 12;

// URI template path matching.
// [#extension-category: envoy.path.match]
core.v3.TypedExtensionConfig uri_template = 13;
}
}

Expand Down
1 change: 0 additions & 1 deletion api/envoy/config/route/v3/route_components.proto
Original file line number Diff line number Diff line change
Expand Up @@ -1211,7 +1211,6 @@ message RouteAction {
// :ref:`host_rewrite_path_regex <envoy_v3_api_field_config.route.v3.RouteAction.host_rewrite_path_regex>`)
// causes the original value of the host header, if any, to be appended to the
// :ref:`config_http_conn_man_headers_x-forwarded-host` HTTP header if it is different to the last value appended.
// This can be disabled by setting the runtime guard ``envoy_reloadable_features_append_xfh_idempotent`` to false.
bool append_x_forwarded_host = 38;

// Specifies the upstream timeout for the route. If not specified, the default is 15s. This
Expand Down
41 changes: 38 additions & 3 deletions api/envoy/extensions/filters/http/ext_proc/v3/ext_proc.proto
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,6 @@ option (udpa.annotations.file_status).package_version_status = ACTIVE;
// **Current Implementation Status:**
// All options and processing modes are implemented except for the following:
//
// * Dynamic metadata in responses from the external processor is ignored.
// * "async mode" is not implemented.

// The filter communicates with an external gRPC service called an "external processor"
Expand Down Expand Up @@ -97,7 +96,7 @@ option (udpa.annotations.file_status).package_version_status = ACTIVE;
// <arch_overview_advanced_filter_state_sharing>` object in a namespace matching the filter
// name.
//
// [#next-free-field: 16]
// [#next-free-field: 17]
message ExternalProcessor {
// Configuration for the gRPC service that the filter will communicate with.
// The filter supports both the "Envoy" and "Google" gRPC clients.
Expand Down Expand Up @@ -203,6 +202,35 @@ message ExternalProcessor {
// Instead, the stream to the external processor will be closed. There will be no
// more external processing for this stream from now on.
bool disable_immediate_response = 15;

// Options related to the sending and receiving of dynamic metadata.
MetadataOptions metadata_options = 16;
}

// The MetadataOptions structure defines options for the sending and receiving of
// dynamic metadata. Specifically, which namespaces to send to the server, whether
// metadata returned by the server may be written, and how that metadata may be written.
message MetadataOptions {
message MetadataNamespaces {
// Specifies a list of metadata namespaces whose values, if present,
// will be passed to the ext_proc service as an opaque *protobuf::Struct*.
repeated string untyped = 1;

// Specifies a list of metadata namespaces whose values, if present,
// will be passed to the ext_proc service as a *protobuf::Any*. This allows
// envoy and the external processing server to share the protobuf message
// definition for safe parsing.
repeated string typed = 2;
}

// Describes which typed or untyped dynamic metadata namespaces to forward to
// the external processing server.
MetadataNamespaces forwarding_namespaces = 1;

// Describes which typed or untyped dynamic metadata namespaces to accept from
// the external processing server. Set to empty or leave unset to disallow writing
// any received dynamic metadata. Receiving of typed metadata is not supported.
MetadataNamespaces receiving_namespaces = 2;
}

// The HeaderForwardingRules structure specifies what headers are
Expand Down Expand Up @@ -245,7 +273,7 @@ message ExtProcPerRoute {
}

// Overrides that may be set on a per-route basis
// [#next-free-field: 6]
// [#next-free-field: 7]
message ExtProcOverrides {
// Set a different processing mode for this route than the default.
ProcessingMode processing_mode = 1;
Expand All @@ -266,4 +294,11 @@ message ExtProcOverrides {

// Set a different gRPC service for this route than the default.
config.core.v3.GrpcService grpc_service = 5;

// Options related to the sending and receiving of dynamic metadata.
// Lists of forwarding and receiving namespaces will be overridden in their entirety,
// meaning the most-specific config that specifies this override will be the final
// config used. It is the prerogative of the control plane to ensure this
// most-specific config contains the correct final overrides.
MetadataOptions metadata_options = 6;
}
11 changes: 7 additions & 4 deletions api/envoy/service/ext_proc/v3/external_processor.proto
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ service ExternalProcessor {

// This represents the different types of messages that Envoy can send
// to an external processing server.
// [#next-free-field: 8]
// [#next-free-field: 9]
message ProcessingRequest {
// Specify whether the filter that sent this request is running in synchronous
// or asynchronous mode. The choice of synchronous or asynchronous mode
Expand Down Expand Up @@ -109,6 +109,9 @@ message ProcessingRequest {
// the original upstream response has trailers.
HttpTrailers response_trailers = 7;
}

// Dynamic metadata associated with the request.
config.core.v3.Metadata metadata_context = 8;
}

// For every ProcessingRequest received by the server with the ``async_mode`` field
Expand Down Expand Up @@ -152,9 +155,9 @@ message ProcessingResponse {
ImmediateResponse immediate_response = 7;
}

// [#not-implemented-hide:]
// Optional metadata that will be emitted as dynamic metadata to be consumed by the next
// filter. This metadata will be placed in the namespace ``envoy.filters.http.ext_proc``.
// Optional metadata that will be emitted as dynamic metadata to be consumed by
// following filters. This metadata will be placed in the namespace(s) specified by the top-level
// field name(s) of the struct.
google.protobuf.Struct dynamic_metadata = 8;

// Override how parts of the HTTP request and response are processed
Expand Down
3 changes: 2 additions & 1 deletion bazel/dependency_imports.bzl
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,8 @@ def envoy_dependency_imports(go_version = GO_VERSION, jq_version = JQ_VERSION, y
rules_foreign_cc_dependencies()
go_rules_dependencies()
go_register_toolchains(go_version)
envoy_download_go_sdks(go_version)
if go_version != "host":
envoy_download_go_sdks(go_version)
gazelle_dependencies(go_sdk = "go_sdk")
apple_rules_dependencies()
pip_dependencies()
Expand Down
6 changes: 3 additions & 3 deletions bazel/repository_locations.bzl
Original file line number Diff line number Diff line change
Expand Up @@ -1190,12 +1190,12 @@ REPOSITORY_LOCATIONS_SPEC = dict(
project_name = "QUICHE",
project_desc = "QUICHE (QUIC, HTTP/2, Etc) is Google‘s implementation of QUIC and related protocols",
project_url = "https://github.com/google/quiche",
version = "76531737853e2eb36ac2cc024f211431e7d28004",
sha256 = "4fff746f039eed8b7642133ef9008cc60406c0b739beac511db1f01377e06933",
version = "b5d556774fb971506e5912a357f0f8fb8ef08d12",
sha256 = "f600af67bfccec4a0e8b88f721371756429975b1956269ae034ce08247ae55bd",
urls = ["https://github.com/google/quiche/archive/{version}.tar.gz"],
strip_prefix = "quiche-{version}",
use_category = ["controlplane", "dataplane_core"],
release_date = "2024-01-17",
release_date = "2024-02-01",
cpe = "N/A",
license = "BSD-3-Clause",
license_url = "https://github.com/google/quiche/blob/{version}/LICENSE",
Expand Down
24 changes: 24 additions & 0 deletions changelogs/current.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -20,12 +20,18 @@ removed_config_or_runtime:
- area: http
change: |
Removed ``envoy.reloadable_features.allow_absolute_url_with_mixed_scheme`` runtime flag and legacy code paths.
- area: active health check
change: |
Removed ``envoy.reloadable_features.keep_endpoint_active_hc_status_on_locality_update`` runtime flag and legacy code paths.
- area: http1
change: |
Removed ``envoy.reloadable_features.http1_allow_codec_error_response_after_1xx_headers`` runtime flag and legacy code paths.
- area: overload manager
change: |
removed ``envoy.reloadable_features.overload_manager_error_unknown_action`` and legacy code paths.
- area: http
change: |
Removed ``envoy_reloadable_features_append_xfh_idempotent`` runtime flag and legacy code paths.
new_features:
- area: aws_request_signing
Expand All @@ -37,6 +43,11 @@ new_features:
Change HTTP status to 200 to respect the gRPC protocol. This may cause problems for incorrect gRPC clients expecting the filter
to preserve HTTP 1.1 responses. This behavioral change can be temporarily reverted by setting runtime guard
``envoy.reloadable_features.grpc_http1_reverse_bridge_change_http_status`` to false.
- area: quic
change: |
Added QUIC protocol option :ref:`send_disable_active_migration
<envoy_v3_api_field_config.listener.v3.QuicProtocolOptions.send_disable_active_migration>` to make the server send clients a transport
parameter to discourage client endpoints from active migration.
- area: ext_proc
change: |
implemented
Expand All @@ -51,5 +62,18 @@ new_features:
- area: compression
change: |
Added qatzstd :ref:`compressor <envoy_v3_api_msg_extensions.compression.qatzstd.compressor.v3alpha.Qatzstd>`.
- area: ext_proc
change: |
added
:ref:`metadata_options <envoy_v3_api_field_extensions.filters.http.ext_proc.v3.ExternalProcessor.metadata_options>`
config API to enable sending and receiving metadata from/to the external processing server. Both typed and untyped dynamic
metadata may be sent to the server. If
:ref:`receiving_namespaces <envoy_v3_api_field_extensions.filters.http.ext_proc.v3.MetadataOptions.receiving_namespaces>`
is defined, returned metadata may be written to the specified allowed namespaces.
- area: rbac
change: |
Added :ref:`uri_template<envoy_v3_api_field_config.rbac.v3.Permission.uri_template>` which uses existing
:ref:`UriTemplateMatchConfig<envoy_v3_api_msg_extensions.path.match.uri_template.v3.UriTemplateMatchConfig>`
to allow use of glob patterns for URI path matching in RBAC.
deprecated:
6 changes: 3 additions & 3 deletions contrib/generic_proxy/filters/network/source/stats.cc
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ CodeOrFlags::CodeOrFlags(Server::Configuration::ServerFactoryContext& context)
code_stat_names_.push_back(pool_.add(std::to_string(i)));
}

for (const auto& flag : StreamInfo::ResponseFlagUtils::ALL_RESPONSE_STRINGS_FLAGS) {
for (const auto& flag : StreamInfo::ResponseFlagUtils::CORE_RESPONSE_FLAGS) {
flag_stat_names_.emplace(flag.second, pool_.add(flag.first.short_string_));
}

Expand All @@ -42,13 +42,13 @@ Stats::StatName CodeOrFlags::statNameFromFlag(StreamInfo::ResponseFlag flag) con

absl::InlinedVector<StreamInfo::ResponseFlag, 2>
getResponseFlags(const StreamInfo::StreamInfo& info) {
if (info.responseFlags() == 0) {
if (!info.hasAnyResponseFlag()) {
return {};
}

absl::InlinedVector<StreamInfo::ResponseFlag, 2> flags;

for (const auto& flag : StreamInfo::ResponseFlagUtils::ALL_RESPONSE_STRINGS_FLAGS) {
for (const auto& flag : StreamInfo::ResponseFlagUtils::CORE_RESPONSE_FLAGS) {
if (info.hasResponseFlag(flag.second)) {
flags.push_back(flag.second);
}
Expand Down
2 changes: 2 additions & 0 deletions contrib/golang/common/go/api/api.h
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ typedef struct { // NOLINT(modernize-use-using)
Cstring plugin_name;
uint64_t configId;
int phase;
uint32_t worker_id;
} httpRequest;

typedef struct { // NOLINT(modernize-use-using)
Expand All @@ -25,6 +26,7 @@ typedef struct { // NOLINT(modernize-use-using)
uint64_t config_ptr;
uint64_t config_len;
int is_route_config;
uint32_t concurrency;
} httpConfig;

typedef enum { // NOLINT(modernize-use-using)
Expand Down
3 changes: 2 additions & 1 deletion contrib/golang/common/go/api/filter.go
Original file line number Diff line number Diff line change
Expand Up @@ -139,7 +139,8 @@ type StreamInfo interface {
FilterState() FilterState
// VirtualClusterName returns the name of the virtual cluster which got matched
VirtualClusterName() (string, bool)

// WorkerID returns the ID of the Envoy worker thread
WorkerID() uint32
// Some fields in stream info can be fetched via GetProperty
// For example, startTime() is equal to GetProperty("request.time")
}
Expand Down
11 changes: 10 additions & 1 deletion contrib/golang/filters/http/source/config.cc
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
#include "contrib/golang/filters/http/source/config.h"

#include <string>

#include "envoy/registry/registry.h"

#include "source/common/common/fmt.h"
Expand Down Expand Up @@ -33,7 +35,14 @@ Http::FilterFactoryCb GolangFilterConfig::createFilterFactoryFromProtoTyped(
proto_config, dso_lib, fmt::format("{}golang.", stats_prefix), context);
config->newGoPluginConfig();
return [config, dso_lib](Http::FilterChainFactoryCallbacks& callbacks) {
auto filter = std::make_shared<Filter>(config, dso_lib);
const std::string& worker_name = callbacks.dispatcher().name();
auto pos = worker_name.find_first_of('_');
ENVOY_BUG(pos != std::string::npos, "worker name is not in expected format worker_{id}");
uint32_t worker_id;
if (!absl::SimpleAtoi(worker_name.substr(pos + 1), &worker_id)) {
IS_ENVOY_BUG("failed to parse worker id from name");
}
auto filter = std::make_shared<Filter>(config, dso_lib, worker_id);
callbacks.addStreamFilter(filter);
callbacks.addAccessLogHandler(filter);
};
Expand Down
Loading

0 comments on commit 40edf73

Please sign in to comment.