diff --git a/BUILD b/BUILD index bc8c50266..914eaa892 100644 --- a/BUILD +++ b/BUILD @@ -243,6 +243,7 @@ proto_library( "//envoy/extensions/filters/udp/dns_filter/v3alpha:pkg", "//envoy/extensions/filters/udp/udp_proxy/v3:pkg", "//envoy/extensions/health_checkers/redis/v3:pkg", + "//envoy/extensions/http/header_formatters/preserve_case/v3:pkg", "//envoy/extensions/internal_redirect/allow_listed_routes/v3:pkg", "//envoy/extensions/internal_redirect/previous_routes/v3:pkg", "//envoy/extensions/internal_redirect/safe_cross_scheme/v3:pkg", diff --git a/envoy/config/core/v3/protocol.proto b/envoy/config/core/v3/protocol.proto index 8c7693c8a..ac2a4907b 100644 --- a/envoy/config/core/v3/protocol.proto +++ b/envoy/config/core/v3/protocol.proto @@ -2,6 +2,7 @@ syntax = "proto3"; package envoy.config.core.v3; +import "envoy/config/core/v3/extension.proto"; import "envoy/type/v3/percent.proto"; import "google/protobuf/duration.proto"; @@ -118,6 +119,7 @@ message Http1ProtocolOptions { option (udpa.annotations.versioning).previous_message_type = "envoy.api.v2.core.Http1ProtocolOptions"; + // [#next-free-field: 9] message HeaderKeyFormat { option (udpa.annotations.versioning).previous_message_type = "envoy.api.v2.core.Http1ProtocolOptions.HeaderKeyFormat"; @@ -136,6 +138,11 @@ message Http1ProtocolOptions { // Note that while this results in most headers following conventional casing, certain headers // are not covered. For example, the "TE" header will be formatted as "Te". ProperCaseWords proper_case_words = 1; + + // Configuration for stateful formatter extensions that allow using received headers to + // affect the output of encoding headers. E.g., preserving case during proxying. + // [#extension-category: envoy.http.stateful_header_formatters] + TypedExtensionConfig stateful_formatter = 8; } } diff --git a/envoy/config/core/v4alpha/protocol.proto b/envoy/config/core/v4alpha/protocol.proto index 1f0af4d12..7cc09a5fb 100644 --- a/envoy/config/core/v4alpha/protocol.proto +++ b/envoy/config/core/v4alpha/protocol.proto @@ -2,6 +2,7 @@ syntax = "proto3"; package envoy.config.core.v4alpha; +import "envoy/config/core/v4alpha/extension.proto"; import "envoy/type/v3/percent.proto"; import "google/protobuf/duration.proto"; @@ -121,6 +122,7 @@ message Http1ProtocolOptions { option (udpa.annotations.versioning).previous_message_type = "envoy.config.core.v3.Http1ProtocolOptions"; + // [#next-free-field: 9] message HeaderKeyFormat { option (udpa.annotations.versioning).previous_message_type = "envoy.config.core.v3.Http1ProtocolOptions.HeaderKeyFormat"; @@ -139,6 +141,11 @@ message Http1ProtocolOptions { // Note that while this results in most headers following conventional casing, certain headers // are not covered. For example, the "TE" header will be formatted as "Te". ProperCaseWords proper_case_words = 1; + + // Configuration for stateful formatter extensions that allow using received headers to + // affect the output of encoding headers. E.g., preserving case during proxying. + // [#extension-category: envoy.http.stateful_header_formatters] + TypedExtensionConfig stateful_formatter = 8; } } diff --git a/envoy/extensions/http/header_formatters/preserve_case/v3/BUILD b/envoy/extensions/http/header_formatters/preserve_case/v3/BUILD new file mode 100644 index 000000000..ee92fb652 --- /dev/null +++ b/envoy/extensions/http/header_formatters/preserve_case/v3/BUILD @@ -0,0 +1,9 @@ +# DO NOT EDIT. This file is generated by tools/proto_format/proto_sync.py. + +load("@envoy_api//bazel:api_build_system.bzl", "api_proto_package") + +licenses(["notice"]) # Apache 2 + +api_proto_package( + deps = ["@com_github_cncf_udpa//udpa/annotations:pkg"], +) diff --git a/envoy/extensions/http/header_formatters/preserve_case/v3/preserve_case.proto b/envoy/extensions/http/header_formatters/preserve_case/v3/preserve_case.proto new file mode 100644 index 000000000..64bdd497e --- /dev/null +++ b/envoy/extensions/http/header_formatters/preserve_case/v3/preserve_case.proto @@ -0,0 +1,19 @@ +syntax = "proto3"; + +package envoy.extensions.http.header_formatters.preserve_case.v3; + +import "udpa/annotations/status.proto"; + +option java_package = "io.envoyproxy.envoy.extensions.http.header_formatters.preserve_case.v3"; +option java_outer_classname = "PreserveCaseProto"; +option java_multiple_files = true; +option (udpa.annotations.file_status).package_version_status = ACTIVE; + +// [#protodoc-title: Preserve case header formatter] +// [#extension: envoy.http.stateful_header_formatters.preserve_case] + +// Configuration for the preserve case header formatter. +// See the :ref:`header casing ` configuration guide for more +// information. +message PreserveCaseFormatterConfig { +} diff --git a/versioning/BUILD b/versioning/BUILD index 83e85ed89..daadfd39e 100644 --- a/versioning/BUILD +++ b/versioning/BUILD @@ -126,6 +126,7 @@ proto_library( "//envoy/extensions/filters/udp/dns_filter/v3alpha:pkg", "//envoy/extensions/filters/udp/udp_proxy/v3:pkg", "//envoy/extensions/health_checkers/redis/v3:pkg", + "//envoy/extensions/http/header_formatters/preserve_case/v3:pkg", "//envoy/extensions/internal_redirect/allow_listed_routes/v3:pkg", "//envoy/extensions/internal_redirect/previous_routes/v3:pkg", "//envoy/extensions/internal_redirect/safe_cross_scheme/v3:pkg",